3v4l.org

run code in 200+ 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 var_dump($se); if( strpos($code,$se) === 0){ echo $se.' YES'.PHP_EOL; } else{ echo $se.' NO'.PHP_EOL; } }
based on jfbe8
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
int(2) 2 NO int(1) 1 NO
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
int(2) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/pU5Uf on line 11 2 NOPHP_EOLint(1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/pU5Uf on line 11 1 NOPHP_EOL