3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __construct($val) { $this->val = $val; } function getClosure() { //returns closure bound to this object and scope return function() { return $this->val; }; } } $ob1 = new A(1); $ob2 = new A(2); $cl = $ob1->getClosure(); echo $cl(), "\n"; echo $cl->call($ob2);

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.00716.88
8.3.50.0100.01222.05
8.3.40.0070.00718.84
8.3.30.0110.00418.93
8.3.20.0050.00320.20
8.3.10.0080.00020.66
8.3.00.0040.00421.77
8.2.180.0100.00716.63
8.2.170.0170.00022.96
8.2.160.0110.00322.09
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00020.88
8.2.120.0030.00526.35
8.2.110.0040.00422.13
8.2.100.0060.00617.93
8.2.90.0050.00319.09
8.2.80.0000.00817.97
8.2.70.0000.00817.50
8.2.60.0050.00318.04
8.2.50.0080.00018.09
8.2.40.0040.00422.07
8.2.30.0000.00719.37
8.2.20.0050.00217.67
8.2.10.0000.00817.98
8.2.00.0040.00418.05
8.1.280.0070.01025.92
8.1.270.0070.00022.02
8.1.260.0000.00728.09
8.1.250.0070.00028.09
8.1.240.0050.00523.96
8.1.230.0080.00417.76
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0080.00017.23
8.1.180.0090.00018.10
8.1.170.0000.00918.55
8.1.160.0040.00420.79
8.1.150.0040.00420.66
8.1.140.0080.00019.54
8.1.130.0030.00317.73
8.1.120.0000.00717.52
8.1.110.0080.00017.54
8.1.100.0070.00017.34
8.1.90.0000.00817.46
8.1.80.0000.00817.49
8.1.70.0030.00317.39
8.1.60.0000.00717.58
8.1.50.0000.00817.61
8.1.40.0000.01117.52
8.1.30.0060.00317.70
8.1.20.0040.00417.47
8.1.10.0030.00517.49
8.1.00.0050.00217.50
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00318.34
8.0.270.0030.00317.18
8.0.260.0030.00317.30
8.0.250.0000.00717.02
8.0.240.0070.00017.01
8.0.230.0030.00316.95
8.0.220.0030.00316.77
8.0.210.0030.00516.85
8.0.200.0060.00016.83
8.0.190.0000.00816.92
8.0.180.0040.00416.84
8.0.170.0000.00716.95
8.0.160.0000.00816.93
8.0.150.0000.00816.88
8.0.140.0070.00416.85
8.0.130.0030.00313.37
8.0.120.0080.00016.77
8.0.110.0040.00416.93
8.0.100.0070.00016.92
8.0.90.0040.00416.93
8.0.80.0140.00316.93
8.0.70.0040.00416.95
8.0.60.0050.00316.82
8.0.50.0030.00516.77
8.0.30.0050.01317.16
8.0.20.0080.01017.40
8.0.10.0040.00416.82
8.0.00.0120.00816.88
7.4.330.0000.00516.84
7.4.320.0070.00016.70
7.4.300.0060.00016.52
7.4.290.0040.00416.70
7.4.280.0000.00816.49
7.4.270.0070.00016.59
7.4.260.0040.00416.50
7.4.250.0000.00816.47
7.4.240.0040.00416.43
7.4.230.0050.00316.46
7.4.220.0150.00316.68
7.4.210.0090.00616.57
7.4.200.0000.00716.51
7.4.160.0080.01416.48
7.4.150.0120.00617.40
7.4.140.0110.00717.86
7.4.130.0110.01216.45
7.4.120.0120.00816.51
7.4.110.0150.01116.52
7.4.100.0070.01016.49
7.4.90.0030.01316.49
7.4.80.0060.01219.39
7.4.70.0080.00816.58
7.4.60.0130.00516.50
7.4.50.0080.00716.46
7.4.40.0110.00616.39
7.4.30.0140.00616.46
7.4.00.0070.00715.02
7.3.330.0020.00213.19
7.3.320.0000.00613.08
7.3.310.0040.00416.36
7.3.300.0040.00316.32
7.3.290.0110.00816.27
7.3.280.0080.00816.30
7.3.270.0150.00317.40
7.3.260.0090.01316.46
7.3.250.0140.00616.40
7.3.240.0080.00916.56
7.3.230.0110.00816.57
7.3.210.0180.00016.64
7.3.200.0080.00819.39
7.3.190.0160.00016.21
7.3.180.0130.00316.44
7.3.170.0100.01216.49
7.3.160.0130.00316.38
7.3.10.0100.00316.88
7.3.00.0090.00316.64
7.2.330.0120.00416.40
7.2.320.0060.01216.73
7.2.310.0100.00716.92
7.2.300.0060.01316.79
7.2.290.0120.00316.94
7.2.130.0040.01117.06
7.2.120.0090.00317.05
7.2.110.0070.00716.90
7.2.100.0070.00317.14
7.2.90.0070.00716.88
7.2.80.0080.00417.11
7.2.70.0030.01017.13
7.2.60.0050.01116.72
7.2.50.0070.00717.05
7.2.40.0000.01317.15
7.2.30.0040.00817.13
7.2.20.0040.00716.92
7.2.10.0040.01116.95
7.2.00.0050.00918.14
7.1.250.0040.00415.63
7.1.200.0310.00415.25
7.1.100.0080.00418.31
7.1.70.0040.00416.87
7.1.60.0110.01419.40
7.1.50.0100.01016.96
7.1.00.0000.07322.31
7.0.200.0370.00714.72
7.0.60.0100.04021.83
7.0.50.0100.05317.89
7.0.40.0070.04320.11
7.0.30.0400.06720.11
7.0.20.0300.06320.21
7.0.10.0070.06720.33
7.0.00.0100.08320.19
5.6.280.0030.07021.10
5.6.210.0070.07320.54
5.6.200.0070.04018.16
5.6.190.0000.05020.61
5.6.180.0400.07320.62
5.6.170.0070.08320.52
5.6.160.0270.06020.54
5.6.150.0070.04018.18
5.6.140.0030.08018.14
5.6.130.0170.07018.18
5.6.120.0130.05720.98
5.6.110.0070.07721.16
5.6.100.0170.06721.00
5.6.90.0100.06321.11
5.6.80.0070.08020.53
5.5.350.0200.07020.50
5.5.340.0130.06317.94
5.5.330.0000.04720.41
5.5.320.0570.05720.25
5.5.310.0270.06320.42
5.5.300.0070.05318.09
5.5.290.0030.06318.08
5.5.280.0030.04720.86
5.5.270.0000.04320.65
5.5.260.0070.05720.65
5.5.250.0230.06720.58
5.5.240.0230.07320.05

preferences:
57.21 ms | 401 KiB | 5 Q