3v4l.org

run code in 300+ PHP versions simultaneously
<?php $calc = new Calc; $calc->execute(); class Calc { private $AkaraB; private $BkaraA; private $AkaraBnoZikan; private $BkaraAnoZikan; private $Abin; private $Bbin; private $ohuku; public function __construct() { fscanf(STDIN, "%d %d", $AkaraB, $BkaraA); fscanf(STDIN, "%d %d", $AkaraBnoZikan, $BkaraAnoZikan); fscanf(STDIN, "%s", $AbinString); fscanf(STDIN, "%s", $BbinString); $this->AkaraB = $AkaraB; $this->BkaraA = $BkaraA; $this->AkaraBnoZikan = $AkaraBnoZikan; $this->BkaraAnoZikan = $BkaraAnoZikan; $this->Abin = explode(' ', $AbinString); $this->Bbin = explode(' ', $BbinString); $this->ohuku = 0; } public function execute() { $now = 0; while(true) { $end = true; foreach ($this->Abin as $key => $value) { if($now <= $value){ $now = $value; $this->Abin = array_slice($this->Abin,$key+=1); $end =false; break; } } if ($end) break; $now += $this->AkaraBnoZikan; if ($now > 24) break; $nownow = $now; $end = true; foreach ($this->Bbin as $key => $value) { if($now <= $value) { $now = $value; $this->Bbin = array_slice($this->Bbin, $key+=1); $end =false; break; } } if ($end) break; $now += $this->BkaraAnoZikan; if ($now > 24) break; $this->ohuku++; } echo $this->ohuku . "\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/uAEbC on line 25 Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/uAEbC on line 26 0

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
60.37 ms | 401 KiB | 8 Q