Jessie Hernandez wrote:
Hello Rasmus,
Rasmus Lerdorf wrote:
Jessie Hernandez wrote:
Why is "\" the only available character? Right now my patch is using
":" and it's working great (though against 5.1). Is ":" used in some
other way in PHP 6?
It clashes with the : in the ternary.
-Rasmus
Not in my patch! I just tested the example below with my patch, and it
works *PERFECTLY*:
<?php
namespace ns
{
class test1
{
public static function getMessage()
{
return 'ternary test (left side)!';
}
}
class test2
{
public static function getMessage()
{
return 'ternary test (right side)!';
}
}
}
echo ( ( time() % 2 ) == 0 ? ns:test1::getMessage() :
ns:test2::getMessage() );
?>
Are you saying this works?
namespace ns {
function foo() { }
}
function foo() {}
echo true ? ns:foo():foo();
Looks very confusing to me.
-Rasmus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php