3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sort($a,$b){ return strlen($b)-strlen($a); } $data = array("kaushik","kaushik is","kaushik is great","is","is great","great"); usort($data,'sort'); $current = ""; for($i=0;$i<count($data);$i++) { $current=$data[$i]; for($j=$i+1;$j<count($data);$i++) { $current=str_replace($data[$j],"",$current); } if ($current=="") { echo $current."\n"; } } ?>
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.28, 5.4.0 - 5.4.26
Fatal error: Cannot redeclare sort() in /in/HDOLA on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot redeclare sort() in /in/HDOLA on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot redeclare sort() in /in/HDOLA on line 2

preferences:
197.38 ms | 1395 KiB | 116 Q