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.70.0180.00016.75
8.3.60.0140.00018.55
8.3.50.0090.00821.09
8.3.40.0140.00718.79
8.3.30.0100.00320.35
8.3.20.0050.00320.34
8.3.10.0080.00021.13
8.3.00.0080.00021.76
8.2.180.0100.01016.63
8.2.170.0140.00722.96
8.2.160.0070.00720.34
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.00
8.2.110.0040.00419.18
8.2.100.0000.01217.91
8.2.90.0080.00019.17
8.2.80.0040.00419.21
8.2.70.0050.00317.48
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0000.00818.02
8.2.30.0000.00719.38
8.2.20.0000.00717.80
8.2.10.0080.00017.70
8.2.00.0040.00417.76
8.1.280.0040.01725.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00320.48
8.1.230.0060.00620.90
8.1.220.0000.00818.77
8.1.210.0080.00019.03
8.1.200.0030.00617.22
8.1.190.0040.00417.66
8.1.180.0050.00318.10
8.1.170.0050.00318.29
8.1.160.0040.00418.95
8.1.150.0040.00418.72
8.1.140.0020.00517.50
8.1.130.0000.00717.80
8.1.120.0040.00417.54
8.1.110.0040.00417.32
8.1.100.0030.00517.55
8.1.90.0050.00317.54
8.1.80.0060.00317.37
8.1.70.0030.00317.49
8.1.60.0030.00617.46
8.1.50.0030.00517.54
8.1.40.0000.00917.43
8.1.30.0050.00317.60
8.1.20.0040.00417.64
8.1.10.0000.00817.55
8.1.00.0060.00317.53
8.0.300.0020.00519.93
8.0.290.0060.00317.18
8.0.280.0000.00718.39
8.0.270.0030.00617.16
8.0.260.0000.00716.82
8.0.250.0000.00717.01
8.0.240.0060.00316.95
8.0.230.0030.00317.03
8.0.220.0030.00316.96
8.0.210.0070.00016.99
8.0.200.0030.00316.91
8.0.190.0070.00016.89
8.0.180.0030.00516.98
8.0.170.0050.00316.94
8.0.160.0000.00716.95
8.0.150.0040.00416.98
8.0.140.0000.00816.90
8.0.130.0000.00513.46
8.0.120.0040.00416.82
8.0.110.0070.00016.80
8.0.100.0050.00216.79
8.0.90.0030.00616.94
8.0.80.0090.00616.96
8.0.70.0080.00016.85
8.0.60.0030.00516.81
8.0.50.0040.00416.85
8.0.30.0130.00617.02
8.0.20.0080.01017.40
8.0.10.0040.00417.12
8.0.00.0100.01216.99
7.4.330.0000.00516.69
7.4.320.0030.00316.53
7.4.300.0060.00016.46
7.4.290.0040.00416.52
7.4.280.0080.00016.45
7.4.270.0040.00416.48
7.4.260.0030.00313.31
7.4.250.0000.00816.59
7.4.240.0040.00416.48
7.4.230.0070.00016.68
7.4.220.0130.00616.61
7.4.210.0070.00916.59
7.4.200.0040.00416.64
7.4.190.0000.00716.46
7.4.160.0150.00016.41
7.4.150.0090.01517.40
7.4.140.0140.00817.86
7.4.130.0120.00516.49
7.4.120.0110.00616.55
7.4.110.0160.00616.54
7.4.100.0110.00516.50
7.4.90.0060.01216.55
7.4.80.0050.01119.39
7.4.70.0100.01016.54
7.4.60.0070.01116.71
7.4.50.0060.00316.61
7.4.40.0120.00622.77
7.4.30.0110.00816.70
7.4.00.0040.01114.67
7.3.330.0060.00013.38
7.3.320.0000.00713.37
7.3.310.0070.00016.41
7.3.300.0070.00016.21
7.3.290.0000.01416.38
7.3.280.0100.00916.38
7.3.270.0030.01417.40
7.3.260.0100.01118.24
7.3.250.0070.01216.48
7.3.240.0090.00916.44
7.3.230.0160.00616.68
7.3.210.0110.00616.37
7.3.200.0150.00819.39
7.3.190.0140.00916.37
7.3.180.0000.01716.46
7.3.170.0110.00616.66
7.3.160.0100.00716.29
7.3.120.0030.00715.00
7.3.10.0040.01116.64
7.3.00.0110.00416.51
7.2.330.0030.01516.79
7.2.320.0080.00816.93
7.2.310.0080.00816.77
7.2.300.0100.00716.79
7.2.290.0060.01216.75
7.2.130.0060.00816.90
7.2.120.0060.00916.87
7.2.110.0090.00616.83
7.2.100.0030.01116.99
7.2.90.0030.00916.99
7.2.80.0050.01016.84
7.2.70.0080.00616.86
7.2.60.0070.00616.76
7.2.50.0060.00816.76
7.2.40.0070.00716.91
7.2.30.0080.00816.90
7.2.20.0070.00616.83
7.2.10.0080.00916.86
7.2.00.0030.00917.50
7.1.250.0040.00715.80
7.1.240.0050.00615.68
7.1.230.0100.00615.63
7.1.220.0060.00815.71
7.1.210.0070.00815.74
7.1.200.0090.00215.77
7.1.190.0060.00715.70
7.1.180.0060.00815.73
7.1.170.0070.00815.80
7.1.160.0070.00715.77
7.1.150.0020.01315.77
7.1.140.0050.00915.63
7.1.130.0050.00815.76
7.1.120.0080.00715.78
7.1.110.0040.00915.82
7.1.100.0050.00616.54
7.1.90.0050.00915.74
7.1.80.0040.00915.77
7.1.70.0070.00515.96
7.1.60.0060.01016.59
7.1.50.0050.00816.08
7.1.40.0060.00515.68
7.1.30.0080.00615.61
7.1.20.0040.00815.75
7.1.10.0060.00715.64
7.1.00.0080.01117.28
7.0.330.0050.00615.32
7.0.320.0050.00715.34
7.0.310.0050.00815.29
7.0.300.0060.00815.34
7.0.290.0070.00515.35
7.0.280.0110.00415.43
7.0.270.0060.00515.24
7.0.260.0110.00115.19
7.0.250.0060.00615.46
7.0.240.0040.00815.44
7.0.230.0050.00715.34
7.0.220.0060.00615.39
7.0.210.0040.00715.45
7.0.200.0060.00515.73
7.0.190.0060.00615.41
7.0.180.0030.00915.31
7.0.170.0030.00815.38
7.0.160.0080.00515.38
7.0.150.0080.00715.33
7.0.140.0040.02317.00
7.0.130.0060.00615.40
7.0.120.0070.00815.28
7.0.110.0070.00615.26
7.0.100.0110.02316.44
7.0.90.0120.02416.41
7.0.80.0080.01716.52
7.0.70.0090.02316.47
7.0.60.0080.02416.53
7.0.50.0070.02816.60
7.0.40.0060.01715.15
7.0.30.0040.01715.00
7.0.20.0060.01615.04
7.0.10.0070.01415.21
7.0.00.0060.01414.98
5.6.380.0090.00514.64
5.6.370.0080.00414.30
5.6.360.0050.00614.41
5.6.350.0090.00314.36
5.6.340.0060.00614.49
5.6.330.0030.01014.50
5.6.320.0080.00714.52
5.6.310.0040.01014.48
5.6.300.0050.00614.49
5.6.290.0040.00514.41
5.6.280.0030.02616.03
5.6.270.0050.00614.44
5.6.260.0020.01114.41
5.6.250.0060.02516.00
5.6.240.0090.02216.09
5.6.230.0100.02115.99
5.6.220.0030.02515.96
5.6.210.0010.02815.94
5.6.200.0050.02616.14
5.6.190.0080.02516.06
5.6.180.0060.01915.90
5.6.170.0040.01815.92
5.6.160.0050.01416.16
5.6.150.0050.01416.05
5.6.140.0050.01816.19
5.6.130.0030.02616.02
5.6.120.0070.02115.98
5.6.110.0040.02315.88
5.6.100.0040.01716.05
5.6.90.0060.01415.98
5.6.80.0050.01415.85
5.6.70.0040.01815.85
5.6.60.0030.01715.74
5.6.50.0050.01315.80
5.6.40.0040.01716.00
5.6.30.0050.01515.94
5.6.20.0030.01615.95
5.6.10.0050.01315.76
5.6.00.0080.01115.74
5.5.380.0050.02213.35
5.5.370.0050.02013.59
5.5.360.0020.02813.46
5.5.350.0010.02513.62
5.5.340.0050.02313.71
5.5.330.0040.02413.51
5.5.320.0070.01213.61
5.5.310.0030.01713.56
5.5.300.0040.01413.75
5.5.290.0020.01813.62
5.5.280.0040.01413.58
5.5.270.0050.01413.61
5.5.260.0020.01713.85
5.5.250.0020.01513.44
5.5.240.0050.01313.43
5.5.230.0020.01613.25
5.5.220.0030.01513.38
5.5.210.0030.01513.37
5.5.200.0030.01613.42
5.5.190.0000.01613.48
5.5.180.0040.01313.38
5.5.170.0020.00611.20
5.5.160.0040.01213.50
5.5.150.0030.01413.41
5.5.140.0030.01513.34
5.5.130.0050.02213.45
5.5.120.0060.02313.40
5.5.110.0060.02013.49
5.5.100.0040.02213.48
5.5.90.0090.02213.39
5.5.80.0090.01213.18
5.5.70.0050.02313.30
5.5.60.0040.02413.27
5.5.50.0040.02413.38
5.5.40.0060.02213.37
5.5.30.0060.02113.36
5.5.20.0030.01713.35
5.5.10.0040.02313.31
5.5.00.0060.02513.20
5.4.450.0050.01413.20
5.4.440.0020.01513.26
5.4.430.0030.01513.15
5.4.420.0050.01513.21
5.4.410.0020.01513.06
5.4.400.0010.01612.97
5.4.390.0020.01613.19
5.4.380.0040.01312.92
5.4.370.0020.01513.07
5.4.360.0040.01313.06
5.4.350.0040.01512.99
5.4.340.0040.01513.04
5.4.330.0030.00610.90
5.4.320.0050.01113.13
5.4.310.0040.01613.10
5.4.300.0030.01412.99
5.4.290.0020.01413.02
5.4.280.0060.02313.01
5.4.270.0020.02513.05
5.4.260.0020.02213.07
5.4.250.0070.01413.08
5.4.240.0070.02112.94
5.4.230.0050.02113.03
5.4.220.0090.02013.11
5.4.210.0030.02313.00
5.4.200.0070.02112.97
5.4.190.0010.02313.09
5.4.180.0060.02113.17
5.4.170.0050.01313.04
5.4.160.0050.02213.03
5.4.150.0040.02012.95
5.4.140.0030.02412.37
5.4.130.0030.02312.44
5.4.120.0060.01912.42
5.4.110.0040.02512.43
5.4.100.0060.01812.49
5.4.90.0050.01612.39
5.4.80.0040.02212.43
5.4.70.0050.01512.44
5.4.60.0040.02312.42
5.4.50.0040.02212.40
5.4.40.0030.01512.30
5.4.30.0050.02012.48
5.4.20.0030.02512.39
5.4.10.0030.02512.30
5.4.00.0060.01812.20
5.3.290.0050.01411.70
5.3.280.0060.02311.73
5.3.270.0070.01911.72
5.3.260.0050.01911.66
5.3.250.0030.01611.70
5.3.240.0080.01111.64
5.3.230.0040.02111.57
5.3.220.0030.01611.64
5.3.210.0030.01211.64
5.3.200.0030.02211.63
5.3.190.0060.02011.63
5.3.180.0040.01911.69
5.3.170.0060.02011.71
5.3.160.0060.01211.69
5.3.150.0070.02011.67
5.3.140.0030.01411.68
5.3.130.0070.02211.63
5.3.120.0030.02511.62
5.3.110.0060.02111.59
5.3.100.0060.02211.51
5.3.90.0060.01311.44
5.3.80.0030.02111.52
5.3.70.0050.02011.52
5.3.60.0060.01511.50
5.3.50.0060.02111.49
5.3.40.0040.02111.47
5.3.30.0040.02411.54
5.3.20.0050.02011.42
5.3.10.0030.02211.26
5.3.00.0060.01811.40
5.2.170.0040.01410.78
5.2.160.0040.01910.84
5.2.150.0030.01610.85
5.2.140.0020.02010.83
5.2.130.0040.01210.81
5.2.120.0030.01110.83
5.2.110.0020.02010.84
5.2.100.0010.01410.79
5.2.90.0070.01410.82
5.2.80.0040.01310.77
5.2.70.0020.01110.80
5.2.60.0050.01110.79
5.2.50.0040.01810.76
5.2.40.0020.02010.76
5.2.30.0020.02010.81
5.2.20.0020.01310.80
5.2.10.0030.01910.77
5.2.00.0040.01810.76
5.1.60.0040.01410.76
5.1.50.0030.01510.76
5.1.40.0050.01410.76
5.1.30.0040.01710.76
5.1.20.0050.01510.76
5.1.10.0030.01610.76
5.1.00.0020.01710.76
5.0.50.0040.01010.76
5.0.40.0060.01010.76
5.0.30.0030.01810.76
5.0.20.0030.01210.76
5.0.10.0020.01410.76
5.0.00.0040.01810.76
4.4.90.0030.00910.76
4.4.80.0020.00910.76
4.4.70.0050.00910.76
4.4.60.0000.01210.76
4.4.50.0010.01110.76
4.4.40.0040.01310.76
4.4.30.0020.00710.76
4.4.20.0020.01110.76
4.4.10.0040.01010.76
4.4.00.0020.01510.76
4.3.110.0020.01210.76
4.3.100.0000.01210.76
4.3.90.0010.01310.76
4.3.80.0010.01610.76
4.3.70.0040.01110.76
4.3.60.0010.01310.76
4.3.50.0020.01110.76
4.3.40.0030.01510.76
4.3.30.0010.01210.76
4.3.20.0010.01010.76
4.3.10.0000.01010.76
4.3.00.0000.00910.76

preferences:
40.51 ms | 401 KiB | 5 Q