|
From: sbarex <sb...@gm...> - 2010-08-05 06:33:12
|
I'm programming for php 5 (and I also enable syntax check for php5 in
phpparserplugin option panel).
I don't define my clone method but use some functions or external code that
use it.
For example imagik extension define the class method $imagik->clone() to
generate a duplicate of a object picture (I think is not correct for the
syntax rule of php5...) ; alto TCPDF library use clone keyword to duplicate
objects.
In these examples ($class->clone(); or clone $obj;) jedt show a error in the
code (but php 5.3.1 process the file correctly)...
Bugzilla from row...@gm... wrote:
>
> sbarex wrote (on 02/08/2010):
>> With JEdit 4.3.2 and PHPParserPlugin 1.2.7 (also tested with daily build
>> 1.2.8 of 2010-06-15_12-06-00) the parser show an error on every line with
>> the clone method (ex.: $myclass->clone(); ).
>> The errors are:
>> expression expected
>> ';' expected
>> statment expected
>>
>> I see that in a change log of a previous version of the parser the
>> supporto
>> of clone keywoard but this not solve the problem.
>>
>> Very thanks
>> Simon
>>
>
> What PHP version are you coding for? If I define the class below, I get
> a parser error from PHP if I try to compile it under PHP 5.2.13:
>
> <?php
> class Foo
> {
> public function clone()
> {
> echo 'Hello';
> }
> }
> ?>
>
> Parse error: syntax error, unexpected T_CLONE, expecting T_STRING in
> /home/rowanc/tmp/clone.php on line 4
>
> The only other way $object->clone() would make any sense would be if
> you'd defined __call() on the class, in which case it is apparently
> parseable, but it doesn't seem like a great idea. If it's a clone
> method, call it "__clone()", and use "clone $object" to call it; if it's
> not, call it something else. (I appreciate that it's not always as
> simple as that, and that may not be an option...)
>
> While it's arguably a bug that the jEdit parser treats this differently
> to PHP, I wouldn't be surprised to see PHP treating that syntax as
> invalid in a future version too.
>
> --
>
> Rowan Collins
>
> Senior Developer | Click with Technology
>
> t. 0845 456 0070 w. clickwt.com <http://www.clickwt.com>
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> --
> -----------------------------------------------
> jEdit Users' List
> jEd...@li...
> https://lists.sourceforge.net/lists/listinfo/jedit-users
>
>
--
View this message in context: http://old.nabble.com/problem-with-phpparser-and-clone-method-tp29322479p29354012.html
Sent from the jedit-users mailing list archive at Nabble.com.
|