3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { $id; $name; } $chaim = new Person(); $chaim->id = 1; $chaim->name = 'Chaim Brykman'; $a = array(new StdObject); $filtered = array_filter($a, function($i) { return $i; })[0]; print_r($filtered);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '$id' (T_VARIABLE), expecting function (T_FUNCTION) in /in/oQaXN on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/oQaXN on line 4
Process exited with code 255.

preferences:
183.43 ms | 1395 KiB | 66 Q