3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 1 => ['A' => '1', 'B' => 1, 'C' => 'TEMU3076746'], 2 => ['A' => '2', 'B' => 1.3, 'C' => 'FCIU5412720'], 3 => ['A' => '3', 'B' => 1.5, 'C' => 'TEMU3076746'], 4 => ['A' => '4', 'B' => 1.8, 'C' => 'TEMU3076746'], 5 => ['A' => '5', 'B' => 2, 'C' => 'FCIU5412720'] ]; var_export(array_column($arr, 'B', 'B')); echo "\n---\n"; var_export(array_count_values(array_column($arr, 'B'))); echo "\n---\n"; var_export(array_unique(array_column($arr, 'B')));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 1.3 to int loses precision in /in/6ae1o on line 11 Deprecated: Implicit conversion from float 1.5 to int loses precision in /in/6ae1o on line 11 Deprecated: Implicit conversion from float 1.8 to int loses precision in /in/6ae1o on line 11 array ( 1 => 1.8, 2 => 2, ) --- Warning: array_count_values(): Can only count string and integer values, entry skipped in /in/6ae1o on line 15 Warning: array_count_values(): Can only count string and integer values, entry skipped in /in/6ae1o on line 15 Warning: array_count_values(): Can only count string and integer values, entry skipped in /in/6ae1o on line 15 array ( 1 => 1, 2 => 1, ) --- array ( 0 => 1, 1 => 1.3, 2 => 1.5, 3 => 1.8, 4 => 2, )

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:
31.22 ms | 402 KiB | 8 Q