hab kleines php problem

Dima
Hallo,

bekomme diese Fehlermeldung

code:
1:
Parse error: syntax error, unexpected T_STRING, expecting '(' in /www/htdocs/w005db82/tracker1/classes/status.inc.php on line 23




und das ist die datei

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
<?php
    /**
     * DLScripts
     *
     * LICENSE
     *
     * This source file is subject to the GNU GENERAL PUBLIC LICENSE that is bundled
     * with this package in the file LICENSE.txt.
     * It is also available through the world-wide-web at this URL:
     * http://www.gnu.org/copyleft/gpl.html
     *
     * @category   DLScripts
     * @package    Sponsorennetzwerk V4
     * @copyright  Copyright (c) 2002-2008 DlScripts (http://www.dlscripts.net)
     * @license    http://www.gnu.org/copyleft/gpl.html     GNU GENERAL PUBLIC LICENSE
     */

     class Status
     {
       private $status_text;
       private $status_style;
    
        public function __construct Status()
        {
          $this->status_text = array(STATUS_UNPAID   => 'unbezahlt',
                                     STATUS_ACTIVE   => 'aktiv',
                                     STATUS_STOPPED  => 'gestoppt',
                                     STATUS_ADMIN_AC => 'Admin-Ac.',
                                     STATUS_UNKNOWN  => 'unbekannt');
    
          $this->status_style = array(STATUS_UNPAID   => 'unpaid',
                                      STATUS_ACTIVE   => 'active',
                                      STATUS_STOPPED  => 'stopped',
                                      STATUS_ADMIN_AC => 'admin_ac',
                                      STATUS_UNKNOWN  => 'unknown');
        }
    
        function getStyle($status_id) { return $this->status_style[$status_id]; }
        function getText($status_id)  { return $this->status_text[$status_id];  }
    
        function getStyleArray()      { return $this->status_style;             }
        function getTextArray()       { return $this->status_text;              }
     }














?>


hoffe einer kann helfen vielen dank
Maniac_81
Ich bin in OOP zwar noch nicht ganz so fit, aber ich denke das liegt daran das in Zeile 23 nach __construct noch die eigentliche funktion steht. ein Construct sollte doch ne eigene funktion sein.
Dima
hi, du warst fit genug um das zu lösen vielen dank.

gruß
kingobelix
Wie wurde der Fehler nun gelöst? Ich habe das gleiche Problem und stehe da etwas auf dem Schlauch.
Maniac_81
php:
1:
public function __construct Status()


Darf so nicht dran stehn, weil hinter __construct noch eine Funktion (Status()) steht.
kingobelix
DAU-Frage:

Wie müsste es lauten? Also einfach nen Absatz dahin (wohl kaum, damit endet ja nichts)...

Edit: Habs smile
Danke dir. Einfach __.. entfernen
Hawkes
Zitat:
Original von kingobelix
DAU-Frage:

Wie müsste es lauten? Also einfach nen Absatz dahin (wohl kaum, damit endet ja nichts)...

Edit: Habs smile
Danke dir. Einfach __.. entfernen


Äh nein.

Es muss

php:
1:
public function __construct() {


lauten, wobei die geschweifte Klammer auch in die nächste Zeile kann. Je nach Code Guideline, die man gerade verwendet.