1--TEST-- 2compact() without object context 3--FILE-- 4<?php 5 6var_dump( 7 (new class { 8 function test(){ 9 return (static function(){ return compact('this'); })(); 10 } 11 })->test() 12); 13 14var_dump(compact('this')); 15 16var_dump((function(){ return compact('this'); })()); 17 18?> 19--EXPECT-- 20array(0) { 21} 22array(0) { 23} 24array(0) { 25} 26