3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $box; public function setBox(array $box) { if (count($box) !== 4) { throw new InvalidArgumentException('The "$box" parameter must be an array with 4 values.'); } // Breaks FPM and gives a 502 due to connection reset by peers list($lat1, $lon1, $lat2, $lon2) = $this->box = $box; // Works perfectly fine // $this->box = $box; // list($lat1, $lon1, $lat2, $lon2) = $this->box; // Calculate the central point of the box for distances $this->lat = (float) $lat1 + (($lat2 - $lat1) / 2); $this->lon = (float) $lon1 + (($lon2 - $lon1) / 2); return $this; } public function process() { if ($this->box) { list($lat1, $lon1, $lat2, $lon2) = $this->box; } echo "Success"; } } $foo = new Foo; $foo->setBox(explode('40.688235,-74.013718,40.756427,-73.958770')); $foo->process();

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.0030.01018.68
8.3.50.0130.00321.20
8.3.40.0070.00718.82
8.3.30.0140.00020.34
8.3.20.0000.00820.66
8.3.10.0040.00421.05
8.3.00.0000.00923.61
8.2.180.0110.00716.75
8.2.170.0080.00822.96
8.2.160.0100.00320.47
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.07
8.2.110.0100.00019.44
8.2.100.0000.01117.91
8.2.90.0080.00018.96
8.2.80.0100.00018.04
8.2.70.0040.00417.50
8.2.60.0040.00417.80
8.2.50.0050.00318.07
8.2.40.0000.00818.06
8.2.30.0040.00419.46
8.2.20.0000.00817.78
8.2.10.0030.00617.64
8.2.00.0040.00417.64
8.1.280.0120.00325.92
8.1.270.0000.00923.99
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0080.00024.02
8.1.230.0070.00420.97
8.1.220.0000.00818.77
8.1.210.0030.00719.06
8.1.200.0090.00017.23
8.1.190.0000.00817.50
8.1.180.0060.00318.10
8.1.170.0050.00318.46
8.1.160.0040.00418.84
8.1.150.0000.00718.60
8.1.140.0000.00717.32
8.1.130.0000.00717.75
8.1.120.0040.00417.45
8.1.110.0050.00217.48
8.1.100.0060.00317.42
8.1.90.0000.00717.34
8.1.80.0000.00717.27
8.1.70.0080.00017.31
8.1.60.0090.00017.52
8.1.50.0070.00017.41
8.1.40.0030.00717.50
8.1.30.0000.00817.56
8.1.20.0060.00317.65
8.1.10.0050.00217.50
8.1.00.0040.00417.43
8.0.300.0070.00019.77
8.0.290.0040.00416.93
8.0.280.0080.00018.40
8.0.270.0080.00017.21
8.0.260.0060.00016.79
8.0.250.0030.00516.96
8.0.240.0040.00417.02
8.0.230.0050.00216.89
8.0.220.0040.00416.90
8.0.210.0030.00316.80
8.0.200.0060.00016.86
8.0.190.0000.00716.86
8.0.180.0080.00016.84
8.0.170.0000.00716.95
8.0.160.0030.00316.78
8.0.150.0050.00516.70
8.0.140.0030.00516.77
8.0.130.0030.00313.31
8.0.120.0000.00816.77
8.0.110.0000.00716.79
8.0.100.0080.00016.69
8.0.90.0030.00616.89
8.0.80.0170.00417.00
8.0.70.0000.00816.77
8.0.60.0080.00016.75
8.0.50.0080.00016.94
8.0.30.0090.01017.10
8.0.20.0060.01217.40
8.0.10.0000.00817.07
8.0.00.0180.00016.81
7.4.330.0000.00516.66
7.4.320.0000.00716.35
7.4.300.0030.00316.50
7.4.290.0040.00416.57
7.4.280.0000.00716.50
7.4.270.0000.00716.54
7.4.260.0050.00013.25
7.4.250.0040.00416.47
7.4.240.0030.00516.56
7.4.230.0070.00016.68
7.4.220.0070.01116.63
7.4.210.0080.00616.57
7.4.200.0030.00316.73
7.4.190.0030.00316.49
7.4.160.0070.01016.54
7.4.150.0120.00817.40
7.4.140.0070.01017.86
7.4.130.0160.00616.51
7.4.120.0090.00916.60
7.4.110.0090.00916.48
7.4.100.0050.01416.37
7.4.90.0070.01316.61
7.4.80.0130.00319.39
7.4.70.0170.00016.54
7.4.60.0140.00716.38
7.4.50.0110.00016.38
7.4.40.0060.00922.77
7.4.30.0060.01316.55
7.4.10.0100.00714.94
7.4.00.0080.00815.05
7.3.330.0000.00513.34
7.3.320.0070.00013.22
7.3.310.0040.00216.41
7.3.300.0000.00716.29
7.3.290.0110.00316.38
7.3.280.0120.00616.34
7.3.270.0190.00017.40
7.3.260.0110.00818.24
7.3.250.0110.00716.45
7.3.240.0090.01216.55
7.3.230.0100.01016.61
7.3.210.0110.00616.36
7.3.200.0180.00919.39
7.3.190.0100.00716.22
7.3.180.0130.00316.64
7.3.170.0120.00416.48
7.3.160.0100.01016.33
7.3.130.0100.00814.81
7.3.120.0040.01014.94
7.3.110.0050.01214.49
7.3.100.0050.01014.78
7.3.90.0070.00514.73
7.3.80.0020.01114.82
7.3.70.0090.00314.80
7.3.60.0060.00614.84
7.3.50.0080.00814.85
7.3.40.0050.00714.71
7.3.30.0090.00814.78
7.3.20.0020.00916.72
7.3.10.0030.00916.49
7.3.00.0070.00816.54
7.2.330.0040.01416.48
7.2.320.0070.01016.64
7.2.310.0060.01016.69
7.2.300.0070.01016.70
7.2.290.0170.00016.70
7.2.260.0090.00814.81
7.2.250.0060.01014.84
7.2.240.0090.00715.17
7.2.230.0080.00815.04
7.2.220.0070.00914.83
7.2.210.0090.00715.20
7.2.200.0050.00514.91
7.2.190.0050.00915.01
7.2.180.0060.00815.02
7.2.170.0070.00515.03
7.2.160.0050.00914.69
7.2.150.0090.00316.73
7.2.140.0050.00716.84
7.2.130.0050.00916.80
7.2.120.0080.00616.86
7.2.110.0070.00616.76
7.2.100.0050.00916.90
7.2.90.0060.01016.84
7.2.80.0050.00916.93
7.2.70.0110.00516.84
7.2.60.0030.00816.93
7.2.50.0080.00516.95
7.2.40.0100.00516.83
7.2.30.0070.00816.78
7.2.20.0030.00916.74
7.2.10.0050.00816.79
7.2.00.0050.01116.77
7.1.330.0080.00815.70
7.1.320.0050.00915.78
7.1.310.0050.00715.66
7.1.300.0120.00315.67
7.1.290.0040.00715.70
7.1.280.0050.00815.77
7.1.270.0070.00515.63
7.1.260.0040.00515.71
7.1.250.0050.00915.74
7.1.240.0040.00615.70
7.1.230.0050.00715.78
7.1.220.0070.00615.75
7.1.210.0060.00615.79
7.1.200.0040.00915.70
7.1.190.0040.00815.67
7.1.180.0030.00615.56
7.1.170.0030.00615.77
7.1.160.0060.00815.51
7.1.150.0080.00715.70
7.1.140.0020.00715.76
7.1.130.0040.01115.67
7.1.120.0060.00615.63
7.1.110.0050.00815.82
7.1.100.0050.00916.57
7.1.90.0060.00615.70
7.1.80.0060.00715.79
7.1.70.0050.00816.04
7.1.60.0060.01216.80
7.1.50.0040.01316.00
7.1.40.0030.01315.50
7.1.30.0070.00715.72
7.1.20.0040.00815.47
7.1.10.0060.00815.70
7.1.00.0030.03018.02
7.0.330.0030.00915.30
7.0.320.0040.00615.36
7.0.310.0040.00615.43
7.0.300.0050.00815.42
7.0.290.0070.00815.39
7.0.280.0080.00715.31
7.0.270.0050.00915.18
7.0.260.0030.00615.30
7.0.250.0080.00615.32
7.0.240.0050.00815.30
7.0.230.0020.00915.36
7.0.220.0060.00815.28
7.0.210.0050.00615.11
7.0.200.0060.00615.66
7.0.190.0080.00815.39
7.0.180.0080.00815.26
7.0.170.0060.00715.35
7.0.160.0080.00315.33
7.0.150.0050.00715.30
7.0.140.0040.02817.65
7.0.130.0060.00515.34
7.0.120.0030.01015.44
7.0.110.0050.01215.30
7.0.100.0070.01816.79
7.0.90.0060.02016.93
7.0.80.0040.02916.93
7.0.70.0000.02116.87
7.0.60.0060.02316.85
7.0.50.0030.02016.93
7.0.40.0050.01615.58
7.0.30.0060.02515.50
7.0.20.0060.02115.56
7.0.10.0060.01615.68
7.0.00.0050.01715.48
5.6.400.0050.00714.24
5.6.390.0060.00614.38
5.6.380.0050.00514.27
5.6.370.0060.00714.35
5.6.360.0050.00714.22
5.6.350.0080.00314.20
5.6.340.0040.01214.20
5.6.330.0040.01114.42
5.6.320.0100.00714.22
5.6.310.0060.00814.22
5.6.300.0090.00514.29
5.6.290.0020.00914.40
5.6.280.0070.02816.40
5.6.270.0020.01314.22
5.6.260.0030.00714.20
5.6.250.0020.03516.54
5.6.240.0020.03716.48
5.6.230.0050.02916.47
5.6.220.0010.02216.31
5.6.210.0090.02516.37
5.6.200.0060.01816.60
5.6.190.0040.02016.58
5.6.180.0060.01916.58
5.6.170.0070.01816.61
5.6.160.0030.01916.65
5.6.150.0040.01916.44
5.6.140.0070.01416.48
5.6.130.0030.02116.53
5.6.120.0050.02016.55
5.6.110.0040.01816.47
5.6.100.0040.03316.59
5.6.90.0100.02516.59
5.6.80.0130.02716.24
5.6.70.0080.03016.30
5.6.60.0010.03116.38
5.6.50.0080.03116.17
5.6.40.0090.02816.35
5.6.30.0050.03116.26
5.6.20.0080.02916.27
5.6.10.0090.02916.46
5.6.00.0040.02316.26
5.5.380.0060.02716.43
5.5.370.0090.02116.22
5.5.360.0070.02216.27
5.5.350.0050.02016.36
5.5.340.0010.02616.29
5.5.330.0030.02116.51
5.5.320.0030.02816.48
5.5.310.0050.01716.42
5.5.300.0080.02216.53
5.5.290.0040.01916.48
5.5.280.0060.02116.50
5.5.270.0060.02216.34
5.5.260.0050.01816.43
5.5.250.0050.03416.35
5.5.240.0110.03016.10
5.5.230.0060.03116.24
5.5.220.0070.02916.26
5.5.210.0090.03016.16
5.5.200.0050.03116.24
5.5.190.0040.02216.17
5.5.180.0070.02416.26
5.5.170.0050.01014.00
5.5.160.0050.01816.28
5.5.150.0030.02016.18
5.5.140.0110.02816.11
5.5.130.0080.03016.20
5.5.120.0040.02316.27
5.5.110.0010.02516.27
5.5.100.0080.02716.15
5.5.90.0070.03116.27
5.5.80.0090.02716.31
5.5.70.0050.03216.25
5.5.60.0070.03016.09
5.5.50.0070.01816.07
5.5.40.0070.02316.07
5.5.30.0060.03016.10
5.5.20.0090.02816.15
5.5.10.0050.02115.95
5.5.00.0050.03516.04
5.4.450.0060.01513.84
5.4.440.0070.02313.86
5.4.430.0040.02113.72
5.4.420.0020.02513.70
5.4.410.0070.02813.70
5.4.400.0070.02513.70
5.4.390.0020.02013.69
5.4.380.0040.02613.59
5.4.370.0030.03013.70
5.4.360.0070.02813.64
5.4.350.0050.01913.65
5.4.340.0080.02513.61
5.4.330.0030.00810.75
5.4.320.0030.03313.58
5.4.310.0070.02813.55
5.4.300.0060.02913.66
5.4.290.0060.02913.67
5.4.280.0050.02713.60
5.4.270.0070.02613.56
5.4.260.0060.03113.67
5.4.250.0070.02913.60
5.4.240.0080.02613.49
5.4.230.0040.02013.53
5.4.220.0050.02913.75
5.4.210.0040.03113.64
5.4.200.0010.03013.52
5.4.190.0050.02913.64
5.4.180.0080.02513.64
5.4.170.0060.02913.62
5.4.160.0030.03313.61
5.4.150.0050.03013.56
5.4.140.0080.02712.79
5.4.130.0020.02912.61
5.4.120.0020.03012.76
5.4.110.0070.02812.77
5.4.100.0070.02912.71
5.4.90.0050.02912.78
5.4.80.0060.02012.85
5.4.70.0030.03012.72
5.4.60.0040.02712.84
5.4.50.0050.02912.71
5.4.40.0050.03112.75
5.4.30.0070.02012.67
5.4.20.0080.02512.77
5.4.10.0070.01712.67
5.4.00.0080.02512.46
5.3.290.0050.02611.97
5.3.280.0090.02611.82
5.3.270.0030.02911.83
5.3.260.0070.02811.84
5.3.250.0030.03211.83
5.3.240.0100.02411.83
5.3.230.0030.02611.95
5.3.220.0050.03011.76
5.3.210.0090.02611.79
5.3.200.0120.02211.86
5.3.190.0030.02811.93
5.3.180.0040.02711.94
5.3.170.0020.03111.94
5.3.160.0060.03011.98
5.3.150.0070.02911.90
5.3.140.0070.02511.90
5.3.130.0040.02911.93
5.3.120.0090.02611.96
5.3.110.0050.02011.82
5.3.100.0060.02811.80
5.3.90.0050.02511.83
5.3.80.0000.03011.80
5.3.70.0040.02511.66
5.3.60.0020.01811.76
5.3.50.0040.02411.73
5.3.40.0070.01811.60
5.3.30.0040.02911.64
5.3.20.0070.02711.63
5.3.10.0070.02811.51
5.3.00.0100.02211.31
5.2.170.0070.06011.14
5.2.160.0000.06311.08
5.2.150.0030.06011.26
5.2.140.0070.06011.17
5.2.130.0030.05711.24
5.2.120.0030.06011.17
5.2.110.0100.05311.04
5.2.100.0100.05711.21
5.2.90.0100.03011.17
5.2.80.0000.05711.22
5.2.70.0000.06711.09
5.2.60.0070.04710.95
5.2.50.0030.04311.10
5.2.40.0170.05010.87
5.2.30.0030.04311.10
5.2.20.0030.06311.04
5.2.10.0130.05310.99
5.2.00.0000.06310.79
5.1.60.0100.04710.48
5.1.50.0070.05010.48
5.1.40.0030.05310.48
5.1.30.0000.05710.48
5.1.20.0000.04310.48
5.1.10.0070.05010.48
5.1.00.0070.04710.48
5.0.50.0030.03010.48
5.0.40.0000.03010.48
5.0.30.0030.06310.48
5.0.20.0030.04310.48
5.0.10.0070.04010.48
5.0.00.0070.06010.48
4.4.90.0070.03010.48
4.4.80.0030.03010.48
4.4.70.0030.03310.48
4.4.60.0030.03710.48
4.4.50.0000.03010.48
4.4.40.0070.05010.48
4.4.30.0030.03310.48
4.4.20.0000.03310.48
4.4.10.0030.03710.48
4.4.00.0000.05010.48
4.3.110.0000.03710.48
4.3.100.0030.03310.48
4.3.90.0070.03010.48
4.3.80.0030.04010.48
4.3.70.0030.03710.48
4.3.60.0000.03310.48
4.3.50.0030.03310.48
4.3.40.0000.05310.48
4.3.30.0000.04010.48
4.3.20.0030.03010.48
4.3.10.0000.04010.48
4.3.00.0030.03310.48

preferences:
44.71 ms | 401 KiB | 5 Q