3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => [ "user_type" => 'Manager', "total_count" => 3, ], 1 => [ "user_type" => 'Director', "total_count" => 2, ], ]; /** * @param array $a */ function pr($a = []) { echo "<pre>"; print_r($a); echo "</pre>"; } $arr = array_combine(['labels','dataset'],array_map(null, ...$arr)); if(!in_array('Trainee',$arr['labels'])){ array_push($arr['labels'],'Trainee'); array_push($arr['dataset'],0); } print_r($arr);die;
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [labels] => Array ( [0] => Manager [1] => Director [2] => Trainee ) [dataset] => Array ( [0] => 3 [1] => 2 [2] => 0 ) )

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:
158.09 ms | 409 KiB | 6 Q