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(); $first = $obj1->getEveningMessage; echo $first(); echo call_user_func($first); echo $first->__invoke(); class Test extends stdClass { public $name = 'Testing'; public function __toString() { return "$this->name"; } } $t = new Test; echo $t;

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.0170.00318.68
8.3.50.0090.01421.27
8.3.40.0060.00919.02
8.3.30.0140.00020.17
8.3.20.0040.00420.33
8.3.10.0040.00421.09
8.3.00.0050.00322.30
8.2.180.0110.00716.38
8.2.170.0090.00622.96
8.2.160.0040.01122.26
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0090.00026.16
8.2.120.0040.00420.75
8.2.110.0130.00620.44
8.2.100.0000.01117.78
8.2.90.0040.00419.23
8.2.80.0080.00017.97
8.2.70.0030.00617.75
8.2.60.0050.00318.05
8.2.50.0050.00318.07
8.2.40.0000.00818.21
8.2.30.0040.00419.44
8.2.20.0030.00517.83
8.2.10.0000.00717.80
8.2.00.0030.00517.67
8.1.280.0140.00325.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00323.97
8.1.230.0060.00620.85
8.1.220.0030.00618.51
8.1.210.0050.00318.77
8.1.200.0000.00917.13
8.1.190.0030.00517.65
8.1.180.0000.00818.10
8.1.170.0080.00018.50
8.1.160.0070.00018.99
8.1.150.0060.00318.71
8.1.140.0000.00817.44
8.1.130.0030.00317.75
8.1.120.0000.00717.49
8.1.110.0070.00317.45
8.1.100.0040.00417.39
8.1.90.0040.00417.53
8.1.80.0040.00417.37
8.1.70.0000.00717.43
8.1.60.0030.00617.57
8.1.50.0030.00617.51
8.1.40.0060.00317.42
8.1.30.0000.00817.59
8.1.20.0000.00917.56
8.1.10.0000.00917.57
8.1.00.0030.00617.54
8.0.300.0000.00719.85
8.0.290.0060.00317.15
8.0.280.0080.00018.47
8.0.270.0030.00317.26
8.0.260.0000.00816.82
8.0.250.0000.01016.88
8.0.240.0040.00416.80
8.0.230.0070.00016.87
8.0.220.0000.00716.94
8.0.210.0000.00716.97
8.0.200.0000.00716.93
8.0.190.0040.00416.93
8.0.180.0050.00216.84
8.0.170.0080.00016.90
8.0.160.0040.00416.96
8.0.150.0000.00716.93
8.0.140.0030.00416.86
8.0.130.0000.00513.33
8.0.120.0070.00016.75
8.0.110.0080.00016.93
8.0.100.0040.00416.89
8.0.90.0040.00416.96
8.0.80.0080.00816.92
8.0.70.0000.00716.80
8.0.60.0040.00416.85
8.0.50.0040.00416.71
8.0.30.0140.00617.14
8.0.20.0080.01117.40
8.0.10.0040.00416.88
8.0.00.0150.01616.87
7.4.330.0000.00516.70
7.4.320.0060.00016.61
7.4.300.0000.00616.62
7.4.290.0000.00616.41
7.4.280.0040.00416.60
7.4.270.0050.00216.51
7.4.260.0030.00313.40
7.4.250.0030.00316.42
7.4.240.0000.00716.52
7.4.230.0030.00316.71
7.4.220.0090.00916.61
7.4.210.0070.00916.58
7.4.200.0000.00716.61
7.4.190.0040.00416.70
7.4.160.0030.01316.38
7.4.150.0100.00717.40
7.4.140.0070.01217.86
7.4.130.0090.00816.60
7.4.120.0120.00616.54
7.4.110.0100.00916.67
7.4.100.0090.01216.53
7.4.90.0150.00416.48
7.4.80.0140.00519.39
7.4.70.0140.00316.52
7.4.60.0140.00316.58
7.4.50.0080.00016.35
7.4.40.0000.01222.77
7.4.30.0080.00816.31
7.4.10.0050.00515.11
7.4.00.0090.00814.97
7.3.330.0050.00013.23
7.3.320.0000.00513.37
7.3.310.0030.00316.47
7.3.300.0070.00016.32
7.3.290.0140.00316.37
7.3.280.0090.00716.39
7.3.270.0030.01317.40
7.3.260.0140.00918.24
7.3.250.0060.01416.47
7.3.240.0090.00916.65
7.3.230.0040.01416.57
7.3.210.0090.00916.38
7.3.200.0150.00319.39
7.3.190.0090.01016.39
7.3.180.0130.00316.36
7.3.170.0090.00816.41
7.3.160.0080.01116.53
7.3.130.0150.00014.86
7.3.120.0060.01215.04
7.3.110.0130.00514.63
7.3.100.0070.00714.70
7.3.90.0090.00914.70
7.3.80.0040.01114.76
7.3.70.0100.00614.91
7.3.60.0070.00714.79
7.3.50.0070.00514.62
7.3.40.0100.00314.80
7.3.30.0030.00614.78
7.3.20.0050.00916.53
7.3.10.0020.01016.51
7.3.00.0080.00716.75
7.2.330.0080.01116.68
7.2.320.0080.00816.78
7.2.310.0110.01216.61
7.2.300.0070.01016.54
7.2.290.0160.00616.79
7.2.260.0000.01315.06
7.2.250.0070.01115.14
7.2.240.0030.01515.17
7.2.230.0060.01114.92
7.2.220.0140.00214.84
7.2.210.0070.01015.11
7.2.200.0070.00615.13
7.2.190.0030.01215.11
7.2.180.0010.01014.92
7.2.170.0040.00714.79
7.2.160.0040.01415.11
7.2.150.0030.01016.66
7.2.140.0040.00716.77
7.2.130.0030.00616.79
7.2.120.0070.00717.07
7.2.110.0040.00817.00
7.2.100.0000.01417.00
7.2.90.0000.00917.08
7.2.80.0040.01417.08
7.2.70.0090.00416.62
7.2.60.0040.00717.14
7.2.50.0060.00916.80
7.2.40.0040.00816.99
7.2.30.0060.01216.90
7.2.20.0060.00917.04
7.2.10.0030.00817.06
7.2.00.0050.00817.97
7.1.330.0090.00415.79
7.1.320.0060.00915.58
7.1.310.0050.00515.82
7.1.300.0090.00315.73
7.1.290.0030.00915.83
7.1.280.0050.00815.88
7.1.270.0090.00515.76
7.1.260.0100.00315.88
7.1.250.0000.01315.85
7.1.240.0040.01115.98
7.1.230.0070.00715.97
7.1.220.0060.00915.86
7.1.210.0070.00715.91
7.1.200.0030.01015.75
7.1.190.0080.00015.54
7.1.180.0030.01015.77
7.1.170.0070.00715.96
7.1.160.0060.00615.78
7.1.150.0060.01215.81
7.1.140.0090.00615.61
7.1.130.0080.00515.90
7.1.120.0090.00615.89
7.1.110.0030.01015.98
7.1.100.0130.00916.57
7.1.90.0040.00415.65
7.1.80.0080.00015.83
7.1.70.0040.00516.51
7.1.60.0090.00917.40
7.1.50.0110.00316.29
7.1.40.0030.01015.86
7.1.30.0030.01015.78
7.1.20.0100.00315.92
7.1.10.0070.00715.79
7.1.00.0020.02319.11
7.0.330.0040.00415.36
7.0.320.0120.00015.47
7.0.310.0060.00915.33
7.0.300.0140.00015.16
7.0.290.0000.01215.22
7.0.280.0000.01315.30
7.0.270.0070.00715.24
7.0.260.0030.00615.52
7.0.250.0030.01015.45
7.0.240.0070.00715.47
7.0.230.0050.00315.45
7.0.220.0070.00715.32
7.0.210.0030.00715.40
7.0.200.0170.00415.00
7.0.190.0070.00315.25
7.0.180.0030.00915.37
7.0.170.0060.00615.28
7.0.160.0080.00315.58
7.0.150.0000.01415.54
7.0.140.0020.04218.64
7.0.130.0070.00815.43
7.0.120.0040.01115.19
7.0.110.0090.00615.59
7.0.100.0040.00815.25
7.0.90.0030.03117.67
7.0.80.0020.04617.72
7.0.70.0300.02517.67
7.0.60.0220.03717.74
7.0.50.0120.03817.97
7.0.40.0070.02816.65
7.0.30.0050.03816.83
7.0.20.0050.03816.83
7.0.10.0100.04316.76
7.0.00.0030.03016.85
5.6.400.0040.01114.59
5.6.390.0000.01214.45
5.6.380.0070.00714.49
5.6.370.0030.01114.70
5.6.360.0060.00914.82
5.6.350.0000.00814.33
5.6.340.0070.00314.52
5.6.330.0000.01414.67
5.6.320.0090.00614.51
5.6.310.0030.00714.55
5.6.300.0030.01414.40
5.6.290.0030.00914.66
5.6.280.0030.04017.83
5.6.270.0030.00914.60
5.6.260.0040.01114.52
5.6.250.0040.00414.23
5.6.240.0000.01014.45
5.6.230.0080.04217.54
5.6.220.0030.02517.58
5.6.210.0080.03517.58
5.6.200.0030.05217.79
5.6.190.0070.04017.83
5.6.180.0030.04617.78
5.6.170.0120.02517.81
5.6.160.0080.02217.60
5.6.150.0070.02717.74
5.6.140.0080.04017.73
5.6.130.0030.05117.75
5.6.120.0070.04717.85
5.6.110.0090.02817.78
5.6.100.0070.03717.70
5.6.90.0050.04717.80
5.6.80.0030.04217.46
5.6.70.0120.04017.47
5.6.60.0100.04317.51
5.6.50.0070.02517.40
5.6.40.0030.02917.43
5.6.30.0130.03817.50
5.6.20.0070.04117.42
5.6.10.0070.03817.45
5.6.00.0080.02817.46
5.5.380.0030.01014.23
5.5.370.0070.04517.34
5.5.360.0060.04317.53
5.5.350.0070.04317.48
5.5.340.0130.02817.59
5.5.330.0080.04217.67
5.5.320.0020.04717.58
5.5.310.0030.02717.66
5.5.300.0080.03617.79
5.5.290.0060.03517.65
5.5.280.0090.02417.60
5.5.270.0020.04117.61
5.5.260.0050.03017.63
5.5.250.0080.03617.45
5.5.240.0020.03317.24
5.5.230.0100.04017.25
5.5.220.0070.04417.41
5.5.210.0090.02217.35
5.5.200.0080.02117.13
5.5.190.0050.04317.25
5.5.180.0000.03217.27
5.5.170.0130.00314.66
5.5.160.0060.04517.31
5.5.150.0100.04017.30
5.5.140.0070.04517.28
5.5.130.0100.03717.19
5.5.120.0030.02517.26
5.5.110.0050.04817.31
5.5.100.0120.03117.30
5.5.90.0080.04017.22
5.5.80.0120.02717.31
5.5.70.0100.02817.36
5.5.60.0050.03317.19
5.5.50.0060.03117.33
5.5.40.0020.04917.09
5.5.30.0070.04317.19
5.5.20.0080.03717.18
5.5.10.0070.02317.20
5.5.00.0020.04617.32
5.4.450.0070.04015.87
5.4.440.0070.03715.87
5.4.430.0070.04215.88
5.4.420.0030.02715.79
5.4.410.0100.03815.82
5.4.400.0070.03215.64
5.4.390.0110.03615.70
5.4.380.0100.02015.68
5.4.370.0080.02015.63
5.4.360.0050.02315.69
5.4.350.0090.04015.64
5.4.340.0120.02015.54
5.4.330.0030.01012.22
5.4.320.0070.04215.72
5.4.310.0050.04015.55
5.4.300.0070.03915.67
5.4.290.0000.02615.63
5.4.280.0090.03515.67
5.4.270.0030.02315.58
5.4.260.0050.02015.63
5.4.250.0030.04215.63
5.4.240.0040.04415.53
5.4.230.0050.02315.63
5.4.220.0070.04215.72
5.4.210.0110.02315.55
5.4.200.0050.02515.65
5.4.190.0080.03715.54
5.4.180.0020.04215.70
5.4.170.0080.04115.67
5.4.160.0050.03015.69
5.4.150.0080.03815.71
5.4.140.0120.03314.34
5.4.130.0090.03314.35
5.4.120.0050.04014.35
5.4.110.0110.03514.35
5.4.100.0090.04614.39
5.4.90.0060.02614.27
5.4.80.0020.02114.38
5.4.70.0060.03314.38
5.4.60.0140.03014.38
5.4.50.0020.03014.32
5.4.40.0060.02114.38
5.4.30.0030.03014.34
5.4.20.0020.02514.31
5.4.10.0050.02814.28
5.4.00.0080.02514.00
5.3.290.0120.03713.50
5.3.280.0090.04013.42
5.3.270.0020.02413.38
5.3.260.0080.02813.45
5.3.250.0070.02213.38
5.3.240.0050.02113.45
5.3.230.0020.04413.42
5.3.220.0050.02713.37
5.3.210.0050.03313.45
5.3.200.0030.03513.39
5.3.190.0050.03313.38
5.3.180.0000.02513.38
5.3.170.0020.02313.38
5.3.160.0050.02313.39
5.3.150.0090.02013.43
5.3.140.0030.02413.38
5.3.130.0100.03513.37
5.3.120.0020.02513.35
5.3.110.0030.03513.41
5.3.100.0100.03713.13
5.3.90.0000.04413.10
5.3.80.0070.03813.18
5.3.70.0060.03913.18
5.3.60.0050.02713.14
5.3.50.0140.03213.05
5.3.40.0020.03213.15
5.3.30.0020.02413.10
5.3.20.0030.03712.97
5.3.10.0050.02612.97
5.3.00.0030.03712.97
5.2.170.0030.03713.71
5.2.160.0000.04013.71
5.2.150.0030.03713.71
5.2.140.0100.04713.71
5.2.130.0030.03313.71
5.2.120.0030.03013.71
5.2.110.0100.02713.71
5.2.100.0030.06013.71
5.2.90.0000.03313.71
5.2.80.0000.03013.71
5.2.70.0030.03013.71
5.2.60.0000.03713.71
5.2.50.0030.04313.71
5.2.40.0070.05713.71
5.2.30.0070.02713.71
5.2.20.0030.03013.71
5.2.10.0030.05313.71
5.2.00.0130.03713.71
5.1.60.0000.03013.71
5.1.50.0030.03013.71
5.1.40.0100.02013.71
5.1.30.0130.03713.71
5.1.20.0100.04313.71
5.1.10.0000.05713.71
5.1.00.0070.04313.71
5.0.50.0030.03313.71
5.0.40.0030.04313.71
5.0.30.0030.06013.71
5.0.20.0030.04313.71
5.0.10.0030.04013.71
5.0.00.0030.06713.71
4.4.90.0030.03313.71
4.4.80.0030.03313.71
4.4.70.0070.01013.71
4.4.60.0030.02713.71
4.4.50.0000.02713.71
4.4.40.0070.04713.71
4.4.30.0000.03013.71
4.4.20.0030.03313.71
4.4.10.0000.03713.71
4.4.00.0000.06013.71
4.3.110.0000.03013.71
4.3.100.0030.02013.71
4.3.90.0000.03713.71
4.3.80.0070.04713.71
4.3.70.0000.03013.71
4.3.60.0000.03313.71
4.3.50.0030.02713.71
4.3.40.0070.04713.71
4.3.30.0070.03313.71
4.3.20.0030.02713.71
4.3.10.0030.03013.71
4.3.00.0000.02313.71

preferences:
47.31 ms | 400 KiB | 5 Q