3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); 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.56
8.3.50.0080.00821.14
8.3.40.0110.00418.79
8.3.30.0070.00720.34
8.3.20.0080.00020.48
8.3.10.0040.00421.14
8.3.00.0070.00321.75
8.2.180.0040.01916.63
8.2.170.0140.00322.96
8.2.160.0080.00520.32
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00420.90
8.2.110.0060.00319.30
8.2.100.0110.00017.84
8.2.90.0000.00819.30
8.2.80.0050.00319.21
8.2.70.0040.00417.75
8.2.60.0050.00318.03
8.2.50.0000.00818.07
8.2.40.0030.00618.28
8.2.30.0050.00219.37
8.2.20.0000.00817.76
8.2.10.0000.00717.89
8.2.00.0070.00017.75
8.1.280.0170.00025.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00322.59
8.1.230.0090.00321.10
8.1.220.0060.00318.77
8.1.210.0090.00018.89
8.1.200.0090.00017.35
8.1.190.0050.00317.53
8.1.180.0000.00918.10
8.1.170.0040.00418.52
8.1.160.0040.00418.86
8.1.150.0040.00418.56
8.1.140.0000.00817.43
8.1.130.0030.00317.79
8.1.120.0000.00717.54
8.1.110.0000.00717.46
8.1.100.0080.00017.45
8.1.90.0050.00317.47
8.1.80.0040.00417.46
8.1.70.0000.00717.44
8.1.60.0060.00317.48
8.1.50.0060.00317.44
8.1.40.0030.00617.57
8.1.30.0040.00417.56
8.1.20.0060.00317.54
8.1.10.0060.00317.57
8.1.00.0040.00417.48
8.0.300.0000.00719.95
8.0.290.0080.00017.18
8.0.280.0030.00318.34
8.0.270.0040.00417.19
8.0.260.0000.00616.91
8.0.250.0030.00317.06
8.0.240.0080.00016.93
8.0.230.0070.00016.92
8.0.220.0000.00716.95
8.0.210.0070.00016.96
8.0.200.0020.00517.02
8.0.190.0040.00416.99
8.0.180.0040.00416.99
8.0.170.0000.00716.91
8.0.160.0030.00417.02
8.0.150.0040.00416.91
8.0.140.0070.00016.84
8.0.130.0070.00013.50
8.0.120.0000.00816.98
8.0.110.0070.00016.96
8.0.100.0030.00516.87
8.0.90.0040.00416.84
8.0.80.0110.00416.95
8.0.70.0080.00017.00
8.0.60.0030.00517.01
8.0.50.0070.00016.80
8.0.30.0110.00817.07
8.0.20.0080.01117.40
8.0.10.0040.00416.92
8.0.00.0110.00816.91
7.4.330.0020.00216.84
7.4.320.0030.00316.45
7.4.300.0030.00316.53
7.4.290.0030.00316.59
7.4.280.0040.00416.57
7.4.270.0000.00716.52
7.4.260.0000.00513.32
7.4.250.0000.00816.48
7.4.240.0050.00216.49
7.4.230.0030.00316.27
7.4.220.0100.00916.64
7.4.210.0080.00816.60
7.4.200.0030.00316.64
7.4.190.0020.00516.68
7.4.160.0060.00916.54
7.4.150.0090.00917.40
7.4.140.0070.01017.86
7.4.130.0090.00916.52
7.4.120.0110.00816.52
7.4.110.0100.00716.42
7.4.100.0070.01016.38
7.4.90.0160.00316.38
7.4.80.0080.01119.39
7.4.70.0030.01316.34
7.4.60.0070.01316.31
7.4.50.0000.00816.50
7.4.40.0040.00722.77
7.4.30.0090.00816.30
7.4.00.0030.01315.20
7.3.330.0030.00313.21
7.3.320.0030.00313.37
7.3.310.0040.00416.40
7.3.300.0000.00716.22
7.3.290.0120.00616.39
7.3.280.0080.01016.38
7.3.270.0070.01017.40
7.3.260.0140.00718.24
7.3.250.0200.01416.39
7.3.240.0110.01116.66
7.3.230.0070.01116.55
7.3.210.0070.01416.67
7.3.200.0060.01619.39
7.3.190.0130.00616.34
7.3.180.0120.00316.50
7.3.170.0130.00516.50
7.3.160.0060.01516.64
7.3.120.0030.01014.84
7.3.10.0140.00016.56
7.3.00.0070.00516.43
7.2.330.0070.01016.40
7.2.320.0120.00916.46
7.2.310.0150.00916.86
7.2.300.0070.01716.46
7.2.290.0130.00316.75
7.2.130.0000.01516.88
7.2.120.0090.00316.76
7.2.110.0040.00916.51
7.2.100.0060.00616.72
7.2.90.0050.00816.56
7.2.80.0090.00516.78
7.2.70.0110.00416.96
7.2.60.0030.01016.87
7.2.50.0030.01116.92
7.2.40.0080.00816.97
7.2.30.0070.00716.79
7.2.20.0140.00517.02
7.2.10.0110.00616.80
7.2.00.0100.00817.77
7.1.250.0070.00415.63
7.1.240.0070.00315.81
7.1.230.0060.01015.47
7.1.220.0080.00015.61
7.1.210.0070.00715.66
7.1.200.0070.00715.65
7.1.190.0090.00615.59
7.1.180.0040.00715.77
7.1.170.0050.00315.98
7.1.160.0040.00815.46
7.1.150.0070.00415.48
7.1.140.0040.00815.90
7.1.130.0120.00315.90
7.1.120.0000.00915.90
7.1.110.0040.01115.68
7.1.100.0000.01317.06
7.1.90.0060.00615.41
7.1.80.0090.00315.88
7.1.70.0050.00616.44
7.1.60.0050.01217.47
7.1.50.0060.01216.42
7.1.40.0030.01315.81
7.1.30.0040.00415.38
7.1.20.0030.01015.77
7.1.10.0070.00715.73
7.1.00.0050.03519.11
7.0.320.0040.00815.00
7.0.310.0040.01115.41
7.0.300.0060.00615.43
7.0.290.0080.00615.38
7.0.280.0000.01415.47
7.0.270.0080.00015.59
7.0.260.0000.00915.52
7.0.250.0090.00615.68
7.0.240.0030.01015.44
7.0.230.0060.00615.34
7.0.220.0030.01315.61
7.0.210.0000.01315.48
7.0.200.0070.00516.00
7.0.190.0060.00615.48
7.0.180.0040.01015.50
7.0.170.0060.00615.52
7.0.160.0000.01015.57
7.0.150.0070.00015.66
7.0.140.0030.04018.75
7.0.130.0040.00415.45
7.0.120.0060.00615.33
7.0.110.0000.01215.31
7.0.100.0190.04117.76
7.0.90.0060.04317.69
7.0.80.0100.02217.71
7.0.70.0100.03417.76
7.0.60.0150.03017.63
7.0.50.0130.03017.83
7.0.40.0050.04616.65
7.0.30.0050.03616.89
7.0.20.0090.02716.75
7.0.10.0030.04216.83
7.0.00.0040.04216.80
5.6.380.0090.00314.62
5.6.370.0030.01014.35
5.6.360.0030.00914.83
5.6.350.0030.00914.71
5.6.340.0060.00614.40
5.6.330.0080.00814.25
5.6.320.0030.00914.23
5.6.310.0040.00814.50
5.6.300.0080.00314.51
5.6.290.0100.00014.72
5.6.280.0040.04017.70
5.6.270.0060.00914.45
5.6.260.0000.01014.38
5.6.250.0080.03717.47
5.6.240.0020.04217.56
5.6.230.0040.02117.52
5.6.220.0050.03917.54
5.6.210.0110.04117.51
5.6.200.0140.04017.67
5.6.190.0100.02617.66
5.6.180.0050.04117.64
5.6.170.0080.04317.60
5.6.160.0090.03217.52
5.6.150.0070.03017.81
5.6.140.0110.04017.66
5.6.130.0100.04217.70
5.6.120.0080.04517.85
5.6.110.0070.03417.78
5.6.100.0030.04517.95
5.6.90.0080.04317.56
5.6.80.0050.02417.32
5.6.70.0100.04317.33
5.6.60.0050.03917.55
5.6.50.0150.02817.40
5.6.40.0040.04317.41
5.6.30.0100.03317.54
5.6.20.0090.04317.33
5.6.10.0050.03717.39
5.6.00.0070.02317.41
5.5.380.0100.01515.87
5.5.370.0070.04515.85
5.5.360.0070.04215.86
5.5.350.0070.04316.00
5.5.340.0110.02216.03
5.5.330.0030.04816.06
5.5.320.0050.04316.10
5.5.310.0050.04316.14
5.5.300.0050.04416.03
5.5.290.0060.04316.04
5.5.280.0050.04416.19
5.5.270.0050.03816.08
5.5.260.0070.04416.11
5.5.250.0060.03515.87
5.5.240.0100.03715.69
5.5.230.0010.05015.76
5.5.220.0120.03815.80
5.5.210.0080.04215.79
5.5.200.0050.04115.73
5.5.190.0080.04015.72
5.5.180.0030.03315.71
5.5.170.0030.01014.54
5.5.160.0100.03515.71
5.5.150.0080.04015.78
5.5.140.0070.03415.73
5.5.130.0070.02915.78
5.5.120.0060.04315.63
5.5.110.0110.03615.78
5.5.100.0030.03715.69
5.5.90.0070.03715.70
5.5.80.0090.04115.71
5.5.70.0100.02315.62
5.5.60.0080.03415.70
5.5.50.0020.02715.68
5.5.40.0090.04015.63
5.5.30.0070.02315.59
5.5.20.0120.03815.67
5.5.10.0080.03715.60
5.5.00.0040.03915.74
5.4.450.0050.04415.49
5.4.440.0030.03415.31
5.4.430.0070.04015.41
5.4.420.0030.04315.32
5.4.410.0070.03815.32
5.4.400.0050.03415.08
5.4.390.0080.04115.27
5.4.380.0060.03815.16
5.4.370.0110.03815.09
5.4.360.0080.03715.20
5.4.350.0060.02315.16
5.4.340.0070.04115.08
5.4.330.0080.00311.27
5.4.320.0060.02415.11
5.4.310.0030.03615.21
5.4.300.0120.02015.24
5.4.290.0000.03415.20
5.4.280.0050.04215.25
5.4.270.0050.03915.19
5.4.260.0060.03115.20
5.4.250.0050.04515.19
5.4.240.0020.03815.15
5.4.230.0070.02715.10
5.4.220.0080.04115.12
5.4.210.0020.04615.12
5.4.200.0030.03615.18
5.4.190.0090.02215.17
5.4.180.0080.03815.21
5.4.170.0080.03715.12
5.4.160.0030.03215.08
5.4.150.0030.04315.10
5.4.140.0070.04213.78
5.4.130.0100.03213.75
5.4.120.0030.03113.70
5.4.110.0080.03513.79
5.4.100.0070.02513.86
5.4.90.0060.03613.77
5.4.80.0070.02013.85
5.4.70.0020.04213.79
5.4.60.0070.02313.82
5.4.50.0040.03813.77
5.4.40.0050.03813.82
5.4.30.0020.04013.76
5.4.20.0060.02713.75
5.4.10.0080.03213.86
5.4.00.0000.03613.51
5.3.290.0030.02813.00
5.3.280.0030.04412.98
5.3.270.0090.03513.00
5.3.260.0020.03512.93
5.3.250.0010.04512.96
5.3.240.0040.03612.92
5.3.230.0080.02612.90
5.3.220.0030.04012.88
5.3.210.0070.04012.91
5.3.200.0030.02612.99
5.3.190.0030.02612.98
5.3.180.0070.02712.92
5.3.170.0020.02612.92
5.3.160.0050.03712.88
5.3.150.0070.03312.92
5.3.140.0070.03912.98
5.3.130.0030.02312.92
5.3.120.0020.03512.89
5.3.110.0030.04212.95
5.3.100.0030.04312.66
5.3.90.0090.03612.64
5.3.80.0050.04412.60
5.3.70.0060.03612.64
5.3.60.0070.04112.59
5.3.50.0050.03712.57
5.3.40.0070.03212.65
5.3.30.0050.04012.59
5.3.20.0050.02012.47
5.3.10.0070.03512.50
5.3.00.0070.03812.47
5.2.170.0080.03211.21
5.2.160.0050.02811.28
5.2.150.0050.01811.24
5.2.140.0070.01711.20
5.2.130.0030.03511.22
5.2.120.0050.03111.18
5.2.110.0080.02811.16
5.2.100.0030.03411.21
5.2.90.0030.03311.23
5.2.80.0050.03511.25
5.2.70.0050.03511.18
5.2.60.0020.03511.20
5.2.50.0070.03211.17
5.2.40.0070.02511.14
5.2.30.0060.02711.13
5.2.20.0020.03211.15
5.2.10.0050.01811.06
5.2.00.0030.01810.96
5.1.60.0080.02810.64
5.1.50.0020.01910.65
5.1.40.0050.02610.64
5.1.30.0060.02810.87
5.1.20.0050.03010.77
5.1.10.0050.02910.72
5.1.00.0100.02610.71
5.0.50.0080.02010.53
5.0.40.0070.01810.53
5.0.30.0000.03710.53
5.0.20.0000.02610.53
5.0.10.0020.02710.53
5.0.00.0050.03410.53
4.4.90.0050.01810.53
4.4.80.0030.01810.53
4.4.70.0050.01510.53
4.4.60.0020.01310.53
4.4.50.0030.02010.53
4.4.40.0050.03210.53
4.4.30.0050.02010.53
4.4.20.0020.01010.53
4.4.10.0020.02010.53
4.4.00.0020.03010.53
4.3.110.0040.01810.53
4.3.100.0030.02110.53
4.3.90.0050.01210.53
4.3.80.0030.03010.53
4.3.70.0000.01610.53
4.3.60.0010.02010.53
4.3.50.0030.01810.53
4.3.40.0000.02310.53
4.3.30.0030.01810.53
4.3.20.0020.02210.53
4.3.10.0030.02010.53
4.3.00.0050.01710.53

preferences:
41.02 ms | 401 KiB | 5 Q