From:             tokie at hanmail dot net
Operating system: All
PHP version:      4.3.5RC1
PHP Bug Type:     Feature/Change Request
Bug description:  Reserve the promised keywords private, public and protected earlier 
for ...

Description:
------------
I've been waitning for the version 5 of PHP. and I've been actually
preparing for the next major release of PHP like this:

<?php
class SiteBase {
    function __construct() { // do something }

    // for PHP 4.x
    function SiteBase() { $this->__construct(); }

    // public
    function Show() { ... }

    // private
    function IsRoot() { ... }
} // end class
?>

and because public, private or protected modifiers are not yet keywords in
4.x so I had to comment them every time.

But I think it would be better if the PHP 4.x just can recognise them as
keywords but do nothing for them. I mean they can be "reserved" for the
next version of PHP.

Expected result:
----------------
<?php
class PHP5Class { // but it will work in PHP4 too.
    public $Var1;
    private $Var2;
    protected $var3; // works in PHP4 but the modifier 'protected' will be
ignored and replaced with 'var' and so on.

     // 'static' or 'final' also ingored in PHP 4
    static protected function F1() { ... }
   
    // but this should not be permitted because the name 'protected' is
reserved
    function protected() { ... }

}
?>


-- 
Edit bug report at http://bugs.php.net/?id=27102&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27102&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27102&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27102&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27102&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27102&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27102&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27102&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27102&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27102&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27102&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27102&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27102&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27102&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27102&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27102&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27102&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27102&r=float

Reply via email to