php-src/Zend/tests/class_alias_012.phpt

34 lines
437 B
Plaintext
Raw Normal View History

2008-05-12 22:58:41 +08:00
--TEST--
Testing dynamic alias name
--FILE--
<?php
2008-12-05 04:12:30 +08:00
namespace test\baz;
2008-05-12 22:58:41 +08:00
class foo {
}
new foo;
2008-12-05 04:12:30 +08:00
class_alias(__NAMESPACE__ .'\foo', __NAMESPACE__ .'\T');
2008-05-12 22:58:41 +08:00
var_dump(new foo);
var_dump(new T);
2008-12-05 04:12:30 +08:00
$var = __NAMESPACE__ .'\foo';
2008-05-12 22:58:41 +08:00
var_dump(new $var);
2008-12-05 04:12:30 +08:00
$var = __NAMESPACE__ .'\T';
2008-05-12 22:58:41 +08:00
var_dump(new $var);
?>
--EXPECTF--
2008-12-05 04:12:30 +08:00
object(test\baz\foo)#%d (0) {
2008-05-12 22:58:41 +08:00
}
2008-12-05 04:12:30 +08:00
object(test\baz\foo)#%d (0) {
2008-05-12 22:58:41 +08:00
}
2008-12-05 04:12:30 +08:00
object(test\baz\foo)#%d (0) {
2008-05-12 22:58:41 +08:00
}
2008-12-05 04:12:30 +08:00
object(test\baz\foo)#%d (0) {
2008-05-12 22:58:41 +08:00
}