3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $myList = ['a', 'b', 'c', 'd', 'e']; print("<pre>".print_r($myList, true)."</pre>"); foreach ($myList as $letters) { echo $letters . '<br>'; } echo '<br><br><br>'; foreach ($myList as $letters) { if ($letters !== 'a') { echo $letters . '<br>'; } } echo '<br><br><br>'; foreach ($myList as $letters) { if ($letters !== 'a' || $letters !== 'b') { echo $letters . '<br>'; } }
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
<pre>Array ( [0] => a [1] => b [2] => c [3] => d [4] => e ) </pre>a<br>b<br>c<br>d<br>e<br><br><br><br>b<br>c<br>d<br>e<br><br><br><br>a<br>b<br>c<br>d<br>e<br>