php-8.0.30-src/ext/standard/tests/array/compact_no_this.phpt

26 lines
343 B
PHP

--TEST--
compact() without object context
--FILE--
<?php
var_dump(
(new class {
function test(){
return (static function(){ return compact('this'); })();
}
})->test()
);
var_dump(compact('this'));
var_dump((function(){ return compact('this'); })());
?>
--EXPECT--
array(0) {
}
array(0) {
}
array(0) {
}