3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $a = 'a'; protected $b = 'b'; private $c = 'c'; } function objectToArray ($object) { $array = (array) $object; return array_combine( array_map(function($k) { return $k}, array_keys($array)), array_values($array) ); } $array = objectToArray( new \Test()); var_export((array) new \Test());
Output for 7.1.17
Parse error: syntax error, unexpected '}', expecting ';' in /in/gfMs1 on line 17
Process exited with code 255.

preferences:
153.86 ms | 1394 KiB | 8 Q