3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo implements ArrayAccess { public $Id, $Title; public function offsetExists($offset) { return isset($this->{$offset}); } public function offsetGet($offset) { return $this->{$offset}; } public function offsetSet($offset, $value) { $this->{$offset} = $value; } public function offsetUnset($offset) { unset($this->{$offset}); } } $object = new Foo(); $object->Id = 1; $object->Title = 'Test'; $records = array( $object ); print_r(array_column($records, 'Title'));
Output for 7.0.0 - 7.1.0
Array ( [0] => Test )
Output for 5.5.24 - 5.6.28
Array ( )
Output for 5.0.0 - 5.4.45
Fatal error: Call to undefined function array_column() in /in/p9MTh on line 36
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting '{' in /in/p9MTh on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting '{' in /in/p9MTh on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'{'' in /in/p9MTh on line 3
Process exited with code 255.