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 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.40.0150.00618.67
8.3.30.0070.00720.20
8.3.20.0000.00720.32
8.3.10.0070.00021.13
8.3.00.0080.00022.58
8.2.170.0070.01022.96
8.2.160.0070.00722.08
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00620.87
8.2.110.0050.00519.09
8.2.100.0090.00317.91
8.2.90.0040.00419.26
8.2.80.0000.00817.97
8.2.70.0060.00617.63
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0080.00018.05
8.2.30.0000.00719.31
8.2.20.0050.00317.78
8.2.10.0000.00817.67
8.2.00.0070.00017.80
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0120.00922.63
8.1.230.0070.00420.90
8.1.220.0040.00418.77
8.1.210.0030.00619.08
8.1.200.0030.00617.25
8.1.190.0000.00917.63
8.1.180.0040.00418.10
8.1.170.0080.00018.27
8.1.160.0040.00418.88
8.1.150.0030.00518.63
8.1.140.0000.00717.50
8.1.130.0040.00417.79
8.1.120.0000.00717.43
8.1.110.0000.00717.37
8.1.100.0040.00417.51
8.1.90.0070.00017.50
8.1.80.0070.00017.41
8.1.70.0030.00317.39
8.1.60.0060.00317.60
8.1.50.0000.00717.42
8.1.40.0070.00017.43
8.1.30.0070.00017.61
8.1.20.0080.00017.67
8.1.10.0050.00317.62
8.1.00.0080.00017.55
8.0.300.0040.00420.03
8.0.290.0070.00017.05
8.0.280.0000.00718.44
8.0.270.0040.00417.32
8.0.260.0040.00416.75
8.0.250.0030.00616.96
8.0.240.0070.00016.88
8.0.230.0030.00316.86
8.0.220.0000.00816.87
8.0.210.0030.00316.80
8.0.200.0030.00316.89
8.0.190.0040.00416.82
8.0.180.0000.00816.93
8.0.170.0060.00316.88
8.0.160.0030.00316.92
8.0.150.0050.00316.79
8.0.140.0030.00916.85
8.0.130.0000.00613.34
8.0.120.0030.00516.88
8.0.110.0030.00516.95
8.0.100.0000.00716.69
8.0.90.0020.00516.76
8.0.80.0090.01216.95
8.0.70.0070.00016.95
8.0.60.0000.00716.79
8.0.50.0040.00416.77
8.0.30.0110.00717.05
8.0.20.0050.01317.40
8.0.10.0040.00417.08
8.0.00.0090.01016.81
7.4.330.0020.00216.66
7.4.320.0030.00316.48
7.4.300.0040.00416.52
7.4.290.0030.00316.45
7.4.280.0070.00016.59
7.4.270.0040.00416.48
7.4.260.0030.00313.29
7.4.250.0000.00716.55
7.4.240.0000.00716.49
7.4.230.0030.00316.58
7.4.220.0160.00316.70
7.4.210.0050.01016.55
7.4.200.0000.00716.45
7.4.190.0030.00316.76
7.4.160.0150.00616.40
7.4.150.0090.01517.40
7.4.140.0080.01417.86
7.4.130.0100.00916.46
7.4.120.0060.01316.50
7.4.110.0090.00916.44
7.4.100.0090.00916.57
7.4.90.0140.00416.49
7.4.80.0150.00919.39
7.4.70.0080.00816.45
7.4.60.0120.00316.47
7.4.50.0000.00816.60
7.4.40.0040.01122.77
7.4.30.0100.00616.37
7.4.00.0080.00415.12
7.3.330.0030.00313.18
7.3.320.0000.00513.13
7.3.310.0000.00616.40
7.3.300.0040.00416.36
7.3.290.0030.01016.41
7.3.280.0080.00816.34
7.3.270.0070.01017.40
7.3.260.0100.01218.24
7.3.250.0090.01216.52
7.3.240.0030.01416.44
7.3.230.0150.00316.45
7.3.210.0160.00316.64
7.3.200.0150.00619.39
7.3.190.0060.01516.59
7.3.180.0160.00316.39
7.3.170.0080.00816.50
7.3.160.0030.01316.50
7.3.120.0000.01214.97
7.2.330.0080.00816.49
7.2.320.0180.00616.70
7.2.310.0100.00716.63
7.2.300.0130.00316.61
7.2.290.0110.00716.57
7.2.110.0110.00616.73
7.2.100.0180.00716.69
7.2.90.0130.00416.50
7.2.80.0130.00616.67
7.2.70.0110.00716.92
7.2.60.0110.00717.08
7.2.50.0330.00716.78
7.2.40.0120.00816.92
7.2.30.0040.01216.87
7.2.20.0120.00817.01
7.2.10.0080.00816.83
7.2.00.0240.00417.01
7.1.230.0120.00815.93
7.1.220.0040.01415.92
7.1.210.0140.00315.64
7.1.200.0410.00515.64
7.1.190.0110.00615.59
7.1.180.0070.00515.70
7.1.170.0110.00415.52
7.1.160.0210.01015.86
7.1.150.0320.00715.82
7.1.140.0150.00315.90
7.1.130.0200.01015.87
7.1.120.0240.00315.51
7.1.110.0110.00715.92
7.1.100.0100.00716.83
7.1.90.0210.00415.57
7.1.80.0220.00415.46
7.1.70.0120.00416.37
7.1.60.0180.00817.46
7.1.50.0190.01216.38
7.1.40.0130.00715.63
7.1.30.0200.00515.82
7.1.20.0070.01015.90
7.1.10.0130.00515.84
7.1.00.0040.02219.17
7.0.310.0180.00015.41
7.0.300.0080.00515.34
7.0.290.0110.00415.56
7.0.280.0120.00315.36
7.0.270.0310.00315.32
7.0.260.0240.00715.16
7.0.250.0050.01015.24
7.0.240.0160.00315.43
7.0.230.0140.00315.46
7.0.220.0090.00615.39
7.0.210.0160.00615.23
7.0.200.0090.00316.11
7.0.190.0190.00515.45
7.0.180.0120.01215.59
7.0.170.0120.00815.60
7.0.160.0210.00315.43
7.0.150.0150.01115.45
7.0.140.0090.03818.83
7.0.130.0420.00015.46
7.0.120.0080.00515.54
7.0.110.0140.00715.48
7.0.100.0110.03917.74
7.0.90.0110.04717.60
7.0.80.0110.03017.66
7.0.70.0250.04017.63
7.0.60.0070.04217.71
7.0.50.0280.04318.03
7.0.40.0170.04216.84
7.0.30.0070.04216.63
7.0.20.0120.04316.80
7.0.10.0090.04416.77
7.0.00.0060.03816.63
5.6.380.0080.00814.48
5.6.370.0050.01014.02
5.6.360.0070.00714.67
5.6.350.0170.00314.73
5.6.340.0040.01114.60
5.6.330.0110.00314.22
5.6.320.0150.00714.57
5.6.310.0120.00714.67
5.6.300.0140.00314.29
5.6.290.0140.00314.44
5.6.280.0120.03817.73
5.6.270.0130.00414.56
5.6.260.0160.00314.86
5.6.250.0180.03517.68
5.6.240.0120.04617.64
5.6.230.0110.04417.51
5.6.220.0080.04517.62
5.6.210.0040.04517.63
5.6.200.0100.04517.65
5.6.190.0090.04117.91
5.6.180.0090.04117.83
5.6.170.0100.04317.65
5.6.160.0080.04617.83
5.6.150.0150.02617.80
5.6.140.0130.04217.78
5.6.130.0140.04217.88
5.6.120.0140.03217.66
5.6.110.0120.03317.75
5.6.100.0130.04017.66
5.6.90.0140.01917.69
5.6.80.0150.02717.58
5.6.70.0110.02517.36
5.6.60.0150.03717.35
5.6.50.0070.03117.44
5.6.40.0050.04417.36
5.6.30.0060.03117.42
5.6.20.0080.03517.43
5.6.10.0050.04917.28
5.6.00.0100.04217.44
5.5.380.0080.02615.80
5.5.370.0090.04315.84
5.5.360.0090.02815.95
5.5.350.0090.03115.79
5.5.340.0050.04416.12
5.5.330.0170.03916.18
5.5.320.0070.04016.04
5.5.310.0090.03416.00
5.5.300.0070.03916.05
5.5.290.0030.04816.14
5.5.280.0120.03416.05
5.5.270.0150.03315.99
5.5.260.0120.03616.06
5.5.250.0070.03116.01
5.5.240.0110.04215.80
5.5.230.0130.03815.66
5.5.220.0060.02715.79
5.5.210.0160.03515.82
5.5.200.0060.04615.59
5.5.190.0110.03815.74
5.5.180.0090.04315.68
5.5.170.0110.00414.20
5.5.160.0100.04315.56
5.5.150.0040.03915.49
5.5.140.0060.04315.58
5.5.130.0120.01815.81
5.5.120.0100.04015.81
5.5.110.0040.04315.84
5.5.100.0030.03015.66
5.5.90.0070.03915.72
5.5.80.0110.02515.79
5.5.70.0040.03715.62
5.5.60.0060.03615.68
5.5.50.0070.03515.66
5.5.40.0080.02515.48
5.5.30.0110.03815.58
5.5.20.0010.04015.48
5.5.10.0060.03515.58
5.5.00.0050.04415.57
5.4.450.0110.03715.37
5.4.440.0100.04015.33
5.4.430.0030.03215.40
5.4.420.0090.03915.25
5.4.410.0100.04215.34
5.4.400.0110.03815.27
5.4.390.0120.03215.06
5.4.380.0050.03415.04
5.4.370.0030.04215.01
5.4.360.0060.04115.19
5.4.350.0050.04214.97
5.4.340.0100.02615.01
5.4.330.0100.00311.21
5.4.320.0110.03515.24
5.4.310.0070.03715.31
5.4.300.0100.03815.18
5.4.290.0150.03715.27
5.4.280.0110.03315.22
5.4.270.0110.01814.99
5.4.260.0090.02714.96
5.4.250.0080.04215.01
5.4.240.0070.04014.97
5.4.230.0080.03815.14
5.4.220.0120.03515.05
5.4.210.0100.03615.07
5.4.200.0090.03515.03
5.4.190.0110.03515.07
5.4.180.0090.03815.14
5.4.170.0030.04514.98
5.4.160.0110.03315.06
5.4.150.0100.04214.89
5.4.140.0080.02613.68
5.4.130.0100.04013.63
5.4.120.0080.03813.76
5.4.110.0080.03613.72
5.4.100.0030.04213.81
5.4.90.0100.02113.82
5.4.80.0070.02513.79
5.4.70.0040.02313.70
5.4.60.0050.03213.90
5.4.50.0090.02113.78
5.4.40.0100.02513.90
5.4.30.0120.03313.77
5.4.20.0040.04213.85
5.4.10.0050.02213.87
5.4.00.0080.03013.48
5.3.290.0070.04412.75
5.3.280.0070.02612.63
5.3.270.0040.04312.60
5.3.260.0070.04012.61
5.3.250.0110.03712.64
5.3.240.0090.03312.61
5.3.230.0050.04012.68
5.3.220.0050.02512.57
5.3.210.0070.02512.55
5.3.200.0040.03712.59
5.3.190.0100.03712.63
5.3.180.0110.03012.57
5.3.170.0060.02612.63
5.3.160.0050.02412.56
5.3.150.0050.04412.58
5.3.140.0040.01812.60
5.3.130.0070.03912.64
5.3.120.0040.02212.69
5.3.110.0120.03812.57
5.3.100.0110.03212.33
5.3.90.0080.01912.45
5.3.80.0070.03812.33
5.3.70.0100.03012.36
5.3.60.0070.01712.36
5.3.50.0080.03012.34
5.3.40.0020.03712.33
5.3.30.0110.02712.30
5.3.20.0080.02212.12
5.3.10.0070.03712.10
5.3.00.0090.03512.12
5.2.170.0070.03011.48
5.2.160.0030.03111.48
5.2.150.0070.02711.48
5.2.140.0070.03311.48
5.2.130.0060.02911.48
5.2.120.0000.02611.48
5.2.110.0050.02311.48
5.2.100.0050.03211.48
5.2.90.0060.01811.48
5.2.80.0020.03611.48
5.2.70.0040.02511.48
5.2.60.0080.02811.48
5.2.50.0110.01911.48
5.2.40.0050.03011.48
5.2.30.0050.03211.48
5.2.20.0070.03211.48
5.2.10.0050.03011.48
5.2.00.0060.03011.48
5.1.60.0010.03111.48
5.1.50.0060.02811.48
5.1.40.0060.02511.48
5.1.30.0050.03311.48
5.1.20.0060.03011.48
5.1.10.0070.01311.48
5.1.00.0080.02711.48
5.0.50.0050.02311.48
5.0.40.0070.02711.48
5.0.30.0050.02311.48
5.0.20.0030.01711.48
5.0.10.0030.01711.48
5.0.00.0000.02611.48
4.4.90.0010.02111.48
4.4.80.0070.01511.48
4.4.70.0040.00811.48
4.4.60.0030.02011.48
4.4.50.0020.01311.48
4.4.40.0020.02211.48
4.4.30.0000.02111.48
4.4.20.0030.01311.48
4.4.10.0060.01811.48
4.4.00.0050.02211.48
4.3.110.0020.02111.48
4.3.100.0050.01511.48
4.3.90.0010.01111.48
4.3.80.0040.01311.48
4.3.70.0040.01511.48
4.3.60.0020.01411.48
4.3.50.0030.02011.48
4.3.40.0050.01811.48
4.3.30.0010.01811.48
4.3.20.0030.01611.48
4.3.10.0010.02011.48
4.3.00.0020.01311.48

preferences:
33.43 ms | 400 KiB | 5 Q