3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $signexceptions = array('2' => 'Z','1' => 'P'); $code = '100'; foreach($signexceptions as $se => $type){ //checken als code begint met exception en mag maar 1 keer checken if( strpos($code,(string)$se) === 0){ echo $se.' YES'.PHP_EOL; } else{ echo $se.' NO'.PHP_EOL; } }
based on pU5Uf
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2 NO 1 YES
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/NNHWg on line 10 2 NOPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/NNHWg on line 7 1 YESPHP_EOL