3v4l.org

run code in 300+ PHP versions simultaneously
<?php public class Person { public $id; public $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 'public' (T_PUBLIC) in /in/fK2OT on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PUBLIC in /in/fK2OT on line 2
Process exited with code 255.

preferences:
178.65 ms | 1395 KiB | 66 Q