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); 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.40.0170.00319.02
8.3.30.0090.00620.20
8.3.20.0050.00320.20
8.3.10.0040.00421.04
8.3.00.0060.00322.18
8.2.170.0060.00822.96
8.2.160.0070.01320.52
8.2.150.0070.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0080.01220.79
8.2.110.0040.00422.30
8.2.100.0090.00319.57
8.2.90.0000.00719.29
8.2.80.0040.00417.97
8.2.70.0000.00917.75
8.2.60.0000.00717.93
8.2.50.0080.00018.07
8.2.40.0000.00918.20
8.2.30.0040.00419.45
8.2.20.0040.00417.70
8.2.10.0000.00817.63
8.2.00.0000.00817.63
8.1.270.0000.00823.99
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00620.67
8.1.230.0040.00820.88
8.1.220.0040.00418.77
8.1.210.0030.00519.02
8.1.200.0030.00617.47
8.1.190.0060.00317.53
8.1.180.0040.00418.10
8.1.170.0030.00618.34
8.1.160.0040.00418.78
8.1.150.0060.00318.70
8.1.140.0040.00417.48
8.1.130.0030.00317.83
8.1.120.0000.00817.43
8.1.110.0040.00417.39
8.1.100.0050.00317.45
8.1.90.0000.00717.43
8.1.80.0000.00717.43
8.1.70.0000.00717.41
8.1.60.0040.00417.59
8.1.50.0040.00417.41
8.1.40.0040.00417.38
8.1.30.0000.00817.69
8.1.20.0000.00817.59
8.1.10.0000.00717.46
8.1.00.0050.00217.56
8.0.300.0070.00019.96
8.0.290.0000.00717.18
8.0.280.0030.00318.44
8.0.270.0000.00717.25
8.0.260.0000.00716.73
8.0.250.0060.00316.97
8.0.240.0000.00816.96
8.0.230.0030.00316.76
8.0.220.0050.00216.70
8.0.210.0000.00716.83
8.0.200.0060.00016.96
8.0.190.0000.00816.99
8.0.180.0000.00716.78
8.0.170.0080.00016.84
8.0.160.0000.00716.73
8.0.150.0040.00416.79
8.0.140.0080.00416.77
8.0.130.0030.00313.32
8.0.120.0040.00416.74
8.0.110.0050.00216.89
8.0.100.0000.00716.87
8.0.90.0080.00016.89
8.0.80.0100.00916.82
8.0.70.0000.00716.84
8.0.60.0050.00216.75
8.0.50.0040.00416.72
8.0.30.0110.00716.96
8.0.20.0050.01317.40
8.0.10.0040.00417.08
8.0.00.0080.01016.81
7.4.330.0020.00216.79
7.4.320.0000.00616.36
7.4.300.0000.00616.48
7.4.290.0030.00316.57
7.4.280.0030.00316.34
7.4.270.0040.00416.51
7.4.260.0060.00013.28
7.4.250.0070.00016.49
7.4.240.0000.00816.49
7.4.230.0020.00516.63
7.4.220.0120.00616.66
7.4.210.0050.01016.52
7.4.200.0000.00716.43
7.4.190.0000.00816.39
7.4.160.0120.00616.47
7.4.150.0150.00617.40
7.4.140.0090.01217.86
7.4.130.0100.00716.54
7.4.120.0100.00716.50
7.4.110.0100.00616.41
7.4.100.0110.01416.58
7.4.90.0050.01416.53
7.4.80.0030.01519.39
7.4.70.0060.00916.30
7.4.60.0100.00616.67
7.4.50.0030.00616.51
7.4.40.0040.01122.77
7.4.30.0150.00616.43
7.4.00.0100.00314.81
7.3.330.0030.00313.34
7.3.320.0020.00213.31
7.3.310.0030.00316.26
7.3.300.0040.00416.31
7.3.290.0070.00716.38
7.3.280.0060.01216.34
7.3.270.0120.00417.40
7.3.260.0130.00818.24
7.3.250.0110.00916.46
7.3.240.0160.00016.59
7.3.230.0070.01016.39
7.3.210.0100.00716.62
7.3.200.0130.00419.39
7.3.190.0110.01116.50
7.3.180.0130.00616.29
7.3.170.0120.00316.60
7.3.160.0090.00616.33
7.3.120.0090.00614.93
7.2.330.0070.01016.88
7.2.320.0090.00916.62
7.2.310.0090.00916.52
7.2.300.0130.00316.48
7.2.290.0130.00716.53
7.2.120.0070.00716.81
7.2.110.0120.00016.79
7.2.100.0070.00416.66
7.2.90.0080.00516.69
7.2.80.0000.01416.51
7.2.70.0070.01017.00
7.2.60.0020.00917.05
7.2.50.0030.01317.04
7.2.40.0070.00716.90
7.2.30.0070.01016.91
7.2.20.0040.01116.76
7.2.10.0030.00717.02
7.2.00.0070.00518.23
7.1.240.0140.00015.77
7.1.230.0120.00315.88
7.1.220.0060.00315.91
7.1.210.0070.00715.96
7.1.200.0080.00615.89
7.1.190.0060.00915.89
7.1.180.0040.01215.76
7.1.170.0050.00515.94
7.1.160.0030.00915.91
7.1.150.0100.00616.03
7.1.140.0040.00715.90
7.1.130.0000.01415.86
7.1.120.0080.00415.63
7.1.110.0000.00915.82
7.1.100.0080.00817.10
7.1.90.0070.00415.56
7.1.80.0110.00415.61
7.1.70.0040.00516.60
7.1.60.0080.01017.47
7.1.50.0100.00616.29
7.1.40.0000.01215.56
7.1.30.0000.01515.50
7.1.20.0000.01415.86
7.1.10.0040.00715.78
7.1.00.0060.02119.06
7.0.320.0030.00615.39
7.0.310.0100.00315.17
7.0.300.0060.00915.09
7.0.290.0000.01315.44
7.0.280.0060.00615.11
7.0.270.0030.01015.19
7.0.260.0090.00615.25
7.0.250.0030.01015.28
7.0.240.0060.00315.58
7.0.230.0060.00615.53
7.0.220.0090.00315.24
7.0.210.0030.00915.37
7.0.200.0020.01015.26
7.0.190.0030.00715.35
7.0.180.0090.00615.30
7.0.170.0060.00615.13
7.0.160.0060.00615.21
7.0.150.0090.00315.51
7.0.140.0070.03718.66
7.0.130.0000.01415.45
7.0.120.0040.00815.55
7.0.110.0040.00815.27
7.0.100.0050.03117.66
7.0.90.0080.04217.64
7.0.80.0300.04017.71
7.0.70.0070.04217.63
7.0.60.0050.03517.70
7.0.50.0220.05017.89
7.0.40.0110.03216.90
7.0.30.0100.04016.83
7.0.20.0060.02816.87
7.0.10.0170.02816.87
7.0.00.0030.04816.73
5.6.380.0040.00414.74
5.6.370.0060.00914.25
5.6.360.0030.00714.57
5.6.350.0060.00614.10
5.6.340.0060.00614.50
5.6.330.0090.00314.53
5.6.320.0060.00614.13
5.6.310.0000.01214.23
5.6.300.0090.00314.54
5.6.290.0030.01314.46
5.6.280.0050.03717.74
5.6.270.0000.00814.36
5.6.260.0040.01114.60
5.6.250.0070.03517.70
5.6.240.0070.03717.71
5.6.230.0080.03517.51
5.6.220.0030.05117.54
5.6.210.0100.04317.52
5.6.200.0050.04517.65
5.6.190.0100.03317.61
5.6.180.0070.03017.90
5.6.170.0110.04017.60
5.6.160.0080.04317.83
5.6.150.0080.04617.74
5.6.140.0080.04117.72
5.6.130.0120.04017.72
5.6.120.0120.03317.71
5.6.110.0000.04317.63
5.6.100.0120.04217.66
5.6.90.0120.04217.57
5.6.80.0090.03717.56
5.6.70.0090.02417.42
5.6.60.0040.04417.37
5.6.50.0100.04117.35
5.6.40.0070.03917.43
5.6.30.0070.04117.51
5.6.20.0060.04117.39
5.6.10.0070.03917.41
5.6.00.0070.04717.45
5.5.380.0090.04115.86
5.5.370.0030.02515.91
5.5.360.0060.04415.92
5.5.350.0080.04515.90
5.5.340.0050.04416.10
5.5.330.0050.03415.96
5.5.320.0070.03816.10
5.5.310.0100.04216.11
5.5.300.0080.04516.07
5.5.290.0100.03816.10
5.5.280.0080.02316.15
5.5.270.0020.03416.15
5.5.260.0120.04015.99
5.5.250.0030.03516.04
5.5.240.0050.03415.70
5.5.230.0030.04515.77
5.5.220.0080.03715.72
5.5.210.0080.03815.78
5.5.200.0060.03915.74
5.5.190.0100.03815.76
5.5.180.0030.03415.73
5.5.170.0120.00314.63
5.5.160.0090.03915.77
5.5.150.0070.04015.83
5.5.140.0070.04015.78
5.5.130.0050.03615.68
5.5.120.0080.03715.81
5.5.110.0070.03915.75
5.5.100.0070.03715.68
5.5.90.0110.03615.72
5.5.80.0030.04115.63
5.5.70.0050.03815.67
5.5.60.0070.03715.79
5.5.50.0070.04215.71
5.5.40.0080.03815.68
5.5.30.0090.04115.80
5.5.20.0080.04215.60
5.5.10.0090.04115.72
5.5.00.0050.04415.65
5.4.450.0070.04515.34
5.4.440.0110.03815.31
5.4.430.0080.03915.37
5.4.420.0050.03715.36
5.4.410.0070.04015.35
5.4.400.0070.03215.23
5.4.390.0050.04415.16
5.4.380.0050.03515.25
5.4.370.0060.04115.26
5.4.360.0090.03515.20
5.4.350.0080.03815.24
5.4.340.0080.03515.09
5.4.330.0030.00711.27
5.4.320.0080.03715.06
5.4.310.0070.04015.09
5.4.300.0030.04315.19
5.4.290.0080.04115.07
5.4.280.0050.04015.27
5.4.270.0080.03915.16
5.4.260.0050.02615.22
5.4.250.0100.03615.05
5.4.240.0080.03815.20
5.4.230.0030.04315.15
5.4.220.0050.02915.16
5.4.210.0020.04215.22
5.4.200.0080.04115.28
5.4.190.0020.02715.25
5.4.180.0090.03815.08
5.4.170.0070.02015.22
5.4.160.0030.03115.14
5.4.150.0080.03915.14
5.4.140.0090.03313.80
5.4.130.0030.02813.88
5.4.120.0020.02713.84
5.4.110.0080.03713.89
5.4.100.0110.03213.81
5.4.90.0080.03513.80
5.4.80.0070.03313.86
5.4.70.0110.03613.89
5.4.60.0080.03713.87
5.4.50.0050.04213.81
5.4.40.0050.03813.88
5.4.30.0080.03413.76
5.4.20.0060.02113.90
5.4.10.0000.04013.83
5.4.00.0050.04013.54
5.3.290.0050.03913.03
5.3.280.0050.04012.91
5.3.270.0080.02512.91
5.3.260.0070.04112.96
5.3.250.0050.02012.90
5.3.240.0050.03012.94
5.3.230.0030.02212.92
5.3.220.0080.03712.92
5.3.210.0050.03412.94
5.3.200.0100.03512.94
5.3.190.0050.03012.92
5.3.180.0050.02412.99
5.3.170.0050.03912.93
5.3.160.0030.02612.93
5.3.150.0060.03512.93
5.3.140.0070.03312.90
5.3.130.0070.04512.96
5.3.120.0090.03712.90
5.3.110.0030.02612.93
5.3.100.0110.03412.64
5.3.90.0070.03512.67
5.3.80.0020.03712.65
5.3.70.0060.02812.59
5.3.60.0020.04312.67
5.3.50.0030.04212.66
5.3.40.0030.03912.65
5.3.30.0040.04112.62
5.3.20.0030.03512.49
5.3.10.0070.03512.46
5.3.00.0050.02512.51
5.2.170.0020.03511.78
5.2.160.0050.03511.78
5.2.150.0070.03011.78
5.2.140.0030.03111.78
5.2.130.0030.02611.78
5.2.120.0100.03011.78
5.2.110.0020.02911.78
5.2.100.0020.03411.78
5.2.90.0050.01611.78
5.2.80.0020.01711.78
5.2.70.0020.02411.78
5.2.60.0090.02711.78
5.2.50.0090.02711.78
5.2.40.0060.02511.78
5.2.30.0070.02711.78
5.2.20.0050.02111.78
5.2.10.0030.02911.78
5.2.00.0020.03211.78
5.1.60.0050.01511.78
5.1.50.0030.02111.78
5.1.40.0040.02711.78
5.1.30.0030.03111.78
5.1.20.0000.03411.78
5.1.10.0000.03211.78
5.1.00.0070.01311.78
5.0.50.0050.02211.78
5.0.40.0000.01411.78
5.0.30.0030.03211.78
5.0.20.0020.02311.78
5.0.10.0020.01511.78
5.0.00.0000.03811.78
4.4.90.0010.02111.78
4.4.80.0050.01511.78
4.4.70.0030.01011.78
4.4.60.0020.01811.78
4.4.50.0020.02211.78
4.4.40.0020.02711.78
4.4.30.0030.02011.78
4.4.20.0020.02011.78
4.4.10.0030.01011.78
4.4.00.0030.02511.78
4.3.110.0040.01711.78
4.3.100.0050.01011.78
4.3.90.0000.01311.78
4.3.80.0030.02511.78
4.3.70.0030.01811.78
4.3.60.0030.02011.78
4.3.50.0070.01311.78
4.3.40.0050.02311.78
4.3.30.0000.01011.78
4.3.20.0030.01811.78
4.3.10.0030.01811.78
4.3.00.0000.02211.78

preferences:
45.33 ms | 400 KiB | 5 Q