Hi,

I was looking at namespaces in PHP 5.3, http://de3.php.net/manual/en/language.namespaces.definition.php. There I found myself wondering why a leading backslash in namespace declaration
is not allowed. For example:

<?php

namespace \A {
 echo "in namespace \\A\n";
}

?>


I image that a trailing backslash could become a common programming error,
especially as it is required when refering to symbols with their absolute name.

<?php

namespace A {
    const FOO = "This is FOO in namespace \\A\n";
}

namespace B {
    echo \A\FOO;
}

?>

Best regards,
  Bernhard Schmalhofer





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to