3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Item { public $id; public $createdAt; } $data = ['id' => 123, 'createdAt' => '2014-01-01 12:34:56']; $obj = (Item) $data; var_dump($data, $obj);
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '$data' (T_VARIABLE) in /in/qbPpb on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/qbPpb on line 9
Process exited with code 255.