ID: 46823 Updated by: ka...@php.net Reported By: Thomas dot Worm at gsp-software dot de -Status: Open +Status: Bogus Bug Type: Feature/Change Request -Operating System: Windows +Operating System: * PHP Version: 5.3.0alpha3 New Comment:
We cannot change past releases, as adding BC for new language elements/constructs in future versions requires the parser to be altered. Same thing with PHP4 doesn't support method chainging, or PHP 5.1 allows Array as type hint. If you want to use namespaces you will need to use PHP 5.3 or greater, BC cannot and will not be added. Previous Comments: ------------------------------------------------------------------------ [2008-12-10 14:47:59] Thomas dot Worm at gsp-software dot de Description: ------------ I would like to do backward compatibility in namespace code. Reproduce code: --------------- <?php if ( (float) substr(phpversion(),0,3) >= 5.3) namespace MySpace\SubSpace; ?> <? if ( (float) substr(phpversion(),0,3) >= 5.3) use MySpace\SubSpace\MyClass; ?> Expected result: ---------------- In PHP >= 5.3... All classes are in \MySpace\SubSpace In PHP < 5.3... All classes are in global Space \ Actual result: -------------- Parse error: parse error, expecting `T_NS_SEPARATOR' in space.lib.php on line 3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46823&edit=1