Parse error bei Klassenaufruf

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Parse error bei Klassenaufruf

    Ich erhalte im folgenden Script eine Fehlermeldung.

    PHP Code:
    <?php
    class VCard {

        private 
    $output;
        private 
    $output_format;
        private 
    $first_name;
        private 
    $middle_name;
        private 
    $last_name;
        private 
    $edu_title;
        private 
    $addon;
        private 
    $nickname;
        private 
    $company;
        private 
    $organisation;
        private 
    $department;
        private 
    $job_title;
        private 
    $note;
        private 
    $tel_work1_voice;
        private 
    $tel_work2_voice;
        private 
    $tel_home1_voice;
        private 
    $tel_home2_voice;
        private 
    $tel_cell_voice;
        private 
    $tel_car_voice;
        private 
    $tel_pager_voice;
        private 
    $tel_additional;
        private 
    $tel_work_fax;
        private 
    $tel_home_fax;
        private 
    $tel_isdn;
        private 
    $tel_preferred;
        private 
    $tel_telex;
        private 
    $work_street;
        private 
    $work_zip;
        private 
    $work_city;
        private 
    $work_region;
        private 
    $work_country;
        private 
    $home_street;
        private 
    $home_zip;
        private 
    $home_city;
        private 
    $home_region;
        private 
    $home_country;
        private 
    $postal_street;
        private 
    $postal_zip;
        private 
    $postal_city;
        private 
    $postal_region;
        private 
    $postal_country;
        private 
    $url_work;
        private 
    $role;
        private 
    $birthday;
        private 
    $email;
        private 
    $rev;
        private 
    $lang;

        function 
    __construct($lang '') {
            
    $this->card_filename     = (string) time() . '.vcf';
            
    $this->rev                = (string) date('Ymd\THi00\Z',time());
            
    $this->setLanguage($lang);
        } 
    // end function

    [...]
    In einer anderen Datei wird die Klasse wie folgt aufgerufen:

    PHP Code:
    [...]
    include_once 
    'class.vCard.inc.php';
    $vCard = (object) new vCard('','');
    [...] 
    Ich erhalte einen Parse-Error in der Klasse in Zeile 4.

    Hat jemand eine Idee woran das liegen könnte?

    Verwendetes System: Apache/2.0.47 (Win32) PHP/4.3.3

  • #2
    einmal hast du vCard mit kleinem und einmal mit großem V geschrieben
    (-:
    Bookmarks:·Bilder·Jobs·Recht·
    kostenloser Webkataloge-Assistent

    Comment


    • #3
      wo hast du die class her?

      soviel ich weiss, gibt es 'private' in php4 nicht.

      also musst du daraus 'var' machen.
      INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


      Comment


      • #4
        private wird erst mit Vers. 5 eingeführt. Da bist du der Zeit vorraus...

        Comment


        • #5
          -> http://sourceforge.net/project/showf...ease_id=131969

          Dort ganz unten gibts das Script.

          Danke für eure Hilfe.

          Comment


          • #6
            Original geschrieben von Uzimaster
            Dort ganz unten gibts das Script.
            das ändert aber nichts daran, dass es erst ab php5 läuft.

            die ältere version ist auch auf php4 lauffähig. nur als info ....
            INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


            Comment

            Working...
            X