|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-31 06:53 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 10:00:01 2025 UTC |
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() { ... } } ?>