mirror of
https://github.com/php/php-src.git
synced 2025-01-13 22:44:36 +08:00
d96dda8d49
And also cleanup anonymous class compiling, it make no sense prefix a namespace to anonymous class name. and it is always lowcased and interned string.
24 lines
360 B
PHP
24 lines
360 B
PHP
--TEST--
|
|
testing anon classes in functions outside of classes in namespaces
|
|
--FILE--
|
|
<?php
|
|
namespace lone {
|
|
function my_factory() {
|
|
return new class{};
|
|
}
|
|
|
|
class Outer {
|
|
|
|
public function __construct() {
|
|
var_dump(
|
|
my_factory());
|
|
}
|
|
}
|
|
|
|
new Outer();
|
|
}
|
|
--EXPECTF--
|
|
object(class@%s)#2 (0) {
|
|
}
|
|
|