3v4l.org

run code in 300+ PHP versions simultaneously
<?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";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught Error: Undefined constant " true" in /in/1Ble2:22 Stack trace: #0 {main} thrown in /in/1Ble2 on line 22
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant  true - assumed ' true' (this will throw an Error in a future version of PHP) in /in/1Ble2 on line 22 Warning: Use of undefined constant  true - assumed ' true' (this will throw an Error in a future version of PHP) in /in/1Ble2 on line 22 1
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25
Notice: Use of undefined constant  true - assumed ' true' in /in/1Ble2 on line 22 Notice: Use of undefined constant  true - assumed ' true' in /in/1Ble2 on line 22 1

preferences:
227.77 ms | 402 KiB | 296 Q