3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // $a = array( 'kaushik', 'kaushik is', 'kaushik is great', 'is', 'is great', 'great' ); $a = array('usb', 'pc', 'cam 168', 'cam', '168', 'cam 168'); $a = array_unique($a); $s = count($a) - 1; $p = array(); foreach ($a as $key => $b) { $x = 0; for ($i = 0; $i < count($a); $i++) { if ($key == $i) continue; $c = $a; unset($c[$key]); if (strpos($c[$i], $b) === false) $x++; if ($x == $s) array_push($p, $key); } } foreach ($print_following as $o => $value) { echo $a[$value]. ' '; } ?>
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: print_following in /in/Ve8q2 on line 24 Warning: Invalid argument supplied for foreach() in /in/Ve8q2 on line 24
Output for hhvm-3.10.0 - 3.13.2
Notice: Undefined variable: print_following in /in/Ve8q2 on line 26 Warning: Invalid argument supplied for foreach() in /in/Ve8q2 on line 26
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/Ve8q2 on line 24
Output for 4.3.11