3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subjectSlots = [ "tamil" => [1, 2, 3, 4, 5], "english" => [4, 5, 6], "maths" => [1, 5, 8], "social" => [1, 2, 5], "pt" => [1], "hindi" => [3, 4, 7] ]; $requiredSubjects = ['tamil', 'tamil', 'pt', 'maths', 'maths', 'social', 'hindi', 'english']; usort($requiredSubjects, function($a, $b) use ($subjectSlots) { return $subjectSlots[$a] <=> $subjectSlots[$b]; }); var_export($requiredSubjects);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'pt', 1 => 'social', 2 => 'maths', 3 => 'maths', 4 => 'hindi', 5 => 'english', 6 => 'tamil', 7 => 'tamil', )

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:
27.98 ms | 405 KiB | 5 Q