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.'); } var_dump($box);exit; // 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($r = 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.40.0140.00018.79
8.3.30.0030.01020.17
8.3.20.0040.00420.36
8.3.10.0060.00320.83
8.3.00.0100.00021.85
8.2.170.0070.00722.96
8.2.160.0110.00320.39
8.2.150.0060.00324.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00419.82
8.2.110.0000.00919.16
8.2.100.0120.00017.48
8.2.90.0040.00418.99
8.2.80.0040.00419.29
8.2.70.0040.00417.62
8.2.60.0000.00817.91
8.2.50.0060.00318.07
8.2.40.0090.00018.09
8.2.30.0000.00819.50
8.2.20.0070.00017.66
8.2.10.0080.00017.75
8.2.00.0050.00317.79
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00322.42
8.1.230.0060.00620.86
8.1.220.0040.00418.77
8.1.210.0000.00818.89
8.1.200.0060.00317.35
8.1.190.0070.00017.63
8.1.180.0000.01018.10
8.1.170.0000.00918.65
8.1.160.0070.00018.92
8.1.150.0040.00418.55
8.1.140.0020.00517.46
8.1.130.0080.00017.34
8.1.120.0040.00417.36
8.1.110.0040.00417.38
8.1.100.0040.00417.29
8.1.90.0040.00417.36
8.1.80.0000.00717.33
8.1.70.0030.00317.45
8.1.60.0030.00617.43
8.1.50.0070.00017.49
8.1.40.0060.00317.51
8.1.30.0040.00417.54
8.1.20.0000.00817.56
8.1.10.0040.00417.47
8.1.00.0060.00317.43
8.0.300.0070.00019.88
8.0.290.0040.00417.05
8.0.280.0030.00318.27
8.0.270.0060.00317.20
8.0.260.0040.00416.74
8.0.250.0030.00316.94
8.0.240.0030.00616.97
8.0.230.0070.00016.86
8.0.220.0000.00716.88
8.0.210.0050.00316.90
8.0.200.0030.00316.93
8.0.190.0050.00216.86
8.0.180.0040.00416.94
8.0.170.0040.00416.95
8.0.160.0000.00716.87
8.0.150.0000.00816.74
8.0.140.0000.00816.95
8.0.130.0070.00213.36
8.0.120.0000.00816.91
8.0.110.0000.00716.88
8.0.100.0040.00416.99
8.0.90.0040.00417.00
8.0.80.0070.00716.86
8.0.70.0040.00416.80
8.0.60.0060.00316.90
8.0.50.0000.00816.99
8.0.30.0100.01016.99
8.0.20.0110.00817.40
8.0.10.0040.00416.97
8.0.00.0180.00516.91
7.4.330.0000.00516.69
7.4.320.0050.00316.60
7.4.300.0040.00416.52
7.4.290.0030.00316.52
7.4.280.0080.00016.48
7.4.270.0030.00316.62
7.4.260.0000.00513.21
7.4.250.0030.00516.50
7.4.240.0050.00216.57
7.4.230.0020.00516.61
7.4.220.0110.00816.57
7.4.210.0060.00916.64
7.4.200.0070.00016.54
7.4.190.0040.00416.77
7.4.160.0120.00416.61
7.4.150.0110.00717.40
7.4.140.0110.00617.86
7.4.130.0050.01216.54
7.4.120.0140.00316.49
7.4.110.0090.00916.58
7.4.100.0120.00916.50
7.4.90.0110.00816.69
7.4.80.0080.00819.39
7.4.70.0070.01016.39
7.4.60.0090.01416.62
7.4.50.0000.00816.43
7.4.40.0100.00322.77
7.4.30.0220.00016.54
7.4.00.0040.01414.86
7.3.330.0020.00213.21
7.3.320.0030.00313.37
7.3.310.0000.00816.33
7.3.300.0030.00316.42
7.3.290.0140.00716.36
7.3.280.0120.00516.37
7.3.270.0090.00917.40
7.3.260.0130.01018.24
7.3.250.0130.00416.51
7.3.240.0160.00616.55
7.3.230.0140.00416.39
7.3.210.0080.00916.45
7.3.200.0160.00319.39
7.3.190.0060.01316.43
7.3.180.0060.01516.39
7.3.170.0170.00516.50
7.3.160.0110.00816.43
7.3.120.0070.01014.86
7.2.330.0100.00716.77
7.2.320.0120.00616.46
7.2.310.0140.00316.54
7.2.300.0080.00816.55
7.2.290.0110.00716.77
7.2.00.0080.00419.59
7.1.100.0030.01217.82
7.1.70.0020.00517.14
7.1.60.0090.01519.17
7.1.50.0230.00634.94
7.1.00.0000.03722.54
7.0.200.0030.00616.70
7.0.140.0070.07022.00
7.0.100.0070.07319.96
7.0.90.0070.05319.90
7.0.80.0100.04720.14
7.0.70.0200.03319.99
7.0.60.0070.05020.03
7.0.50.0170.08020.36
7.0.40.0000.06720.13
7.0.30.0130.06720.03
7.0.20.0030.09320.09
7.0.10.0170.04320.12
7.0.00.0130.09020.07
5.6.280.0000.07321.13
5.6.250.0070.05320.63
5.6.240.0070.08320.59
5.6.230.0100.08020.64
5.6.220.0100.08020.75
5.6.210.0030.07020.57
5.6.200.0000.05721.04
5.6.190.0070.06321.12
5.6.180.0070.07721.11
5.6.170.0070.05021.09
5.6.160.0170.08021.06
5.6.150.0130.07721.02
5.6.140.0070.04720.95
5.6.130.0100.08321.07
5.6.120.0130.08020.94
5.6.110.0070.08021.00
5.6.100.0070.07720.93
5.6.90.0230.06721.07
5.6.80.0030.05020.52
5.6.70.0100.07720.52
5.6.60.0030.07720.41
5.6.50.0100.07720.52
5.6.40.0070.08320.29
5.6.30.0070.08320.38
5.6.20.0030.07320.30
5.6.10.0100.06320.49
5.6.00.0070.08020.28
5.5.380.0030.05320.36
5.5.370.0100.08020.55
5.5.360.0230.07020.37
5.5.350.0100.07720.49
5.5.340.0030.08320.88
5.5.330.0070.08320.90
5.5.320.0070.04720.75
5.5.310.0100.07720.88
5.5.300.0070.06020.79
5.5.290.0100.08020.84
5.5.280.0100.07720.90
5.5.270.0070.09020.77
5.5.260.0130.07720.94
5.5.250.0030.05020.69
5.5.240.0070.08020.28
5.5.230.0070.07720.03
5.5.220.0300.04020.26
5.5.210.0030.08320.13
5.5.200.0130.07320.29
5.5.190.0070.08020.26
5.5.180.0100.07720.27
5.5.160.0070.04720.26
5.5.150.0100.07320.11
5.5.140.0100.05020.18
5.5.130.0030.08320.12
5.5.120.0000.07720.25
5.5.110.0130.06720.19
5.5.100.0130.07320.19
5.5.90.0100.07720.16
5.5.80.0100.07719.98
5.5.70.0170.08020.07
5.5.60.0100.07319.95
5.5.50.0000.07320.14
5.5.40.0100.06020.00
5.5.30.0070.04320.08
5.5.20.0130.05720.04
5.5.10.0070.08320.12
5.5.00.0070.07720.00
5.4.450.0030.08319.45
5.4.440.0000.04319.51
5.4.430.0070.04319.41
5.4.420.0100.07319.26
5.4.410.0130.04019.43
5.4.400.0100.07719.17
5.4.390.0000.07018.90
5.4.380.0070.07319.05
5.4.370.0070.07319.09
5.4.360.0030.08719.12
5.4.350.0100.07318.90
5.4.340.0070.06719.02
5.4.320.0100.05019.02
5.4.310.0070.07719.23
5.4.300.0030.06018.95
5.4.290.0170.06319.09
5.4.280.0070.07319.17
5.4.270.0030.08319.14
5.4.260.0030.06718.96
5.4.250.0100.06318.86
5.4.240.0070.04318.84
5.4.230.0130.07019.15
5.4.220.0070.07319.03
5.4.210.0070.08019.23
5.4.200.0070.08019.12
5.4.190.0030.05719.21
5.4.180.0070.07019.20
5.4.170.0000.03718.93
5.4.160.0070.06718.85
5.4.150.0070.08319.14
5.4.140.0070.04316.50
5.4.130.0130.06716.41
5.4.120.0070.04316.41
5.4.110.0070.07316.47
5.4.100.0100.06016.39
5.4.90.0100.07716.42
5.4.80.0030.07716.38
5.4.70.0100.07016.34
5.4.60.0070.07016.48
5.4.50.0100.04016.44
5.4.40.0030.03716.45
5.4.30.0070.06316.47
5.4.20.0070.07016.46
5.4.10.0000.08316.29
5.4.00.0100.07015.80
5.3.290.0030.06714.79
5.3.280.0070.04314.67
5.3.270.0070.06714.71
5.3.260.0100.07314.68
5.3.250.0000.06014.56
5.3.240.0030.06714.75
5.3.230.0030.06314.57
5.3.220.0070.06314.71
5.3.210.0070.05014.54
5.3.200.0130.05314.63
5.3.190.0030.07314.63
5.3.180.0100.04714.55
5.3.170.0030.08014.55
5.3.160.0100.07014.52
5.3.150.0070.07714.68
5.3.140.0030.08014.54
5.3.130.0070.07714.63
5.3.120.0130.07014.69
5.3.110.0100.04014.52
5.3.100.0100.07314.01
5.3.90.0070.06714.08
5.3.80.0070.06013.95
5.3.70.0100.03714.05
5.3.60.0070.07314.02
5.3.50.0070.06713.94
5.3.40.0030.05714.09
5.3.30.0070.07314.02
5.3.20.0030.06313.60
5.3.10.0100.06313.72
5.3.00.0070.06013.66
5.2.170.0000.04011.02
5.2.160.0130.05311.03
5.2.150.0070.03011.25
5.2.140.0030.03311.20
5.2.130.0100.05310.97
5.2.120.0070.03011.14
5.2.110.0130.05311.22
5.2.100.0070.05711.16
5.2.90.0030.06311.02
5.2.80.0070.04311.09
5.2.70.0000.06710.96
5.2.60.0070.04310.94
5.2.50.0030.05711.05
5.2.40.0000.06710.93
5.2.30.0070.05711.01
5.2.20.0030.05711.02
5.2.10.0000.06010.89
5.2.00.0000.06010.75
5.1.60.0070.05010.00
5.1.50.0030.05310.09
5.1.40.0030.05310.05
5.1.30.0070.04710.20
5.1.20.0000.05310.42
5.1.10.0070.0579.92
5.1.00.0030.05310.15
5.0.50.0030.0439.03
5.0.40.0030.0439.03
5.0.30.0030.0579.03
5.0.20.0030.0439.03
5.0.10.0030.0439.03
5.0.00.0000.0639.03
4.4.90.0000.0379.03
4.4.80.0000.0379.03
4.4.70.0030.0379.03
4.4.60.0070.0309.03
4.4.50.0030.0379.03
4.4.40.0000.0379.03
4.4.30.0000.0309.03
4.4.20.0000.0279.03
4.4.10.0030.0379.03
4.4.00.0030.0439.03
4.3.110.0000.0379.03
4.3.100.0000.0279.03
4.3.90.0070.0339.03
4.3.80.0000.0639.03
4.3.70.0030.0379.03
4.3.60.0070.0279.03
4.3.50.0000.0339.03
4.3.40.0070.0379.03
4.3.30.0000.0379.03
4.3.20.0030.0339.03
4.3.10.0000.0379.03
4.3.00.0070.0309.03

preferences:
57.7 ms | 400 KiB | 5 Q