3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = range(3,9); foreach ($a as $b) { switch($b) { case 3: $b = 7; case 7: $b = 3; default: // do nothing } } echo implode('-',$a); $a = range(3,9); foreach ($a as &$b) { switch($b) { case 3: $b = 7; case 7: $b = 3; default: // do nothing } } echo implode('-',$a); // Excerpt From: Lorna Mitchell. “Zend Certification Preparation Pack.” iBooks.
Output for 5.3.21 - 7.0.4, 7.0.6 - 7.2.0
3-4-5-6-7-8-93-4-5-6-3-8-9
Output for 7.0.5
3-4-5-6-7-8-93-4-5-6-7-8-9