3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 'labels' => ['Manager','Director'], 'dataset' => [3, 2] ]; $arr = array_combine(['labels','dataset'], array_map(null, $arr)); function setData($userType, $array) { if(!in_array($userType, $array['labels'])){ array_push($array['labels'], $userType); array_push($array['dataset'], 0); } return $array; } foreach(['Manager', 'Trainee', 'Director'] as $type) { $arr = setData($type, $arr); } 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:
166.74 ms | 406 KiB | 5 Q