php-src/Zend/tests/class_alias_016.phpt

25 lines
326 B
Plaintext
Raw Normal View History

2008-05-12 14:58:41 +00:00
--TEST--
Testing creation of alias to global scope
--FILE--
<?php
namespace foo;
class bar {
}
2008-12-04 20:12:30 +00:00
class_alias('foo\bar', 'foo');
2008-05-12 14:58:41 +00:00
2008-12-04 20:12:30 +00:00
var_dump(new \foo);
2008-05-12 14:58:41 +00:00
var_dump(new foo);
?>
--EXPECTF--
2008-12-04 20:12:30 +00:00
object(foo\bar)#%d (0) {
2008-05-12 14:58:41 +00:00
}
Fatal error: Uncaught Error: Class 'foo\foo' not found in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d