3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['black', 'white and black', 'lion', 'fast', 'zebra', 'lion is fast', 'zebra is white']; $str = "zebra is white and black, and lion is fast"; function sortl($a,$b){ return strlen($b)-strlen($a); } usort($arr,'sortl'); foreach($arr as $s){ if(strpos($str, $s) !== false){ $new[] = $s; $str = str_replace($s, "", $str); } } Var_dump($new);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(15) "white and black" [1]=> string(12) "lion is fast" [2]=> string(5) "zebra" }

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