3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $AkaraB=3; $BkaraA=4; $AkaraBnoZikan=2; $BkaraAnoZikan=3; $AbinString='1 5 7'; $BbinString='3 8 12 13'; $ouhuku = 0; $Abin = explode(' ', $AbinString); $Bbin = explode(' ', $BbinString); $now = 0; $end = false; while(true) { foreach ($Abin as $key => $value) { if($now <= $value){ $now = $value; $Abin = array_slice($Abin,$key+=1); break; }else { $end = true; } } if($end) break; $now += $AkaraBnoZikan; if ($now > 24) break; foreach ($Bbin as $key => $value) { if($now <= $value) { $now = $value; $Bbin = array_slice($Bbin, $key+=1); break; }else { $end =true; } } if($end) break; $now += $BkaraAnoZikan; if ($now > 24) break; $ouhuku++; } echo $ouhuku . "\n";
based on 1Ble2
Output for 7.2.0
Warning: Use of undefined constant  true - assumed ' true' (this will throw an Error in a future version of PHP) in /in/BMQk7 on line 22 1
Output for 5.3.19 - 7.1.10
Notice: Use of undefined constant  true - assumed ' true' in /in/BMQk7 on line 22 1