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.0110.00718.68
8.3.50.0080.00821.33
8.3.40.0170.00318.91
8.3.30.0110.00320.13
8.3.20.0060.00320.53
8.3.10.0050.00321.05
8.3.00.0060.00321.94
8.2.180.0000.01518.66
8.2.170.0070.00722.96
8.2.160.0070.00719.32
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00221.18
8.2.110.0100.00020.39
8.2.100.0040.00718.03
8.2.90.0040.00417.97
8.2.80.0000.00817.97
8.2.70.0040.00417.80
8.2.60.0040.00418.09
8.2.50.0040.00419.23
8.2.40.0040.00418.16
8.2.30.0000.00719.52
8.2.20.0050.00217.85
8.2.10.0050.00317.73
8.2.00.0040.00417.74
8.1.280.0110.00425.92
8.1.270.0030.00623.99
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00620.84
8.1.230.0040.00822.63
8.1.220.0000.00817.74
8.1.210.0030.00618.96
8.1.200.0030.00517.35
8.1.190.0060.00317.23
8.1.180.0050.00318.10
8.1.170.0080.00018.41
8.1.160.0000.00719.00
8.1.150.0000.00718.53
8.1.140.0040.00417.39
8.1.130.0040.00417.72
8.1.120.0000.00717.46
8.1.110.0020.00517.43
8.1.100.0000.00817.50
8.1.90.0030.00317.54
8.1.80.0040.00417.52
8.1.70.0000.00717.45
8.1.60.0110.00017.65
8.1.50.0050.00317.45
8.1.40.0090.00217.57
8.1.30.0090.00017.48
8.1.20.0050.00317.68
8.1.10.0030.00617.51
8.1.00.0040.00417.52
8.0.300.0000.00719.98
8.0.290.0040.00416.75
8.0.280.0050.00218.37
8.0.270.0000.01017.19
8.0.260.0030.00316.90
8.0.250.0040.00417.06
8.0.240.0080.00017.00
8.0.230.0040.00416.95
8.0.220.0070.00016.94
8.0.210.0070.00017.02
8.0.200.0030.00316.90
8.0.190.0040.00416.98
8.0.180.0070.00016.86
8.0.170.0030.00316.84
8.0.160.0000.00716.93
8.0.150.0000.00816.93
8.0.140.0060.00316.82
8.0.130.0040.00413.36
8.0.120.0000.00716.88
8.0.110.0050.00316.94
8.0.100.0050.00316.97
8.0.90.0040.00416.91
8.0.80.0070.01017.04
8.0.70.0030.00516.80
8.0.60.0040.00417.08
8.0.50.0040.00417.07
8.0.30.0130.00717.05
8.0.20.0090.00917.40
8.0.10.0040.00417.05
8.0.00.0100.00816.70
7.4.330.0050.00016.82
7.4.320.0050.00216.51
7.4.300.0050.00216.49
7.4.290.0030.00316.53
7.4.280.0000.00716.62
7.4.270.0000.00616.52
7.4.260.0050.00013.32
7.4.250.0040.00816.58
7.4.240.0020.00516.56
7.4.230.0040.00416.70
7.4.220.0080.00016.38
7.4.210.0080.00816.58
7.4.200.0040.00416.40
7.4.190.0070.00016.38
7.4.160.0070.01016.60
7.4.150.0070.01317.40
7.4.140.0120.00817.86
7.4.130.0060.01116.39
7.4.120.0110.00616.49
7.4.110.0170.00016.36
7.4.100.0040.01516.61
7.4.90.0090.00916.59
7.4.80.0030.01519.39
7.4.70.0100.00716.57
7.4.60.0070.01116.60
7.4.50.0000.00916.44
7.4.40.0000.01522.77
7.4.30.0160.00316.44
7.4.00.0070.01015.16
7.3.330.0050.00013.39
7.3.320.0030.00313.24
7.3.310.0000.00716.27
7.3.300.0070.00016.39
7.3.290.0070.00716.39
7.3.280.0060.01316.35
7.3.270.0060.01017.40
7.3.260.0160.00518.24
7.3.250.0090.00816.46
7.3.240.0100.00716.59
7.3.230.0090.00916.39
7.3.210.0070.01116.63
7.3.200.0040.01519.39
7.3.190.0000.01416.66
7.3.180.0150.00616.61
7.3.170.0100.00716.45
7.3.160.0070.01016.64
7.3.120.0060.00814.91
7.3.110.0050.01414.72
7.3.100.0080.01114.66
7.3.90.0020.01414.83
7.3.80.0050.01214.82
7.3.70.0060.01014.83
7.3.60.0090.00314.86
7.3.50.0070.00814.68
7.3.40.0060.00914.85
7.3.30.0030.00914.65
7.3.20.0090.00316.82
7.3.10.0050.01016.44
7.3.00.0030.01316.55
7.2.330.0100.00716.76
7.2.320.0100.01016.73
7.2.310.0120.01116.76
7.2.300.0100.00716.66
7.2.290.0070.01016.68
7.2.250.0080.01015.00
7.2.240.0110.00715.15
7.2.230.0050.00815.09
7.2.220.0030.01115.05
7.2.210.0050.00815.03
7.2.200.0070.01214.96
7.2.190.0050.01115.04
7.2.180.0030.01115.19
7.2.170.0050.01215.13
7.2.160.0060.00814.99
7.2.150.0040.00916.97
7.2.140.0020.01116.84
7.2.130.0040.01216.86
7.2.120.0110.00416.81
7.2.110.0060.00716.79
7.2.100.0030.01216.94
7.2.90.0060.00916.85
7.2.80.0060.00816.91
7.2.70.0050.00816.85
7.2.60.0060.00817.04
7.2.50.0050.00916.96
7.2.40.0050.00916.92
7.2.30.0060.01017.00
7.2.20.0020.01017.00
7.2.10.0080.00716.81
7.2.00.0060.00817.63
7.1.330.0040.01415.92
7.1.320.0020.01115.83
7.1.310.0050.01115.89
7.1.300.0020.01115.88
7.1.290.0030.00715.74
7.1.280.0040.00615.67
7.1.270.0090.00215.77
7.1.260.0030.01015.77
7.1.250.0020.00915.91
7.1.240.0070.01015.91
7.1.230.0070.00515.88
7.1.220.0020.01315.87
7.1.210.0050.00915.63
7.1.200.0050.00615.77
7.1.190.0060.01015.67
7.1.180.0070.00715.68
7.1.170.0050.01115.74
7.1.160.0040.00715.75
7.1.150.0040.00915.77
7.1.140.0040.01115.70
7.1.130.0030.00915.70
7.1.120.0060.00615.74
7.1.110.0060.00615.85
7.1.100.0060.00716.74
7.1.90.0090.00515.84
7.1.80.0090.00415.77
7.1.70.0060.00716.19
7.1.60.0100.00816.91
7.1.50.0060.01016.23
7.1.40.0060.00615.74
7.1.30.0070.00715.75
7.1.20.0090.00715.82
7.1.10.0070.00815.81
7.1.00.0020.02017.88
7.0.330.0040.00915.35
7.0.320.0050.00515.28
7.0.310.0070.00715.36
7.0.300.0020.00815.40
7.0.290.0070.00515.42
7.0.280.0060.00515.22
7.0.270.0030.01015.45
7.0.260.0050.00615.22
7.0.250.0070.00615.54
7.0.240.0070.00915.42
7.0.230.0060.00315.32
7.0.220.0050.00815.53
7.0.210.0080.00815.49
7.0.200.0040.00815.74
7.0.190.0030.01015.42
7.0.180.0080.00115.33
7.0.170.0040.00815.46
7.0.160.0050.01015.37
7.0.150.0060.01015.23
7.0.140.0040.02917.75
7.0.130.0020.01015.36
7.0.120.0060.00915.60
7.0.110.0020.00815.47
7.0.100.0060.00615.35
7.0.90.0060.00515.42
7.0.80.0060.00615.31
7.0.70.0100.03116.72
7.0.60.0050.02916.99
7.0.50.0100.02417.10
7.0.40.0070.03315.70
7.0.30.0050.03015.65
7.0.20.0080.03215.70
7.0.10.0040.03315.65
7.0.00.0050.03115.60
5.6.400.0040.01014.57
5.6.390.0030.01214.33
5.6.380.0060.00614.21
5.6.370.0050.00814.51
5.6.360.0040.01114.33
5.6.350.0090.00214.64
5.6.340.0030.00914.49
5.6.330.0080.00814.39
5.6.320.0050.00814.50
5.6.310.0060.00614.60
5.6.300.0060.00514.50
5.6.290.0030.00814.43
5.6.280.0060.02816.85
5.6.270.0060.00814.48
5.6.260.0050.00914.50
5.6.250.0110.00314.38
5.6.240.0080.00614.47
5.6.230.0060.00514.46
5.6.220.0070.03316.47
5.6.210.0040.02116.43
5.6.200.0070.03116.80
5.6.190.0060.03416.66
5.6.180.0060.03316.75
5.6.170.0080.03216.62
5.6.160.0040.03216.59
5.6.150.0070.03416.49
5.6.140.0050.02716.80
5.6.130.0050.03216.72
5.6.120.0040.02716.72
5.6.110.0070.03416.57
5.6.100.0050.02416.54
5.6.90.0090.03116.58
5.6.80.0050.02516.36
5.6.70.0070.03316.27
5.6.60.0110.02716.41
5.6.50.0070.02516.42
5.6.40.0110.02916.33
5.6.30.0080.02916.36
5.6.20.0060.03216.43
5.6.10.0070.02616.17
5.6.00.0060.01616.33
5.5.380.0020.01414.43
5.5.370.0080.00614.21
5.5.360.0090.02916.38
5.5.350.0060.03516.43
5.5.340.0060.03216.52
5.5.330.0070.03316.54
5.5.320.0040.03016.45
5.5.310.0080.02816.63
5.5.300.0050.03716.46
5.5.290.0050.03316.55
5.5.280.0070.03316.51
5.5.270.0060.03016.57
5.5.260.0070.03016.53
5.5.250.0100.02916.58
5.5.240.0040.03516.28
5.5.230.0060.03116.20
5.5.220.0090.03216.31
5.5.210.0040.02616.23
5.5.200.0090.03016.26
5.5.190.0090.02116.32
5.5.180.0080.03416.28
5.5.170.0060.00614.39
5.5.160.0080.03216.29
5.5.150.0100.03016.45
5.5.140.0110.02716.37
5.5.130.0070.03116.32
5.5.120.0080.03016.39
5.5.110.0070.01916.13
5.5.100.0060.03416.19
5.5.90.0070.03016.29
5.5.80.0080.02816.20
5.5.70.0060.03216.23
5.5.60.0050.02916.10
5.5.50.0040.02216.19
5.5.40.0120.02416.24
5.5.30.0040.03116.18
5.5.20.0050.02416.16
5.5.10.0080.02616.34
5.5.00.0120.02515.99
5.4.450.0040.02214.95
5.4.440.0100.02314.87
5.4.430.0050.03014.85
5.4.420.0020.03214.97
5.4.410.0030.03414.92
5.4.400.0050.03114.85
5.4.390.0080.03014.77
5.4.380.0030.02014.75
5.4.370.0070.02714.83
5.4.360.0090.02614.86
5.4.350.0020.03114.81
5.4.340.0080.02714.81
5.4.330.0050.00712.70
5.4.320.0080.02914.84
5.4.310.0060.02814.81
5.4.300.0050.03114.88
5.4.290.0040.02514.75
5.4.280.0090.02814.76
5.4.270.0030.02214.78
5.4.260.0070.03014.87
5.4.250.0050.03214.80
5.4.240.0070.01714.76
5.4.230.0070.02914.77
5.4.220.0060.02714.79
5.4.210.0060.02314.76
5.4.200.0040.03014.81
5.4.190.0060.02914.81
5.4.180.0030.03414.79
5.4.170.0050.02114.79
5.4.160.0060.01914.78
5.4.150.0080.02914.78
5.4.140.0090.02513.91
5.4.130.0110.01413.86
5.4.120.0030.02913.93
5.4.110.0040.02813.92
5.4.100.0050.02913.91
5.4.90.0060.02813.90
5.4.80.0020.01613.88
5.4.70.0050.01613.90
5.4.60.0040.01913.89
5.4.50.0040.02513.89
5.4.40.0050.01413.89
5.4.30.0030.02413.90
5.4.20.0050.01313.91
5.4.10.0020.01613.89
5.4.00.0030.01913.77
5.3.290.0070.03013.40
5.3.280.0050.03013.34
5.3.270.0070.02513.33
5.3.260.0050.01913.34
5.3.250.0080.02613.33
5.3.240.0020.02313.31
5.3.230.0040.03013.34
5.3.220.0060.02013.37
5.3.210.0040.02813.36
5.3.200.0080.02413.32
5.3.190.0040.01913.31
5.3.180.0050.02713.31
5.3.170.0020.01613.34
5.3.160.0020.01613.32
5.3.150.0030.01713.30
5.3.140.0020.01613.34
5.3.130.0060.01413.29
5.3.120.0020.02813.31
5.3.110.0010.01713.32
5.3.100.0000.02213.15
5.3.90.0030.01413.18
5.3.80.0010.01713.18
5.3.70.0060.01613.11
5.3.60.0030.01613.14
5.3.50.0030.01513.13
5.3.40.0050.01513.15
5.3.30.0020.02213.14
5.3.20.0020.01613.04
5.3.10.0020.02612.98
5.3.00.0020.01613.00
5.2.170.0100.02312.27
5.2.160.0000.03012.27
5.2.150.0070.02312.27
5.2.140.0030.02712.27
5.2.130.0030.02712.27
5.2.120.0070.03312.27
5.2.110.0000.07012.27
5.2.100.0030.06012.27
5.2.90.0030.03712.27
5.2.80.0030.02712.27
5.2.70.0000.03012.27
5.2.60.0000.03012.27
5.2.50.0030.03012.27
5.2.40.0030.02312.27
5.2.30.0000.03012.27
5.2.20.0100.03312.27
5.2.10.0000.03012.27
5.2.00.0000.03012.27
5.1.60.0000.02712.27
5.1.50.0000.04712.27
5.1.40.0000.02712.27
5.1.30.0030.03312.27
5.1.20.0070.02712.27
5.1.10.0000.02712.27
5.1.00.0070.02312.27
5.0.50.0030.02012.27
5.0.40.0000.02012.27
5.0.30.0030.03312.27
5.0.20.0000.04012.27
5.0.10.0000.02012.27
5.0.00.0000.03712.27
4.4.90.0030.01312.27
4.4.80.0000.01712.27
4.4.70.0000.01312.27
4.4.60.0000.02312.27
4.4.50.0000.01312.27
4.4.40.0000.02012.27
4.4.30.0000.01712.27
4.4.20.0030.02012.27
4.4.10.0000.02312.27
4.4.00.0030.02312.27
4.3.110.0000.02012.27
4.3.100.0030.01312.27
4.3.90.0000.02012.27
4.3.80.0030.02312.27
4.3.70.0000.01312.27
4.3.60.0000.01712.27
4.3.50.0000.01712.27
4.3.40.0000.02312.27
4.3.30.0000.01312.27
4.3.20.0000.03012.27
4.3.10.0000.01712.27
4.3.00.0000.01312.27

preferences:
48.73 ms | 401 KiB | 5 Q