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"; } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0140.00016.63
8.3.50.0070.00718.18
8.3.40.0070.00718.79
8.3.30.0000.01418.75
8.3.20.0040.00420.16
8.3.10.0000.00723.66
8.3.00.0040.00419.38
8.2.180.0120.00618.29
8.2.170.0100.01022.96
8.2.160.0070.00720.58
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0030.00620.44
8.2.100.0040.00718.04
8.2.90.0000.00919.23
8.2.80.0040.00817.97
8.2.70.0030.00617.63
8.2.60.0080.00017.93
8.2.50.0080.00018.07
8.2.40.0040.00419.38
8.2.30.0000.00720.64
8.2.20.0040.00417.77
8.2.10.0050.00318.14
8.2.00.0000.00718.01
8.1.270.0040.00424.01
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0070.00420.76
8.1.230.0040.00817.54
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0070.00018.10
8.1.170.0030.00618.59
8.1.160.0000.00722.07
8.1.150.0000.00818.78
8.1.140.0000.00819.53
8.1.130.0060.00317.71
8.1.120.0050.00317.38
8.1.110.0040.00417.45
8.1.100.0000.00717.49
8.1.90.0020.00517.51
8.1.80.0070.00017.53
8.1.70.0070.00017.44
8.1.60.0030.00617.48
8.1.50.0000.00817.52
8.1.40.0040.00417.43
8.1.30.0030.00517.51
8.1.20.0060.00317.57
8.1.10.0030.00617.60
8.1.00.0040.00417.41
8.0.300.0020.00518.77
8.0.290.0050.00316.75
8.0.280.0040.00418.52
8.0.270.0040.00417.18
8.0.260.0000.00717.15
8.0.250.0040.00417.06
8.0.240.0000.00717.01
8.0.230.0070.00017.10
8.0.220.0030.00616.94
8.0.210.0080.00016.86
8.0.200.0040.00417.02
8.0.190.0000.01016.92
8.0.180.0040.00417.03
8.0.170.0080.00016.94
8.0.160.0040.00416.98
8.0.150.0000.00716.91
8.0.140.0080.00016.89
8.0.130.0000.00613.38
8.0.120.0050.00316.97
8.0.110.0070.00017.00
8.0.100.0000.00716.87
8.0.90.0030.00516.99
8.0.80.0060.00916.96
8.0.70.0080.00016.77
8.0.60.0000.00716.79
8.0.50.0050.00316.87
8.0.30.0090.00917.18
8.0.20.0090.00917.40
8.0.10.0040.00416.91
8.0.00.0080.01216.79
7.4.330.0000.00715.08
7.4.320.0030.00316.53
7.4.300.0030.00316.62
7.4.290.0000.00716.65
7.4.280.0000.00716.54
7.4.270.0030.00316.52
7.4.260.0030.00316.44
7.4.250.0040.00416.58
7.4.240.0050.00216.49
7.4.230.0000.00716.51
7.4.220.0110.00816.48
7.4.210.0110.00916.59
7.4.200.0030.00316.43
7.4.160.0040.01216.71
7.4.150.0000.01917.40
7.4.140.0090.01217.86
7.4.130.0110.00816.63
7.4.120.0070.01316.56
7.4.110.0120.00816.42
7.4.100.0140.00716.61
7.4.90.0150.00316.61
7.4.80.0110.00719.39
7.4.70.0060.00916.37
7.4.60.0130.00316.50
7.4.50.0000.00416.52
7.4.40.0130.01016.56
7.4.30.0060.00916.48
7.4.00.0060.00915.09
7.3.330.0030.00313.45
7.3.320.0060.00013.45
7.3.310.0070.00016.32
7.3.300.0000.00716.45
7.3.290.0090.00516.44
7.3.280.0080.00916.42
7.3.270.0180.00617.40
7.3.260.0170.00016.52
7.3.250.0100.00716.45
7.3.240.0110.00616.59
7.3.230.0210.00016.60
7.3.210.0070.01016.50
7.3.200.0080.00916.38
7.3.190.0030.01316.47
7.3.180.0090.00716.43
7.3.170.0110.00816.55
7.3.160.0070.01716.61
7.3.10.0080.00916.27
7.3.00.0040.01016.49
7.2.330.0150.00416.80
7.2.320.0060.01616.57
7.2.310.0060.00916.55
7.2.300.0090.01216.48
7.2.290.0160.00316.83
7.2.130.0090.00716.66
7.2.120.0020.01416.52
7.2.110.0070.00816.76
7.2.100.0060.01016.69
7.2.90.0100.00816.90
7.2.80.0130.00616.67
7.2.70.0040.01016.70
7.2.60.0060.01116.82
7.2.50.0050.01116.81
7.2.40.0160.00516.91
7.2.30.0100.00716.51
7.2.20.0100.00916.85
7.2.10.0080.00716.67
7.2.00.0070.01117.68
7.1.250.0090.00615.58
7.1.200.0070.00715.62
7.1.100.0030.01018.16
7.1.70.0000.00817.14
7.1.60.0070.01719.48
7.1.50.0070.00716.96
7.1.00.0070.07022.49
7.0.200.0290.00614.85
7.0.60.0070.06019.93
7.0.50.0070.05317.92
7.0.40.0170.07320.26
7.0.30.0130.04720.11
7.0.20.0300.07020.05
7.0.10.0030.09020.24
7.0.00.0030.04320.24
5.6.280.0000.06321.14
5.6.210.0100.07020.69
5.6.200.0100.07718.25
5.6.190.0100.03720.64
5.6.180.0270.03720.77
5.6.170.0170.06320.57
5.6.160.0130.06720.50
5.6.150.0070.03718.16
5.6.140.0030.04318.27
5.6.130.0000.04318.15
5.6.120.0070.08321.00
5.6.110.0030.04720.96
5.6.100.0130.07721.05
5.6.90.0170.07021.01
5.6.80.0030.04020.44
5.5.350.3570.04020.52
5.5.340.0100.07718.00
5.5.330.0100.04020.43
5.5.320.0000.09020.29
5.5.310.0300.08320.45
5.5.300.0030.07018.04
5.5.290.0170.07717.96
5.5.280.0000.09020.75
5.5.270.0030.08020.68
5.5.260.0000.04320.67
5.5.250.0100.03720.63
5.5.240.0330.07320.30

preferences:
64.92 ms | 400 KiB | 5 Q