3v4l.org

run code in 300+ PHP versions simultaneously
<?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'));

preferences:
44.6 ms | 402 KiB | 5 Q