3v4l.org

run code in 500+ PHP versions simultaneously
<?php $list = [ ['a' => 1, 'b' => 'x'], ['a' => 2, 'b' => 'y'], ['a' => 3, 'd' => 'z'], ]; array_column($list, 'a'); // [1, 2, 3] array_column($list, 'b'); // [x, y] array_column($list, 'a', 'b'); // [x => 1, y => 2, 0 => 3] class X { function __construct(public int $a, public string $b, public string $c) } $list = [ new X(a: 1, b: 'x'), new X(a: 2, b: 'y'), new X(a: 3, d: 'z'), ]; array_column($list, 'a'); // [1, 2, 3] ?>
Output for rfc.property-hooks, git.master, git.master_jit
Parse error: syntax error, unexpected token "}", expecting ";" or "{" in /in/Nc1uL on line 17
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
65.65 ms | 2694 KiB | 3 Q