Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56083 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48364 invoked from network); 7 Nov 2011 02:54:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2011 02:54:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php-dev@zerocue.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 67.200.53.250 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 67.200.53.250 mail.zerocue.com Linux 2.6 Received: from [67.200.53.250] ([67.200.53.250:57336] helo=mail.zerocue.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/B1-26948-84847BE4 for ; Sun, 06 Nov 2011 21:54:00 -0500 To: Date: Sun, 6 Nov 2011 20:53:52 -0600 Message-ID: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01CC9CC6.342F3B30" X-Mailer: Microsoft Outlook 14.0 Thread-Index: Acyc9+LIVH31bUatS/eIW7rhOla9iw== Content-Language: en-us Subject: Help w/ Parser From: php-dev@zerocue.com ------=_NextPart_000_0001_01CC9CC6.342F3B30 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0002_01CC9CC6.342F3B30" ------=_NextPart_001_0002_01CC9CC6.342F3B30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm having trouble getting some changes to the parser to recognize some new syntax. I've attached a patch of what I've done. Here is the syntax I am trying to get to be parsed properly: Seconds = $Seconds; } // Getters/Setters public $Hours { get { return $this->Seconds / 3600; } set { $this->Seconds = $value * 3600; } // The variable $value holds the incoming value to be "set" } }; ?> After compiling and attempting to execute the above PHP file, I'm getting this parse error: Parse error: syntax error, unexpected 'get' (T_STRING), expecting get (T_GET) or set (T_SET) in /mnt/hgfs/svn/php-src-test/test.php on line 13 Why is the parse recognizing the 'get' as T_STRING rather than get (T_GET)? Thanks, -Clint ------=_NextPart_001_0002_01CC9CC6.342F3B30 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I’m = having trouble getting some changes to the parser to recognize some new = syntax.  I’ve attached a patch of what I’ve = done.

 

Here is the syntax I am trying to get to be parsed = properly:

<?php

class = TimePeriod {

     =

     public = $Seconds;

 

     public function __construct($Seconds) = {

           = $this->Seconds =3D $Seconds;

     }

=

     // = Getters/Setters

     public = $Hours {

           get { = return $this->Seconds / 3600; }

           set { = $this->Seconds =3D $value * 3600; } // The variable $value holds the = incoming value to be "set"

     }

};

?>

 

After = compiling and attempting to execute the above PHP file, I’m = getting this parse error:

 

Parse error: syntax error, = unexpected 'get' (T_STRING), expecting get (T_GET) or set (T_SET) in = /mnt/hgfs/svn/php-src-test/test.php on line 13

 

Why is the = parse recognizing the ‘get’ as T_STRING rather than get = (T_GET)?

 

Thanks,

 

-Clint

------=_NextPart_001_0002_01CC9CC6.342F3B30-- ------=_NextPart_000_0001_01CC9CC6.342F3B30--