3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($test) { return new class($test) { public function __construct(public $test) {} }; } function test3($test) { return eval("return new class($test) { public function __construct(public \$test) {}};" ); } function compare($a, $b) { var_dump([ $a == $b, $a === $b, get_class($a) == get_class($b), ]); } compare(test(1), test(1)); // true, false, true, compare(test3(1), test3(1)); // false, false, false,

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
151.51 ms | 1480 KiB | 15 Q