3v4l.org

run code in 300+ PHP versions simultaneously
<?php // objects, closures, stdClass, clone $closures = array(); $simple_closure = function() { return $this->msg;}; for ($x=0; $x < 2; $x++) { $closures[$x] = $simple_closure; } $obj1 = new stdClass; $obj1->msg = "Top of the morning\n"; $obj1->getEveningMessage = function () { return "Some enchanted and lovely summer evening ...\n"; }; $obj2 = clone($obj1); $obj2->msg = "Happy Days!\n"; $c1 = Closure::bind($closures[0], $obj1); $c2 = Closure::bind($closures[1], $obj2); echo $c1(); echo $c2(); echo call_user_func($obj1->getEveningMessage); echo $obj2->getEveningMessage->__invoke();

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.0090.00918.43
8.3.50.0120.00621.20
8.3.40.0120.00319.02
8.3.30.0100.00320.02
8.3.20.0040.00420.16
8.3.10.0060.00321.11
8.3.00.0070.00022.47
8.2.180.0130.00716.63
8.2.170.0110.00322.96
8.2.160.0070.00720.53
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0070.00720.82
8.2.110.0060.00322.20
8.2.100.0040.00817.91
8.2.90.0080.00019.05
8.2.80.0030.00617.97
8.2.70.0000.00817.63
8.2.60.0040.00418.05
8.2.50.0050.00518.07
8.2.40.0000.00818.15
8.2.30.0000.00719.35
8.2.20.0080.00017.64
8.2.10.0070.00017.67
8.2.00.0040.00417.75
8.1.280.0180.00425.92
8.1.270.0050.00323.99
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.60
8.1.230.0110.00021.02
8.1.220.0030.00617.88
8.1.210.0040.00418.77
8.1.200.0000.01017.35
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0000.00818.49
8.1.160.0000.00718.95
8.1.150.0040.00418.49
8.1.140.0070.00017.38
8.1.130.0030.00317.96
8.1.120.0000.00717.53
8.1.110.0040.00417.46
8.1.100.0040.00417.36
8.1.90.0040.00417.39
8.1.80.0000.00717.41
8.1.70.0070.00017.46
8.1.60.0030.00617.59
8.1.50.0000.00817.43
8.1.40.0050.00217.50
8.1.30.0000.00817.62
8.1.20.0000.00817.72
8.1.10.0000.00717.63
8.1.00.0020.00517.56
8.0.300.0060.00318.77
8.0.290.0000.00716.75
8.0.280.0030.00318.43
8.0.270.0030.00317.27
8.0.260.0000.00716.82
8.0.250.0030.00616.88
8.0.240.0030.00516.96
8.0.230.0070.00016.89
8.0.220.0070.00016.82
8.0.210.0000.00816.74
8.0.200.0000.00616.99
8.0.190.0030.00516.93
8.0.180.0000.00816.80
8.0.170.0000.00716.94
8.0.160.0070.00016.77
8.0.150.0040.00416.90
8.0.140.0060.00316.85
8.0.130.0030.00313.43
8.0.120.0080.00016.88
8.0.110.0080.00016.80
8.0.100.0000.00816.93
8.0.90.0030.00516.89
8.0.80.0100.00616.95
8.0.70.0030.00316.69
8.0.60.0050.00317.01
8.0.50.0040.00416.93
8.0.30.0110.01117.12
8.0.20.0130.01117.40
8.0.10.0040.00417.13
8.0.00.0090.00916.84
7.4.330.0050.00016.74
7.4.320.0070.00016.49
7.4.300.0060.00016.52
7.4.290.0000.00716.40
7.4.280.0030.00316.57
7.4.270.0030.00316.50
7.4.260.0050.00013.29
7.4.250.0040.00416.46
7.4.240.0030.00316.60
7.4.230.0000.00716.61
7.4.220.0090.01616.61
7.4.210.0090.00716.58
7.4.200.0040.00416.60
7.4.190.0050.00216.36
7.4.160.0120.00416.45
7.4.150.0060.01217.40
7.4.140.0090.00917.86
7.4.130.0050.01116.52
7.4.120.0060.00916.48
7.4.110.0150.00016.41
7.4.100.0030.01616.47
7.4.90.0090.00916.52
7.4.80.0030.01319.39
7.4.70.0100.00716.48
7.4.60.0070.01116.47
7.4.50.0000.00816.55
7.4.40.0100.00322.77
7.4.30.0060.01016.54
7.4.00.0030.01015.16
7.3.330.0020.00213.29
7.3.320.0020.00213.14
7.3.310.0000.00816.34
7.3.300.0000.00816.37
7.3.290.0140.00316.34
7.3.280.0070.00916.36
7.3.270.0030.01317.40
7.3.260.0120.01018.24
7.3.250.0090.01416.49
7.3.240.0150.00616.38
7.3.230.0140.00316.63
7.3.210.0100.00616.58
7.3.200.0190.00419.39
7.3.190.0110.01016.54
7.3.180.0140.00416.61
7.3.170.0120.00816.38
7.3.160.0090.00616.25
7.3.120.0080.00814.58
7.3.10.0070.00816.54
7.3.00.0060.00916.50
7.2.330.0070.01016.52
7.2.320.0100.00716.83
7.2.310.0110.01116.52
7.2.300.0060.00916.82
7.2.290.0030.01616.92
7.2.130.0110.00516.96
7.2.120.0090.00916.72
7.2.110.0080.00916.72
7.2.100.0080.00716.88
7.2.90.0070.00816.66
7.2.80.0090.00516.86
7.2.70.0080.00716.81
7.2.60.0060.01116.89
7.2.50.0110.00816.97
7.2.40.0060.00916.74
7.2.30.0100.00616.86
7.2.20.0050.00816.82
7.2.10.0050.00916.67
7.2.00.0110.00617.41
7.1.250.0080.00415.68
7.1.100.0040.01118.18
7.1.70.0070.00316.95
7.1.60.0110.01419.17
7.1.50.0130.01016.77
7.1.00.0100.03322.27
7.0.200.0150.00316.74
7.0.140.0030.07022.09
7.0.100.0170.05319.99
7.0.90.0100.04719.93
7.0.80.0170.05319.95
7.0.70.0100.06020.04
7.0.60.0100.04019.89
7.0.50.0130.04020.38
7.0.40.0030.04720.11
7.0.30.0170.06320.15
7.0.20.0070.04020.04
7.0.10.0030.04320.03
7.0.00.0030.05019.95
5.6.280.0000.07721.07
5.6.250.0030.04020.67
5.6.240.0000.06720.52
5.6.230.0100.06720.67
5.6.220.0030.05020.53
5.6.210.0030.04020.78
5.6.200.0030.04321.06
5.6.190.0070.06721.05
5.6.180.0030.06321.03
5.6.170.0030.04321.01
5.6.160.0070.04021.04
5.6.150.0030.04020.93
5.6.140.0100.06721.03
5.6.130.0030.04321.14
5.6.120.0130.07021.18
5.6.110.0100.08321.06
5.6.100.0030.09020.93
5.6.90.0070.06021.13
5.6.80.0070.07320.48
5.6.70.0000.08320.33
5.6.60.0170.07020.48
5.6.50.0130.07020.41
5.6.40.0030.09320.50
5.6.30.0170.07320.47
5.6.20.0070.08020.28
5.6.10.0170.07020.38
5.6.00.0130.06020.29
5.5.380.0000.05020.43
5.5.370.0100.05720.36
5.5.360.0000.04320.36
5.5.350.0100.03720.39
5.5.340.0030.04020.91
5.5.330.0130.05320.77
5.5.320.0100.04020.64
5.5.310.0030.05720.93
5.5.300.0100.03320.79
5.5.290.0030.09020.75
5.5.280.0100.07020.87
5.5.270.0100.08020.89
5.5.260.0100.07320.88
5.5.250.0070.07320.71
5.5.240.0030.08320.29
5.5.230.0130.07720.15
5.5.220.0130.07720.12
5.5.210.0070.08020.18
5.5.200.0270.05320.16
5.5.190.0070.07320.19
5.5.180.0170.07320.25
5.5.160.0170.06020.25
5.5.150.0030.08020.09
5.5.140.0030.08320.27
5.5.130.0130.07720.18
5.5.120.0070.03720.21
5.5.110.0130.07320.12
5.5.100.0070.08320.09
5.5.90.0070.07720.16
5.5.80.0100.07720.18
5.5.70.0170.07020.10
5.5.60.0130.06720.03
5.5.50.0130.07020.04
5.5.40.0130.04020.07
5.5.30.0030.06320.07
5.5.20.0170.06720.14
5.5.10.0100.07319.96
5.5.00.0070.08319.96
5.4.450.0070.06719.21
5.4.440.0070.05719.18
5.4.430.0100.08019.22
5.4.420.0030.08319.46
5.4.410.0070.07719.07
5.4.400.0100.06719.14
5.4.390.0030.08319.18
5.4.380.0070.07319.21
5.4.370.0030.08019.13
5.4.360.0100.07719.04
5.4.350.0030.05018.85
5.4.340.0030.08319.16
5.4.320.0030.08319.07
5.4.310.0100.07318.90
5.4.300.0100.06319.16
5.4.290.0030.08019.14
5.4.280.0030.08019.14
5.4.270.0070.07719.13
5.4.260.0130.07019.14
5.4.250.0030.08019.08
5.4.240.0100.07319.13
5.4.230.0170.06319.03
5.4.220.0030.08018.94
5.4.210.0130.06319.18
5.4.200.0030.07018.87
5.4.190.0100.07018.84
5.4.180.0070.06719.22
5.4.170.0070.07319.04
5.4.160.0170.05318.84
5.4.150.0100.07019.14
5.4.140.0100.07016.44
5.4.130.0100.07016.43
5.4.120.0130.06316.44
5.4.110.0000.06016.27
5.4.100.0130.06716.36
5.4.90.0100.06716.34
5.4.80.0070.07316.48
5.4.70.0100.07316.48
5.4.60.0070.07316.34
5.4.50.0130.04716.37
5.4.40.0100.05716.54
5.4.30.0070.06016.36
5.4.20.0030.07316.40
5.4.10.0070.06316.39
5.4.00.0170.05715.87
5.3.290.0070.07014.65
5.3.280.0070.05014.55
5.3.270.0030.07014.64
5.3.260.0070.08014.64
5.3.250.0100.07014.64
5.3.240.0000.07314.67
5.3.230.0100.04714.55
5.3.220.0130.05714.70
5.3.210.0170.06314.71
5.3.200.0030.07714.64
5.3.190.0030.07014.61
5.3.180.0130.07014.69
5.3.170.0070.07014.55
5.3.160.0000.07014.50
5.3.150.0030.07714.71
5.3.140.0070.07714.58
5.3.130.0100.05014.53
5.3.120.0130.07014.49
5.3.110.0100.06314.51
5.3.100.0030.08014.07
5.3.90.0030.08014.09
5.3.80.0030.08014.14
5.3.70.0170.05313.93
5.3.60.0030.07714.07
5.3.50.0170.06713.97
5.3.40.0170.06313.84
5.3.30.0100.07313.90
5.3.20.0070.07013.83
5.3.10.0100.06313.83
5.3.00.0000.07013.83
5.2.170.0000.06713.83
5.2.160.0070.06013.83
5.2.150.0000.05313.83
5.2.140.0030.06713.83
5.2.130.0100.05713.83
5.2.120.0070.06013.83
5.2.110.0030.06313.83
5.2.100.0030.03713.83
5.2.90.0030.06313.83
5.2.80.0100.05713.83
5.2.70.0000.04313.83
5.2.60.0030.06313.83
5.2.50.0070.04713.83
5.2.40.0030.06313.83
5.2.30.0000.06713.83
5.2.20.0030.06313.83
5.2.10.0000.03713.83
5.2.00.0030.06313.83
5.1.60.0070.05313.83
5.1.50.0100.05013.83
5.1.40.0030.05313.83
5.1.30.0030.05013.83
5.1.20.0030.05713.83
5.1.10.0030.06013.83
5.1.00.0070.05313.83
5.0.50.0030.04313.83
5.0.40.0030.04013.83
5.0.30.0070.06013.83
5.0.20.0000.04013.83
5.0.10.0030.04013.83
5.0.00.0030.06013.83
4.4.90.0070.03313.83
4.4.80.0000.03713.83
4.4.70.0000.02013.83
4.4.60.0070.03013.83
4.4.50.0100.02313.83
4.4.40.0000.03313.83
4.4.30.0030.02713.83
4.4.20.0030.03313.83
4.4.10.0070.03313.83
4.4.00.0070.05013.83
4.3.110.0030.02713.83
4.3.100.0030.02313.83
4.3.90.0030.03313.83
4.3.80.0000.05013.83
4.3.70.0030.03313.83
4.3.60.0030.03013.83
4.3.50.0030.03313.83
4.3.40.0030.04313.83
4.3.30.0000.03313.83
4.3.20.0030.03013.83
4.3.10.0000.02713.83
4.3.00.0030.02713.83

preferences:
40.76 ms | 401 KiB | 5 Q