3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $callable; public function __construct() { $this->callable = function () { echo "hello world!"; }; } public function yesItDoes() { ($this->callable)(); } } class Bar { private $name; public function __construct($id) { $this->name = function ($id) { echo "Hello ".$id; }; } public function getName() { ($this->name)(); } } (new Bar('eric'))-getName(); (new Foo)->yesItDoes();

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.0120.00316.63
8.3.50.0120.00621.28
8.3.40.0060.00918.97
8.3.30.0040.01118.92
8.3.20.0040.00420.34
8.3.10.0050.00323.48
8.3.00.0060.00323.48
8.2.180.0110.00416.50
8.2.170.0090.00922.96
8.2.160.0100.00720.39
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0050.00319.71
8.2.120.0040.00426.35
8.2.110.0030.00619.45
8.2.100.0070.00417.86
8.2.90.0030.00618.96
8.2.80.0040.00417.97
8.2.70.0070.00417.71
8.2.60.0000.00817.91
8.2.50.0050.00318.07
8.2.40.0000.00720.59
8.2.30.0000.00719.43
8.2.20.0040.00417.81
8.2.10.0110.00018.02
8.2.00.0060.00318.15
8.1.280.0040.01125.92
8.1.270.0110.00723.83
8.1.260.0050.00328.09
8.1.250.0070.00028.09
8.1.240.0040.00821.95
8.1.230.0040.00721.04
8.1.220.0040.00417.74
8.1.210.0030.00620.24
8.1.200.0040.00417.35
8.1.190.0000.00917.22
8.1.180.0040.00718.10
8.1.170.0030.00518.48
8.1.160.0040.00420.66
8.1.150.0070.00018.76
8.1.140.0080.00019.54
8.1.130.0040.00417.61
8.1.120.0020.00517.44
8.1.110.0040.00417.34
8.1.100.0040.00417.48
8.1.90.0000.00717.34
8.1.80.0000.00817.38
8.1.70.0070.00017.43
8.1.60.0000.00817.62
8.1.50.0050.00317.54
8.1.40.0030.00617.43
8.1.30.0000.00917.68
8.1.20.0040.00417.64
8.1.10.0040.00417.50
8.1.00.0030.00617.40
8.0.300.0040.00419.71
8.0.290.0040.00416.63
8.0.280.0050.00318.25
8.0.270.0030.00317.15
8.0.260.0030.00517.18
8.0.250.0040.00416.84
8.0.240.0000.00616.79
8.0.230.0030.00316.94
8.0.220.0000.00716.91
8.0.210.0030.00516.76
8.0.200.0000.00616.97
8.0.190.0030.00617.04
8.0.180.0050.00316.86
8.0.170.0050.00316.96
8.0.160.0000.00717.03
8.0.150.0000.00716.90
8.0.140.0000.00716.92
8.0.130.0030.00313.37
8.0.120.0030.00516.86
8.0.110.0040.00316.85
8.0.100.0000.00916.75
8.0.90.0030.00516.78
8.0.80.0100.01016.91
8.0.70.0020.00516.83
8.0.60.0030.00317.00
8.0.50.0000.00817.01
8.0.30.0140.00317.11
8.0.20.0100.00917.40
8.0.10.0040.00416.89
8.0.00.0100.01016.77
7.4.330.0050.00016.74
7.4.320.0000.00816.38
7.4.300.0000.00816.54
7.4.290.0040.00416.45
7.4.280.0030.00616.52
7.4.270.0070.00016.49
7.4.260.0040.00416.43
7.4.250.0000.00716.49
7.4.240.0010.00616.46
7.4.230.0000.00716.63
7.4.220.0120.00616.65
7.4.210.0110.00616.54
7.4.200.0040.00416.43
7.4.160.0170.00716.59
7.4.150.0100.00717.40
7.4.140.0150.00817.86
7.4.130.0120.00416.55
7.4.120.0130.00816.66
7.4.110.0140.00316.45
7.4.100.0110.01116.43
7.4.90.0100.00716.48
7.4.80.0130.00619.39
7.4.70.0150.00616.42
7.4.60.0100.00616.54
7.4.50.0040.01216.28
7.4.40.0120.00816.66
7.4.30.0100.00716.41
7.4.00.0150.00314.75
7.3.330.0050.00013.22
7.3.320.0030.00313.38
7.3.310.0030.00316.17
7.3.300.0000.00616.24
7.3.290.0000.00616.23
7.3.280.0110.00616.32
7.3.270.0120.00617.40
7.3.260.0100.00716.50
7.3.250.0100.00816.38
7.3.240.0120.00516.57
7.3.230.0090.00816.57
7.3.210.0130.00716.40
7.3.200.0110.00719.39
7.3.190.0040.01216.58
7.3.180.0090.00616.31
7.3.170.0030.01316.54
7.3.160.0040.01116.29
7.3.10.0040.01216.54
7.3.00.0090.01216.36
7.2.330.0150.00616.32
7.2.320.0150.00316.66
7.2.310.0120.00416.32
7.2.300.0050.01516.59
7.2.290.0160.00716.47
7.2.130.0140.00316.38
7.2.120.0110.00716.61
7.2.110.0070.01016.52
7.2.100.0130.00716.42
7.2.90.0110.00816.66
7.2.80.0110.00816.42
7.2.70.0030.00816.38
7.2.60.0110.00516.53
7.2.50.0100.00416.35
7.2.40.0060.00616.41
7.2.30.0070.00716.46
7.2.20.0130.00316.81
7.2.10.0070.00716.52
7.2.00.0080.01117.96
7.1.250.0070.00915.68
7.1.200.0040.01115.60
7.1.100.0100.00718.16
7.1.70.0000.01117.05
7.1.60.0070.01419.30
7.1.50.0030.01716.91
7.1.00.0100.07022.40
7.0.200.0190.00914.55
7.0.60.0130.08721.84
7.0.50.0100.08017.86
7.0.40.0030.04720.27
7.0.30.0430.06720.15
7.0.20.0230.08320.23
7.0.10.0070.04320.05
7.0.00.0130.05320.09
5.6.280.0000.03320.79
5.6.210.0100.03320.66
5.6.200.0100.04718.18
5.6.190.0030.06320.39
5.6.180.0300.04720.33
5.6.170.0270.05320.55
5.6.160.0130.07720.71
5.6.150.0070.08718.23
5.6.140.0070.03718.21
5.6.130.0100.08718.12
5.6.120.0030.04021.03
5.6.110.0070.08021.11
5.6.100.0000.08321.06
5.6.90.0100.06321.01
5.6.80.0130.07320.45
5.5.350.0100.04020.34
5.5.340.0030.05317.93
5.5.330.0130.08020.27
5.5.320.0670.06720.34
5.5.310.0270.03720.29
5.5.300.0070.04317.93
5.5.290.0100.05718.09
5.5.280.0130.07320.79
5.5.270.0100.08020.69
5.5.260.0130.07020.77
5.5.250.0000.04320.50
5.5.240.0130.06720.26

preferences:
44.79 ms | 401 KiB | 5 Q