Edit report at https://bugs.php.net/bug.php?id=28261&edit=1

 ID:                 28261
 Comment by:         rayro at gmx dot de
 Reported by:        Philippe dot Jausions at 11abacus dot com
 Summary:            Lifting reserved keyword restriction for method
                     names
 Status:             Open
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   *
 PHP Version:        *
 Block user comment: N
 Private report:     N

 New Comment:

It would be nice to see this in future releases!


Previous Comments:
------------------------------------------------------------------------
[2011-08-08 16:13:17] steven_nikkel at ertyu dot org

Would this prevent the keyword eval from being used within code being eval'd?

That appears to be the bug I'm running into, even though the keyword is only 
used in contained javascript code, not php, even included as a comment it fails.

------------------------------------------------------------------------
[2011-07-26 15:56:42] info at strictcoding dot co dot uk

+1 for this feature request!

------------------------------------------------------------------------
[2011-07-10 19:47:43] s...@php.net

The patch seems not to work with tokenizer extension - the extension returns 
wrong 
tokens (T_EVAL instead of expected T_STRING).

------------------------------------------------------------------------
[2009-06-30 05:52:23] taufiq at krimnet dot com

I need this bug to be resolved.

I'm writing Javascript/CSS collector & minify library. 

I would like to code like below.

JS::include(FILE_PATH)->include(FILE_PATH2)->include(FILE_PATH3);

having method name other than include() is pretty annoying.

------------------------------------------------------------------------
[2007-12-16 00:46:09] kentfredric at gmail dot com

At the moment (5.2.3 ) this is perfectly valid.

Class A{
  function __call( $function, $args ){
     if( $function == 'print' ){
        print "MyPrint: {$args[0]}";
      }
   }
}
$a = new A();
$a->print( "hello" ); #<-- surprisingly, this is not an invalid use of a 
keyword to the lexer. 
  # >> MyPrint: hello

but this

Class A{
  function print( $args ){
        print "MyPrint: {$args}";
   }
}
$a = new A();
$a->print( "hello" );

Yields a parse error "Parse error: syntax error, unexpected T_PRINT, expecting 
T_STRING"

which appears to be an illogical design contstraint. 

I've seen rather brutal slander for people attempting to perform this ( #14178 
, this bug ) amounting to "hey, you suck, dont do that" without any rational 
explanation.

So yes, I look forward to this feature being integrated.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=28261


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=28261&edit=1

Reply via email to