#27102 [Opn->WFx]: Reserve the promised keywords private, public and protected earlier for ...

From: Date: Sat, 31 Jan 2004 11:53:22 +0000
Subject: #27102 [Opn->WFx]: Reserve the promised keywords private, public and protected earlier for ...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54204@lists.php.net to get a copy of this message
ID: 27102 Updated by: derick@php.net Reported By: tokie at hanmail dot net -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: All PHP Version: 4.3.5RC1 New Comment: It would have been nice if we did this from 4.3.0 on, but if we do it now it would really matter anymore, and also we are now in bug0-fix only mode for PHP 4. (And obviously this request doesn't make sense for PHP 5). Previous Comments: ------------------------------------------------------------------------ [2004-01-31 05:50:58] tokie at hanmail dot net 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 this bug report at http://bugs.php.net/?id=27102&edit=1

« previous php.bugs (#54204) next »