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.70.0090.00618.68
8.3.60.0090.00616.75
8.3.50.0080.01121.21
8.3.40.0140.00718.66
8.3.30.0110.00318.84
8.3.20.0070.00020.30
8.3.10.0090.00023.66
8.3.00.0080.00023.51
8.2.180.0160.00616.50
8.2.170.0140.00422.96
8.2.160.0110.00320.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00019.82
8.2.120.0000.00826.35
8.2.110.0070.00321.11
8.2.100.0060.00617.93
8.2.90.0030.00619.28
8.2.80.0080.00017.97
8.2.70.0000.01017.75
8.2.60.0080.00017.88
8.2.50.0040.00418.07
8.2.40.0000.00720.55
8.2.30.0030.00319.32
8.2.20.0070.00017.76
8.2.10.0060.00618.00
8.2.00.0030.00618.11
8.1.280.0150.00625.92
8.1.270.0120.00623.71
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0080.00022.45
8.1.230.0090.00319.21
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0000.01017.23
8.1.190.0050.00317.22
8.1.180.0030.00618.10
8.1.170.0030.00518.50
8.1.160.0040.00420.66
8.1.150.0040.00418.92
8.1.140.0040.00419.59
8.1.130.0000.00717.70
8.1.120.0000.00717.48
8.1.110.0000.00717.38
8.1.100.0040.00417.39
8.1.90.0080.00017.37
8.1.80.0040.00417.52
8.1.70.0030.00317.52
8.1.60.0040.00417.52
8.1.50.0030.00617.53
8.1.40.0040.00417.51
8.1.30.0030.00617.63
8.1.20.0070.00017.68
8.1.10.0000.00817.54
8.1.00.0000.00717.56
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0030.00318.29
8.0.270.0070.00017.20
8.0.260.0080.00017.14
8.0.250.0030.00316.91
8.0.240.0030.00316.95
8.0.230.0000.00716.99
8.0.220.0000.00716.78
8.0.210.0000.00816.79
8.0.200.0030.00316.99
8.0.190.0040.00417.10
8.0.180.0000.00816.96
8.0.170.0040.00416.98
8.0.160.0000.00716.86
8.0.150.0070.00016.89
8.0.140.0070.00016.88
8.0.130.0030.00313.42
8.0.120.0080.00016.96
8.0.110.0040.00416.97
8.0.100.0080.00017.02
8.0.90.0040.00417.07
8.0.80.0100.00616.95
8.0.70.0030.00516.89
8.0.60.0040.00417.02
8.0.50.0000.00716.79
8.0.30.0080.01117.34
8.0.20.0120.00717.40
8.0.10.0000.00816.95
8.0.00.0080.00916.86
7.4.330.0050.00016.85
7.4.320.0060.00016.50
7.4.300.0000.00816.42
7.4.290.0000.00716.61
7.4.280.0030.00616.45
7.4.270.0000.00716.53
7.4.260.0080.00016.46
7.4.250.0000.00716.37
7.4.240.0030.00316.63
7.4.230.0000.00716.62
7.4.220.0110.00716.56
7.4.210.0060.01016.53
7.4.200.0000.00716.39
7.4.160.0070.01016.50
7.4.150.0030.01317.40
7.4.140.0090.00917.86
7.4.130.0100.01116.52
7.4.120.0070.01116.51
7.4.110.0100.00716.43
7.4.100.0120.00616.41
7.4.90.0130.00316.48
7.4.80.0160.00719.39
7.4.70.0140.00616.44
7.4.60.0070.01016.57
7.4.50.0060.01016.63
7.4.40.0120.00616.33
7.4.30.0040.01416.39
7.4.00.0070.00714.80
7.3.330.0050.00013.31
7.3.320.0030.00313.36
7.3.310.0000.00716.21
7.3.300.0030.00316.21
7.3.290.0000.00716.40
7.3.280.0070.01216.32
7.3.270.0070.01117.40
7.3.260.0090.00916.37
7.3.250.0070.01116.44
7.3.240.0070.01316.39
7.3.230.0030.01416.39
7.3.210.0130.01016.50
7.3.200.0070.01719.39
7.3.190.0070.01016.43
7.3.180.0070.01016.56
7.3.170.0120.00916.41
7.3.160.0120.00416.42
7.2.330.0110.00716.63
7.2.320.0100.00616.65
7.2.310.0110.00616.64
7.2.300.0030.01516.57
7.2.290.0040.02016.58
7.2.60.0070.00716.94
7.2.00.0060.00819.27
7.1.200.0070.00715.86
7.1.100.0130.00318.14
7.1.70.0030.01017.21
7.1.60.0040.01119.30
7.1.50.0090.01216.89
7.1.00.0070.07022.42
7.0.200.0290.00315.06
7.0.60.0130.05021.63
7.0.50.0030.04317.79
7.0.40.0170.08020.12
7.0.30.0230.03320.16
7.0.20.0300.08020.05
7.0.10.0070.07020.20
7.0.00.0030.07320.14
5.6.280.0070.05720.92
5.6.210.0030.05320.62
5.6.200.0100.06318.14
5.6.190.0070.07020.39
5.6.180.0430.07320.61
5.6.170.0230.07720.47
5.6.160.0070.07020.39
5.6.150.0070.08018.18
5.6.140.0000.05018.17
5.6.130.0070.08018.17
5.6.120.0000.04321.03
5.6.110.0030.06321.13
5.6.100.0130.07320.98
5.6.90.0100.05020.98
5.6.80.0100.06720.39
5.5.350.0170.08020.35
5.5.340.0070.08317.99
5.5.330.0070.07720.19
5.5.320.0600.04720.38
5.5.310.0130.07720.41
5.5.300.0030.04017.95
5.5.290.0170.05718.01
5.5.280.0070.08320.78
5.5.270.0000.05020.77
5.5.260.0130.08020.87
5.5.250.0100.06320.67
5.5.240.0200.07020.38

preferences:
50.15 ms | 401 KiB | 5 Q