#46823 [Opn->Bgs]: backward compatibility of namespaces

From: Date: Wed, 17 Dec 2008 04:40:27 +0000
Subject: #46823 [Opn->Bgs]: backward compatibility of namespaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132076@lists.php.net to get a copy of this message
 ID:               46823
 Updated by:       kalle@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



Thread (2 messages)

« previous php.bugs (#132076) next »