TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
604 B
46 lines
604 B
--TEST--
|
|
compact() with object context
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(
|
|
(new class {
|
|
function test(){
|
|
return compact('this');
|
|
}
|
|
})->test()
|
|
);
|
|
|
|
var_dump(
|
|
(new class {
|
|
function test(){
|
|
return compact([['this']]);
|
|
}
|
|
})->test()
|
|
);
|
|
|
|
var_dump(
|
|
(new class {
|
|
function test(){
|
|
return (function(){ return compact('this'); })();
|
|
}
|
|
})->test()
|
|
);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
array(1) {
|
|
["this"]=>
|
|
object(%s)#1 (0) {
|
|
}
|
|
}
|
|
array(1) {
|
|
["this"]=>
|
|
object(%s)#1 (0) {
|
|
}
|
|
}
|
|
array(1) {
|
|
["this"]=>
|
|
object(%s)#1 (0) {
|
|
}
|
|
}
|
|
|