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 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); $n = $obj2->getEveningMessage; echo $n();

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.0030.01218.56
8.3.50.0140.00721.14
8.3.40.0070.00718.87
8.3.30.0070.00720.17
8.3.20.0000.00820.30
8.3.10.0000.00721.21
8.3.00.0040.00422.43
8.2.180.0170.00016.63
8.2.170.0070.00722.96
8.2.160.0110.00422.13
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0090.00920.88
8.2.110.0060.00319.21
8.2.100.0080.00417.91
8.2.90.0050.00319.17
8.2.80.0040.00419.33
8.2.70.0030.00717.50
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0060.00318.15
8.2.30.0040.00419.32
8.2.20.0040.00417.77
8.2.10.0000.00817.80
8.2.00.0030.00517.67
8.1.280.0110.00725.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.01022.64
8.1.230.0070.00721.03
8.1.220.0050.00318.77
8.1.210.0080.00018.89
8.1.200.0030.00617.35
8.1.190.0000.00817.54
8.1.180.0000.00818.10
8.1.170.0050.00318.65
8.1.160.0050.00318.89
8.1.150.0030.00618.70
8.1.140.0070.00017.39
8.1.130.0070.00017.76
8.1.120.0000.00717.48
8.1.110.0050.00517.45
8.1.100.0040.00417.36
8.1.90.0040.00417.41
8.1.80.0000.00717.37
8.1.70.0030.00317.48
8.1.60.0000.00717.57
8.1.50.0000.00817.52
8.1.40.0000.00817.50
8.1.30.0070.00017.66
8.1.20.0000.00817.65
8.1.10.0030.00617.48
8.1.00.0040.00417.44
8.0.300.0040.00419.88
8.0.290.0000.00817.05
8.0.280.0030.00318.35
8.0.270.0070.00017.26
8.0.260.0080.00016.83
8.0.250.0050.00216.89
8.0.240.0000.00916.94
8.0.230.0040.00416.77
8.0.220.0000.00716.84
8.0.210.0030.00316.72
8.0.200.0030.00316.92
8.0.190.0040.00416.87
8.0.180.0000.00716.95
8.0.170.0050.00316.84
8.0.160.0000.00716.93
8.0.150.0000.00716.86
8.0.140.0000.01316.84
8.0.130.0000.00613.25
8.0.120.0050.00316.85
8.0.110.0080.00016.88
8.0.100.0050.00316.72
8.0.90.0040.00416.81
8.0.80.0100.00716.80
8.0.70.0030.00516.87
8.0.60.0040.00416.80
8.0.50.0050.00216.88
8.0.30.0090.00917.02
8.0.20.0100.00817.40
8.0.10.0000.00716.83
8.0.00.0080.01016.84
7.4.330.0000.00516.89
7.4.320.0040.00416.48
7.4.300.0030.00316.56
7.4.290.0070.00016.54
7.4.280.0030.00316.64
7.4.270.0000.00716.64
7.4.260.0000.00613.21
7.4.250.0000.00816.40
7.4.240.0040.00416.62
7.4.230.0000.00816.50
7.4.220.0120.01216.52
7.4.210.0080.00716.51
7.4.200.0030.00316.60
7.4.190.0030.00316.73
7.4.160.0070.01016.51
7.4.150.0120.01217.40
7.4.140.0070.01417.86
7.4.130.0100.00716.50
7.4.120.0080.00816.58
7.4.110.0090.01016.39
7.4.100.0080.01216.59
7.4.90.0110.01116.46
7.4.80.0060.01219.39
7.4.70.0130.00316.61
7.4.60.0130.00316.62
7.4.50.0030.00616.23
7.4.40.0060.00922.77
7.4.30.0040.01316.52
7.4.00.0030.01214.90
7.3.330.0030.00313.19
7.3.320.0020.00213.31
7.3.310.0000.00816.39
7.3.300.0000.00816.24
7.3.290.0060.00916.36
7.3.280.0100.00916.34
7.3.270.0060.01217.40
7.3.260.0120.00718.24
7.3.250.0090.01116.37
7.3.240.0110.00716.42
7.3.230.0070.01016.39
7.3.210.0090.00916.68
7.3.200.0070.01419.39
7.3.190.0150.00316.64
7.3.180.0120.00416.51
7.3.170.0100.01016.34
7.3.160.0050.01316.58
7.3.120.0110.00414.90
7.3.10.0030.01016.68
7.3.00.0040.00816.43
7.2.330.0150.00316.87
7.2.320.0120.00916.64
7.2.310.0120.00616.84
7.2.300.0100.00716.57
7.2.290.0090.00916.46
7.2.130.0070.00716.98
7.2.120.0100.00516.94
7.2.110.0030.01016.93
7.2.100.0030.01016.96
7.2.90.0060.00916.89
7.2.80.0110.00816.90
7.2.70.0110.00817.17
7.2.60.0060.00816.86
7.2.50.0100.00316.94
7.2.40.0120.00416.90
7.2.30.0030.01117.12
7.2.20.0080.00316.71
7.2.10.0130.00617.06
7.2.00.0030.01018.15
7.1.250.0060.00615.82
7.1.200.0030.00715.68
7.1.100.0220.00817.86
7.1.70.0040.00417.02
7.1.60.0100.01419.17
7.1.50.0070.01317.00
7.1.00.0030.03322.31
7.0.200.0240.01014.97
7.0.140.0030.07322.09
7.0.60.0130.07721.80
7.0.50.0100.08017.89
7.0.40.0070.08720.14
7.0.30.0270.08020.34
7.0.20.0300.05720.15
7.0.10.0270.03320.20
7.0.00.0070.05020.29
5.6.280.0000.07721.10
5.6.210.0070.08020.52
5.6.200.0030.05318.18
5.6.190.0100.04720.57
5.6.180.0400.06720.77
5.6.170.0200.08320.61
5.6.160.0000.06320.58
5.6.150.0070.08018.16
5.6.140.0130.04318.11
5.6.130.0030.08718.23
5.6.120.0100.08321.02
5.6.110.0100.06721.05
5.6.100.0070.09021.09
5.6.90.0200.05321.14
5.6.80.0000.06720.39
5.5.350.0270.07020.50
5.5.340.0100.07018.07
5.5.330.0100.08020.42
5.5.320.3330.03720.34
5.5.310.0400.06320.27
5.5.300.0100.03017.93
5.5.290.0100.05317.95
5.5.280.0030.08720.91
5.5.270.0230.07320.90
5.5.260.0070.08320.80
5.5.250.0130.07720.59
5.5.240.0370.07320.27
5.4.450.0300.07019.39
5.4.440.0300.07719.40
5.4.430.0300.07319.42
5.4.420.0400.06719.30
5.4.410.0270.07719.26
5.4.400.0230.04719.32
5.4.390.0270.03319.07
5.4.380.0300.05019.31
5.4.370.0300.05019.31
5.4.360.0270.06019.08
5.4.350.0430.06019.19
5.4.340.0330.06719.16
5.4.320.0400.06019.20
5.4.310.0270.06719.00
5.4.300.0270.04019.13
5.4.290.0330.06018.99
5.4.280.0230.06018.87
5.4.270.0400.06019.13
5.4.260.0330.07019.22
5.4.250.0300.05718.98
5.4.240.0270.03719.31
5.4.230.0270.04018.86
5.4.220.0300.05718.97
5.4.210.0330.06019.15
5.4.200.0270.04318.86
5.4.190.0300.07019.21
5.4.180.0230.05719.30
5.4.170.0400.06019.15
5.4.160.0270.04018.86
5.4.150.0300.05019.12
5.4.140.0270.04016.33
5.4.130.0300.05716.32
5.4.120.0300.06716.31
5.4.110.0200.07016.56
5.4.100.0230.04016.56
5.4.90.0370.04716.55
5.4.80.0330.06316.43
5.4.70.0330.04316.44
5.4.60.0300.07016.23
5.4.50.0330.05316.52
5.4.40.0270.04016.25
5.4.30.0230.07316.48
5.4.20.0370.05716.39
5.4.10.0300.07016.48
5.4.00.0200.04015.87
5.3.290.0430.05714.66
5.3.280.0330.07314.64
5.3.270.0230.06314.52
5.3.260.0330.06714.60
5.3.250.0270.04714.61
5.3.240.0270.05314.63
5.3.230.0270.04714.53
5.3.220.0300.05014.55
5.3.210.0300.05314.69
5.3.200.0270.05714.48
5.3.190.0270.07714.58
5.3.180.0300.07314.79
5.3.170.0370.06314.47
5.3.160.0330.05314.46
5.3.150.0200.04314.64
5.3.140.0330.06314.55
5.3.130.0270.06714.59
5.3.120.0330.04014.77
5.3.110.0330.07014.66
5.3.100.0230.04014.03
5.3.90.0400.04314.10
5.3.80.0270.04314.00
5.3.70.0230.04713.94
5.3.60.0400.05713.91
5.3.50.0230.06314.04
5.3.40.0330.05714.03
5.3.30.0330.05313.86
5.3.20.0470.05013.70
5.3.10.0330.05313.65
5.3.00.0300.04713.69
5.2.170.0170.04012.15
5.2.160.0200.03012.15
5.2.150.0200.04712.15
5.2.140.0330.05012.15
5.2.130.0230.05012.15
5.2.120.0230.05012.15
5.2.110.0230.03712.15
5.2.100.0200.05712.15
5.2.90.0170.03712.15
5.2.80.0200.03012.15
5.2.70.0230.06012.15
5.2.60.0300.03712.15
5.2.50.0230.06012.15
5.2.40.0200.03312.15
5.2.30.0170.03712.15
5.2.20.0170.04012.15
5.2.10.0170.04712.15
5.2.00.0130.04012.15
5.1.60.0200.05012.15
5.1.50.0230.05012.15
5.1.40.0200.04312.15
5.1.30.0170.05312.15
5.1.20.0230.04712.15
5.1.10.0270.04712.15
5.1.00.0270.04012.15
5.0.50.0100.04712.15
5.0.40.0130.02012.15
5.0.30.0200.05312.15
5.0.20.0130.04312.15
5.0.10.0100.04712.15
5.0.00.0130.04012.15
4.4.90.0070.03712.15
4.4.80.0100.02012.15
4.4.70.0100.01712.15
4.4.60.0070.02012.15
4.4.50.0070.03712.15
4.4.40.0100.02312.15
4.4.30.0100.03012.15
4.4.20.0130.03712.15
4.4.10.0200.02712.15
4.4.00.0100.03012.15
4.3.110.0100.03712.15
4.3.100.0100.02312.15
4.3.90.0070.02012.15
4.3.80.0070.04312.15
4.3.70.0100.02312.15
4.3.60.0130.01712.15
4.3.50.0100.02012.15
4.3.40.0100.05312.15
4.3.30.0070.03312.15
4.3.20.0130.03012.15
4.3.10.0000.03012.15
4.3.00.0030.03312.15

preferences:
43.9 ms | 401 KiB | 5 Q