3v4l.org

run code in 300+ PHP versions simultaneously
<?php $orderDoc = array("ORT", "TRI", "CONT", "RMI"); $FindDoc= array("RMI0000191","ORT0000379","ORT0000391","ORT0000392","ORT0000390","CONT0000274","CONT0000275","RMI0000192","ORT0000391"); $result =[]; foreach($orderDoc as $doc){ $temp = preg_grep("/^". preg_quote($doc) . "/", $FindDoc); sort($temp); $result = array_merge($result, $temp); } var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(9) { [0]=> string(10) "ORT0000379" [1]=> string(10) "ORT0000390" [2]=> string(10) "ORT0000391" [3]=> string(10) "ORT0000391" [4]=> string(10) "ORT0000392" [5]=> string(11) "CONT0000274" [6]=> string(11) "CONT0000275" [7]=> string(10) "RMI0000191" [8]=> string(10) "RMI0000192" }

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