3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $class = new \stdClass(); $class->name = 'Test'; var_dump($class); $names = array_column([$class], 'name'); var_dump($names);
Output for hhvm-3.17.3 - 3.22.0, 7.0.0 - 7.3.0
object(stdClass)#1 (1) { ["name"]=> string(4) "Test" } array(1) { [0]=> string(4) "Test" }
Output for 5.5.0 - 5.6.38, hhvm-3.10.1 - 3.15.4
object(stdClass)#1 (1) { ["name"]=> string(4) "Test" } array(0) { }
Output for 5.4.0 - 5.4.45
object(stdClass)#1 (1) { ["name"]=> string(4) "Test" } Fatal error: Call to undefined function array_column() in /in/Nsjvl on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/Nsjvl on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Nsjvl on line 3 Parse error: syntax error, unexpected '[', expecting ')' in /in/Nsjvl on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Nsjvl on line 3 Parse error: parse error, unexpected '[', expecting ')' in /in/Nsjvl on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Nsjvl on line 3 Parse error: parse error, expecting `')'' in /in/Nsjvl on line 7
Process exited with code 255.