3v4l.org

run code in 300+ PHP versions simultaneously
<?php $headers = ['Color', 'Length', 'Waist']; $data = [ [ ['green', 'Color'], ['23', 'Length'], ], [], [ ['23', 'Length'], ['24', 'Waist'], ], ]; $defaults = array_fill_keys($headers, null); var_export( array_map( function($item) use($defaults) { return array_replace($defaults, array_column($item, 0, 1)); }, $data ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'Color' => 'green', 'Length' => '23', 'Waist' => NULL, ), 1 => array ( 'Color' => NULL, 'Length' => NULL, 'Waist' => NULL, ), 2 => array ( 'Color' => NULL, 'Length' => '23', 'Waist' => '24', ), )

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:
33.99 ms | 406 KiB | 5 Q