3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function bar($x) { $that = $this; $powerOfThree = function($x) use ($that) { return $that->square($x) * $x; }; return $powerOfThree($x); } public function square($x) { return $x * $x; } } $foo = new Foo(); var_dump($foo->bar(2));

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.0100.00316.38
8.3.50.0120.00522.76
8.3.40.0070.00718.72
8.3.30.0070.01019.07
8.3.20.0070.00020.29
8.3.10.0040.00420.36
8.3.00.0000.00719.04
8.2.180.0170.00016.50
8.2.170.0110.00422.96
8.2.160.0070.00720.35
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.38
8.2.110.0090.00022.24
8.2.100.0040.00817.91
8.2.90.0040.00419.21
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00418.22
8.2.30.0040.00419.48
8.2.20.0040.00417.54
8.2.10.0040.00417.97
8.2.00.0040.00417.68
8.1.280.0140.00025.92
8.1.270.0000.00823.64
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0060.00322.14
8.1.230.0000.01117.52
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0080.00317.35
8.1.190.0040.00417.53
8.1.180.0070.00018.10
8.1.170.0080.00018.55
8.1.160.0070.00018.81
8.1.150.0050.00318.90
8.1.140.0000.00717.47
8.1.130.0000.00817.88
8.1.120.0050.00317.52
8.1.110.0070.00017.50
8.1.100.0000.00717.36
8.1.90.0040.00417.37
8.1.80.0070.00017.44
8.1.70.0070.00017.28
8.1.60.0050.00317.48
8.1.50.0000.00817.43
8.1.40.0080.00017.54
8.1.30.0060.00317.53
8.1.20.0050.00317.59
8.1.10.0070.00017.57
8.1.00.0030.00617.52
8.0.300.0000.00718.77
8.0.290.0080.00016.63
8.0.280.0000.00718.36
8.0.270.0000.00717.26
8.0.260.0000.00717.26
8.0.250.0000.00716.86
8.0.240.0000.00817.00
8.0.230.0030.00616.93
8.0.220.0070.00016.84
8.0.210.0040.00416.94
8.0.200.0030.00316.82
8.0.190.0030.00316.83
8.0.180.0050.00316.82
8.0.170.0000.00816.96
8.0.160.0040.00416.86
8.0.150.0030.00516.86
8.0.140.0000.00716.81
8.0.130.0030.00313.32
8.0.120.0060.00316.86
8.0.110.0030.00316.78
8.0.100.0000.00716.76
8.0.90.0040.00416.94
8.0.80.0060.01016.86
8.0.70.0040.00416.81
8.0.60.0000.00716.81
8.0.50.0000.00716.92
8.0.30.0130.00817.03
8.0.20.0120.00817.41
8.0.10.0040.00416.85
8.0.00.0130.00616.60
7.4.330.0000.00615.16
7.4.320.0040.00416.53
7.4.300.0040.00416.61
7.4.290.0000.00716.58
7.4.280.0000.00716.50
7.4.270.0000.00616.65
7.4.260.0070.00416.51
7.4.250.0000.00816.45
7.4.240.0030.00516.65
7.4.230.0000.00716.63
7.4.220.0030.01616.64
7.4.210.0030.01216.61
7.4.200.0000.00716.50
7.4.160.0120.00416.45
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0060.01416.65
7.4.120.0110.00716.57
7.4.110.0150.00316.32
7.4.100.0090.00916.58
7.4.90.0130.00316.39
7.4.80.0000.01919.39
7.4.70.0150.00316.55
7.4.60.0100.00716.49
7.4.50.0030.00516.37
7.4.40.0150.00316.51
7.4.30.0170.00016.55
7.4.00.0070.00715.09
7.3.330.0060.00013.38
7.3.320.0000.00613.19
7.3.310.0000.00616.29
7.3.300.0000.00716.28
7.3.290.0040.01116.31
7.3.280.0140.00616.28
7.3.270.0130.00717.40
7.3.260.0130.00416.38
7.3.250.0070.01016.46
7.3.240.0050.01316.58
7.3.230.0070.01016.39
7.3.210.0090.00616.39
7.3.200.0000.01616.64
7.3.190.0100.00716.56
7.3.180.0030.01316.62
7.3.170.0100.00616.46
7.3.160.0040.01216.28
7.2.330.0120.00616.43
7.2.320.0140.00816.73
7.2.310.0130.00316.59
7.2.300.0100.01016.41
7.2.290.0070.01016.59
7.2.00.0040.00819.48
7.1.100.0040.01117.82
7.1.70.0030.00617.15
7.1.60.0130.01019.34
7.1.50.0140.00716.79
7.1.00.0000.08022.41
7.0.200.0020.00516.70
7.0.140.0000.03322.15
7.0.60.0170.07319.84
7.0.50.0100.04317.84
7.0.40.0070.04020.02
7.0.30.0400.06720.13
7.0.20.0230.08020.19
7.0.10.0070.08020.07
7.0.00.0070.04720.09
5.6.280.0100.06320.92
5.6.210.0030.09020.70
5.6.200.0070.04018.19
5.6.190.0070.06720.61
5.6.180.0470.03720.61
5.6.170.0230.04020.55
5.6.160.0030.05720.50
5.6.150.0100.03318.29
5.6.140.0030.03718.18
5.6.130.0170.08018.20
5.6.120.0130.05021.09
5.6.110.0070.08721.00
5.6.100.0030.06721.10
5.6.90.0030.04021.05
5.6.80.0100.06020.54
5.5.350.0300.07020.36
5.5.340.0030.08317.98
5.5.330.0070.06320.44
5.5.320.0330.04720.27
5.5.310.0200.06020.23
5.5.300.0000.04017.94
5.5.290.0100.07717.98
5.5.280.0000.05320.74
5.5.270.0130.08020.79
5.5.260.0070.08020.98
5.5.250.0030.05020.56
5.5.240.0130.06320.29
5.4.450.0370.06319.47
5.4.440.0570.06019.55
5.4.430.0070.05719.63
5.4.420.0100.05719.54
5.4.410.0170.05019.57
5.4.400.0100.05319.13
5.4.390.0130.05019.16
5.4.380.0070.05719.23
5.4.370.0130.04719.02
5.4.360.0130.04718.99
5.4.350.0110.04312.03
5.4.340.0060.04712.02
5.4.320.0080.04212.51
5.4.310.0080.04412.51
5.4.300.0090.03712.51
5.4.290.0140.04012.51
5.4.280.0040.03912.40
5.4.270.0060.03912.40
5.4.260.0140.03212.40
5.4.250.0060.04412.40
5.4.240.0070.04612.41
5.4.230.0110.05012.39
5.4.220.0070.03912.39
5.4.210.0060.03912.39
5.4.200.0070.04112.39
5.4.190.0110.04112.39
5.4.180.0110.03312.39
5.4.170.0080.03612.40
5.4.160.0060.03812.40
5.4.150.0050.04112.39
5.4.140.0050.04712.08
5.4.130.0110.04212.07
5.4.120.0080.03912.02
5.4.110.0070.04012.02
5.4.100.0050.03812.02
5.4.90.0050.04112.02
5.4.80.0050.03912.02
5.4.70.0090.03412.01
5.4.60.0050.03812.02
5.4.50.0060.04112.02
5.4.40.0090.03512.00
5.4.30.0080.04012.00
5.4.20.0080.03812.00
5.4.10.0080.03912.00
5.4.00.0060.04611.49
5.3.290.0080.04612.80
5.3.280.0110.04712.71
5.3.270.0080.05412.72
5.3.260.0100.05312.72
5.3.250.0080.04912.72
5.3.240.0110.03712.72
5.3.230.0080.03712.71
5.3.220.0070.03912.68
5.3.210.0060.04512.68
5.3.200.0080.04312.68
5.3.190.0090.05112.68
5.3.180.0120.04312.68
5.3.170.0060.05012.67
5.3.160.0090.04912.68
5.3.150.0030.04312.68
5.3.140.0110.03712.66
5.3.130.0090.04612.66
5.3.120.0140.03812.66
5.3.110.0140.04612.66
5.3.100.0060.04512.13
5.3.90.0100.04512.11
5.3.80.0070.04212.10
5.3.70.0070.04012.10
5.3.60.0080.03912.09
5.3.50.0070.04012.04
5.3.40.0100.03912.04
5.3.30.0050.03912.00
5.3.20.0070.03611.78
5.3.10.0090.05411.73
5.3.00.0080.05211.73
5.2.170.0090.0419.23
5.2.160.0050.0439.22
5.2.150.0050.0449.23
5.2.140.0050.0449.22
5.2.130.0060.0409.18
5.2.120.0120.0359.18
5.2.110.0070.0409.18
5.2.100.0050.0439.17
5.2.90.0090.0419.18
5.2.80.0050.0429.17
5.2.70.0080.0419.18
5.2.60.0070.0429.12
5.2.50.0050.0369.10
5.2.40.0090.0309.07
5.2.30.0070.0359.05
5.2.20.0050.0379.04
5.2.10.0080.0378.94
5.2.00.0060.0408.81
5.1.60.0080.0308.09
5.1.50.0110.0328.09
5.1.40.0060.0328.07
5.1.30.0080.0348.42
5.1.20.0070.0328.44
5.1.10.0060.0278.17
5.1.00.0080.0348.17
5.0.50.0050.0246.64
5.0.40.0030.0236.50
5.0.30.0040.0346.32
5.0.20.0070.0246.28
5.0.10.0030.0296.26
5.0.00.0050.0386.25
4.4.90.0030.0234.78
4.4.80.0020.0234.75
4.4.70.0020.0224.76
4.4.60.0010.0234.75
4.4.50.0050.0204.77
4.4.40.0040.0324.71
4.4.30.0020.0224.76
4.4.20.0050.0204.84
4.4.10.0040.0214.84
4.4.00.0060.0294.76
4.3.110.0030.0214.67
4.3.100.0060.0184.66
4.3.90.0050.0194.63
4.3.80.0040.0274.58
4.3.70.0070.0184.63
4.3.60.0090.0154.63
4.3.50.0070.0204.63
4.3.40.0070.0314.53
4.3.30.0020.0173.30
4.3.20.0020.0183.28
4.3.10.0040.0193.24
4.3.00.0070.0236.96

preferences:
55.34 ms | 404 KiB | 6 Q