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($this->box = $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.60.0070.00718.66
8.3.50.0120.00321.14
8.3.40.0070.01118.76
8.3.30.0070.00720.38
8.3.20.0040.00420.48
8.3.10.0090.00021.09
8.3.00.0040.00421.90
8.2.180.0040.01116.75
8.2.170.0070.01422.96
8.2.160.0080.00620.27
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00021.11
8.2.110.0060.00319.30
8.2.100.0040.00817.78
8.2.90.0000.00919.09
8.2.80.0000.00819.39
8.2.70.0000.00917.50
8.2.60.0050.00318.04
8.2.50.0040.00418.07
8.2.40.0040.00418.21
8.2.30.0050.00319.41
8.2.20.0050.00317.61
8.2.10.0070.00017.57
8.2.00.0050.00217.64
8.1.280.0070.00725.92
8.1.270.0030.00523.99
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00022.60
8.1.230.0040.00720.88
8.1.220.0000.00918.77
8.1.210.0040.00418.79
8.1.200.0000.01017.22
8.1.190.0040.00417.65
8.1.180.0080.00018.10
8.1.170.0000.00818.64
8.1.160.0000.00818.82
8.1.150.0040.00418.61
8.1.140.0040.00417.41
8.1.130.0030.00317.74
8.1.120.0000.00717.52
8.1.110.0000.00717.36
8.1.100.0040.00417.45
8.1.90.0080.00017.52
8.1.80.0000.00717.36
8.1.70.0000.00817.42
8.1.60.0060.00317.59
8.1.50.0040.00417.49
8.1.40.0040.00417.55
8.1.30.0000.00817.59
8.1.20.0030.00517.62
8.1.10.0000.00717.49
8.1.00.0040.00417.48
8.0.300.0000.00820.04
8.0.290.0000.00717.16
8.0.280.0030.00418.40
8.0.270.0030.00517.08
8.0.260.0000.00616.83
8.0.250.0000.00716.97
8.0.240.0040.00416.94
8.0.230.0050.00217.00
8.0.220.0030.00316.86
8.0.210.0040.00416.90
8.0.200.0000.00716.95
8.0.190.0000.00716.93
8.0.180.0000.00816.96
8.0.170.0030.00516.90
8.0.160.0000.00716.87
8.0.150.0060.00616.89
8.0.140.0040.00416.95
8.0.130.0050.00013.43
8.0.120.0040.00416.90
8.0.110.0050.00216.83
8.0.100.0040.00416.92
8.0.90.0000.00716.96
8.0.80.0040.01217.03
8.0.70.0070.00016.76
8.0.60.0030.00616.98
8.0.50.0000.00716.96
8.0.30.0120.00817.13
8.0.20.0130.00717.40
8.0.10.0050.00217.09
8.0.00.0040.01416.73
7.4.330.0030.00316.79
7.4.320.0000.00716.52
7.4.300.0070.00016.37
7.4.290.0030.00316.50
7.4.280.0030.00316.59
7.4.270.0040.00416.59
7.4.260.0000.00513.29
7.4.250.0060.00316.62
7.4.240.0000.00716.63
7.4.230.0000.00716.42
7.4.220.0150.01216.64
7.4.210.0070.00816.54
7.4.200.0040.00416.42
7.4.190.0040.00416.57
7.4.160.0030.01216.57
7.4.150.0090.00917.40
7.4.140.0110.00717.86
7.4.130.0080.01516.62
7.4.120.0080.01016.50
7.4.110.0060.01116.36
7.4.100.0100.00716.59
7.4.90.0090.00916.67
7.4.80.0060.01119.39
7.4.70.0140.00716.52
7.4.60.0200.00416.82
7.4.50.0040.00416.55
7.4.40.0080.00422.77
7.4.30.0190.00416.56
7.4.00.0030.01214.93
7.3.330.0030.00313.24
7.3.320.0000.00613.32
7.3.310.0000.00716.41
7.3.300.0000.00716.25
7.3.290.0030.01316.46
7.3.280.0090.00916.34
7.3.270.0090.00917.40
7.3.260.0120.00918.24
7.3.250.0120.00616.41
7.3.240.0070.01716.48
7.3.230.0120.00416.56
7.3.210.0140.00316.40
7.3.200.0000.02019.39
7.3.190.0130.01016.40
7.3.180.0110.00716.41
7.3.170.0030.01616.43
7.3.160.0120.00916.46
7.3.120.0070.00714.75
7.2.330.0110.00716.76
7.2.320.0070.01016.75
7.2.310.0060.01216.54
7.2.300.0050.01116.84
7.2.290.0070.01116.60
7.2.60.0230.00816.72
7.1.200.0100.00315.83
7.1.100.0030.01018.17
7.1.70.0030.00716.92
7.1.60.0070.01419.17
7.1.50.0170.00434.78
7.1.00.0030.04722.51
7.0.200.1590.01014.86
7.0.140.0030.07022.01
7.0.100.0100.06020.05
7.0.90.0030.07019.94
7.0.80.0200.03319.95
7.0.70.0030.06319.90
7.0.60.0300.06319.93
7.0.50.0070.07020.38
7.0.40.0130.07320.29
7.0.30.0070.08720.00
7.0.20.0070.08320.00
7.0.10.0070.08720.04
7.0.00.0070.07319.99
5.6.280.0100.06720.87
5.6.250.0000.04020.61
5.6.240.0030.08720.70
5.6.230.0030.07320.50
5.6.220.0070.08320.65
5.6.210.0030.08320.67
5.6.200.0100.07721.04
5.6.190.0170.06320.95
5.6.180.0100.07021.13
5.6.170.0130.04320.97
5.6.160.0030.08720.95
5.6.150.0070.07721.11
5.6.140.0030.04320.96
5.6.130.0070.04721.12
5.6.120.0130.07021.03
5.6.110.0170.07021.17
5.6.100.0130.07321.13
5.6.90.0070.08021.05
5.6.80.0100.05320.54
5.6.70.0200.06320.41
5.6.60.0070.07320.46
5.6.50.0070.04320.34
5.6.40.0000.08320.54
5.6.30.0130.07320.31
5.6.20.0170.07020.36
5.6.10.0070.07720.39
5.6.00.0070.06020.37
5.5.380.0100.04720.55
5.5.370.0100.05720.57
5.5.360.0070.07720.34
5.5.350.0170.07320.33
5.5.340.0130.05720.90
5.5.330.0030.05020.82
5.5.320.0130.04320.82
5.5.310.0100.06720.84
5.5.300.0100.07720.82
5.5.290.0100.08020.91
5.5.280.0130.06020.74
5.5.270.0070.05320.93
5.5.260.0070.07720.93
5.5.250.0030.08720.59
5.5.240.0030.07320.23
5.5.230.0200.07020.03
5.5.220.0130.06720.12
5.5.210.0030.04720.13
5.5.200.0030.03720.24
5.5.190.0170.06020.17
5.5.180.0130.04720.23
5.5.160.0100.08020.19
5.5.150.0100.05020.29
5.5.140.0070.07320.23
5.5.130.0100.06320.10
5.5.120.0070.07020.09
5.5.110.0030.07020.24
5.5.100.0030.04020.06
5.5.90.0130.05020.07
5.5.80.0100.07019.96
5.5.70.0030.09020.07
5.5.60.0070.08019.98
5.5.50.0070.05320.10
5.5.40.0070.07720.07
5.5.30.0030.08020.16
5.5.20.0070.07720.07
5.5.10.0030.06020.00
5.5.00.0100.06320.12
5.4.450.0170.06019.18
5.4.440.0070.08319.46
5.4.430.0070.06319.48
5.4.420.0100.07719.38
5.4.410.0030.04719.15
5.4.400.0100.07719.25
5.4.390.0070.07719.10
5.4.380.0070.08019.24
5.4.370.0070.06719.24
5.4.360.0200.06719.09
5.4.350.0070.07719.01
5.4.340.0100.07019.05
5.4.320.0030.08319.15
5.4.310.0030.07719.18
5.4.300.0070.08319.09
5.4.290.0130.07318.90
5.4.280.0070.06718.85
5.4.270.0030.07019.04
5.4.260.0170.06319.04
5.4.250.0030.07719.04
5.4.240.0030.07719.02
5.4.230.0030.04319.07
5.4.220.0000.04719.02
5.4.210.0100.03719.04
5.4.200.0030.06719.04
5.4.190.0100.07319.17
5.4.180.0030.08018.87
5.4.170.0130.07719.15
5.4.160.0000.08019.01
5.4.150.0100.06719.02
5.4.140.0070.06716.34
5.4.130.0030.07716.41
5.4.120.0030.06716.33
5.4.110.0030.07716.52
5.4.100.0030.07716.30
5.4.90.0100.06716.50
5.4.80.0130.06016.38
5.4.70.0100.07016.38
5.4.60.0100.05316.37
5.4.50.0100.06716.49
5.4.40.0100.06316.38
5.4.30.0070.07016.48
5.4.20.0130.03716.25
5.4.10.0100.05716.36
5.4.00.0070.05015.86
5.3.290.0030.07014.81
5.3.280.0070.07714.72
5.3.270.0170.06714.54
5.3.260.0000.06314.54
5.3.250.0130.07014.74
5.3.240.0070.07314.60
5.3.230.0070.04014.59
5.3.220.0130.06014.65
5.3.210.0070.07314.71
5.3.200.0070.07314.60
5.3.190.0070.08014.60
5.3.180.0030.04314.71
5.3.170.0000.05314.51
5.3.160.0100.06714.63
5.3.150.0100.07014.67
5.3.140.0100.06714.65
5.3.130.0100.07314.48
5.3.120.0130.05714.53
5.3.110.0070.06314.49
5.3.100.0070.07714.03
5.3.90.0100.06313.95
5.3.80.0070.04714.12
5.3.70.0100.04714.15
5.3.60.0100.05014.04
5.3.50.0070.05714.00
5.3.40.0000.08013.84
5.3.30.0130.07013.81
5.3.20.0000.06013.77
5.3.10.0000.07713.82
5.3.00.0070.07013.58
5.2.170.0000.03312.03
5.2.160.0070.06012.03
5.2.150.0030.06312.03
5.2.140.0100.05712.03
5.2.130.0070.06012.03
5.2.120.0100.05312.03
5.2.110.0070.05312.03
5.2.100.0070.05012.03
5.2.90.0070.03312.03
5.2.80.0000.04712.03
5.2.70.0070.03712.03
5.2.60.0030.06312.03
5.2.50.0000.04712.03
5.2.40.0030.06712.03
5.2.30.0030.06712.03
5.2.20.0070.05712.03
5.2.10.0170.04012.03
5.2.00.0000.06312.03
5.1.60.0030.03012.03
5.1.50.0030.05012.03
5.1.40.0000.05712.03
5.1.30.0030.05012.03
5.1.20.0070.05712.03
5.1.10.0070.05012.03
5.1.00.0000.05012.03
5.0.50.0100.02712.03
5.0.40.0070.04012.03
5.0.30.0030.03012.03
5.0.20.0030.03312.03
5.0.10.0030.02312.03
5.0.00.0000.06012.03
4.4.90.0030.03312.03
4.4.80.0000.03712.03
4.4.70.0000.04012.03
4.4.60.0030.03012.03
4.4.50.0000.02312.03
4.4.40.0030.04312.03
4.4.30.0070.01712.03
4.4.20.0000.03712.03
4.4.10.0000.03312.03
4.4.00.0000.05312.03
4.3.110.0000.03712.03
4.3.100.0000.04312.03
4.3.90.0070.03312.03
4.3.80.0030.04012.03
4.3.70.0030.03012.03
4.3.60.0000.02712.03
4.3.50.0000.02012.03
4.3.40.0070.05012.03
4.3.30.0000.03712.03
4.3.20.0000.03312.03
4.3.10.0030.03312.03
4.3.00.0070.02012.03

preferences:
55.71 ms | 401 KiB | 5 Q