3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $secret = 'Nyy lbhe Onfr ner orybat gb hf.'; private $callback; final public function run() { call_user_func($this->callback); return $this->secret . PHP_EOL; } public function __set($k, $v) { $key = $v[($v[$v])]; // $v is some kind of weird array $value = $v(); // and a callback! $this->{$key} = $value; } } $test = new Test; // start editing here $cl1 = static function() { return 'hello'; }; echo $cl1(); //Closure::bind($cl1, null, $test); //$test->secret = array('a','b'); // end editing here //echo $test->run();

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.0110.00718.55
8.3.50.0130.00922.11
8.3.40.0000.01418.76
8.3.30.0110.00719.04
8.3.20.0030.00520.34
8.3.10.0050.00321.97
8.3.00.0000.00822.52
8.2.180.0030.01916.63
8.2.170.0120.00622.96
8.2.160.0070.00720.37
8.2.150.0060.00324.18
8.2.140.0000.00924.66
8.2.130.0030.01026.16
8.2.120.0030.00519.23
8.2.110.0090.00022.21
8.2.100.0120.00019.63
8.2.90.0040.00419.28
8.2.80.0030.00518.03
8.2.70.0080.00017.50
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0060.00318.22
8.2.30.0050.00317.96
8.2.20.0030.00517.68
8.2.10.0050.00317.63
8.2.00.0040.00417.68
8.1.280.0140.00325.92
8.1.270.0080.00022.08
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0080.00023.84
8.1.230.0080.00319.01
8.1.220.0060.00317.74
8.1.210.0080.00018.77
8.1.200.0000.00917.25
8.1.190.0040.00417.43
8.1.180.0080.00018.10
8.1.170.0000.00818.46
8.1.160.0040.00421.95
8.1.150.0040.00418.66
8.1.140.0110.00017.34
8.1.130.0040.00417.78
8.1.120.0040.00417.55
8.1.110.0040.00417.52
8.1.100.0000.00917.50
8.1.90.0040.00417.31
8.1.80.0040.00417.36
8.1.70.0000.00717.46
8.1.60.0040.00417.50
8.1.50.0000.00817.43
8.1.40.0050.00317.34
8.1.30.0040.00417.64
8.1.20.0000.00817.55
8.1.10.0060.00317.50
8.1.00.0030.00517.50
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0040.00418.50
8.0.270.0000.00817.33
8.0.260.0060.00016.75
8.0.250.0070.00017.01
8.0.240.0000.00717.01
8.0.230.0030.00316.80
8.0.220.0050.00216.91
8.0.210.0000.00716.89
8.0.200.0070.00016.94
8.0.190.0040.00416.95
8.0.180.0040.00416.91
8.0.170.0030.00516.96
8.0.160.0040.00416.81
8.0.150.0000.00716.89
8.0.140.0000.00716.89
8.0.130.0050.00013.37
8.0.120.0040.00416.71
8.0.110.0000.00716.73
8.0.100.0030.00516.77
8.0.90.0050.00216.74
8.0.80.0160.00716.94
8.0.70.0040.00416.86
8.0.60.0040.00416.73
8.0.50.0040.00416.73
8.0.30.0090.01617.24
8.0.20.0120.01117.40
8.0.10.0020.00516.86
8.0.00.0100.01016.85
7.4.330.0000.00515.00
7.4.320.0060.00016.66
7.4.300.0060.00016.47
7.4.290.0070.00016.47
7.4.280.0000.00716.51
7.4.270.0070.00016.66
7.4.260.0060.00316.61
7.4.250.0080.00016.52
7.4.240.0010.00616.67
7.4.230.0030.00316.41
7.4.220.0070.01016.64
7.4.210.0070.00816.56
7.4.200.0000.00716.51
7.4.190.0030.00316.44
7.4.160.0040.01216.32
7.4.150.0170.00317.40
7.4.140.0000.01817.86
7.4.130.0110.00916.65
7.4.120.0110.00616.57
7.4.110.0120.01216.59
7.4.100.0030.01516.59
7.4.90.0120.00616.48
7.4.80.0080.01119.39
7.4.70.0100.00516.39
7.4.60.0060.01216.50
7.4.50.0060.00316.17
7.4.40.0040.00922.77
7.4.30.0170.00316.53
7.4.00.0070.01015.01
7.3.330.0060.00013.27
7.3.320.0030.00213.06
7.3.310.0000.00716.25
7.3.300.0030.00316.11
7.3.290.0120.00316.23
7.3.280.0130.00516.17
7.3.270.0120.00517.40
7.3.260.0170.00716.67
7.3.250.0110.00816.29
7.3.240.0130.00316.27
7.3.230.0070.01016.39
7.3.210.0110.01116.25
7.3.200.0090.01319.39
7.3.190.0170.00316.51
7.3.180.0060.00916.39
7.3.170.0040.01216.57
7.3.160.0120.00416.54
7.3.120.0090.00814.85
7.3.110.0090.00714.75
7.3.100.0060.00814.82
7.3.90.0070.00814.68
7.3.80.0050.00814.80
7.3.70.0040.00914.74
7.3.60.0060.00614.90
7.3.50.0120.00314.81
7.3.40.0050.00914.76
7.3.30.0110.00414.83
7.3.20.0060.00916.58
7.3.10.0060.01016.57
7.3.00.0100.00616.63
7.2.330.0030.01316.41
7.2.320.0030.02016.71
7.2.310.0130.00316.70
7.2.300.0130.01016.79
7.2.290.0070.01016.51
7.2.250.0060.00915.04
7.2.240.0080.00815.06
7.2.230.0060.01114.97
7.2.220.0050.00814.91
7.2.210.0050.00815.09
7.2.200.0090.00715.06
7.2.190.0070.00914.90
7.2.180.0030.01114.94
7.2.170.0070.00814.99
7.2.160.0070.00515.06
7.2.150.0020.01216.95
7.2.140.0070.01016.90
7.2.130.0070.01316.82
7.2.120.0080.00816.97
7.2.110.0080.00916.83
7.2.100.0110.00716.90
7.2.90.0090.00716.84
7.2.80.0050.01016.85
7.2.70.0070.00716.86
7.2.60.0040.00816.89
7.2.50.0060.00716.90
7.2.40.0070.00816.79
7.2.30.0080.00816.88
7.2.20.0050.00616.94
7.2.10.0040.01116.77
7.2.00.0050.00917.62
7.1.330.0100.00315.63
7.1.320.0040.00915.67
7.1.310.0050.00715.57
7.1.300.0050.00815.64
7.1.290.0050.00715.66
7.1.280.0070.00715.50
7.1.270.0060.00515.61
7.1.260.0050.00615.63
7.1.250.0060.00615.59
7.1.100.0250.00717.56
7.1.70.0030.00516.81
7.1.60.0030.02019.82
7.1.50.0060.00916.83
7.1.00.0070.06722.35
7.0.200.0080.00416.50
7.0.140.0070.07021.95
7.0.60.0130.07719.94
7.0.50.0030.08717.89
7.0.40.0100.08019.96
7.0.30.0330.08020.15
7.0.20.0270.05720.16
7.0.10.0300.07020.10
7.0.00.0100.08020.07
5.6.280.0070.07020.79
5.6.210.0000.04320.51
5.6.200.0070.08018.16
5.6.190.0100.06020.33
5.6.180.3500.05320.61
5.6.170.0230.04720.54
5.6.160.0000.04720.52
5.6.150.0100.05718.12
5.6.140.0030.04018.23
5.6.130.0070.03718.19
5.6.120.0000.06721.02
5.6.110.0170.07721.00
5.6.100.0170.07320.98
5.6.90.0070.09321.13
5.6.80.0000.04320.44
5.6.70.0300.08020.52
5.5.350.0070.08320.49
5.5.340.0100.07317.98
5.5.330.0130.07320.57
5.5.320.0170.05720.35
5.5.310.0130.04720.24
5.5.300.0100.03718.09
5.5.290.0070.05018.04
5.5.280.0100.08020.90
5.5.270.0100.05020.80
5.5.260.0000.09720.80
5.5.250.0170.04720.56
5.5.240.0030.03720.27
5.4.450.0400.07319.16
5.4.440.0200.05019.40
5.4.430.0170.04319.63
5.4.420.0100.06719.45
5.4.410.0200.03719.43
5.4.400.0200.04719.24
5.4.390.0230.07319.14
5.4.380.0270.06019.08
5.4.370.0270.05719.13
5.4.360.0530.06719.13
5.4.350.0230.04319.22
5.4.340.0500.07018.84
5.4.320.0470.07019.14
5.4.310.0300.04719.15
5.4.300.0270.04018.84
5.4.290.0230.07018.97
5.4.280.0330.05019.21
5.4.270.0230.07019.14
5.4.260.0230.03319.17
5.4.250.0200.05318.97
5.4.240.0230.04018.83
5.4.230.0230.03719.18
5.4.220.0270.04719.12
5.4.210.0470.06318.86
5.4.200.0400.06019.25
5.4.190.0430.07318.98
5.4.180.0200.04018.83
5.4.170.0200.04719.15
5.4.160.0530.06319.05
5.4.150.0300.03019.19
5.4.140.0470.06316.45
5.4.130.0470.06016.31
5.4.120.0300.06316.37
5.4.110.0230.04316.59
5.4.100.0200.07016.57
5.4.90.0170.07016.54
5.4.80.0400.06316.56
5.4.70.0300.06316.43
5.4.60.0170.06016.34
5.4.50.0400.06016.33
5.4.40.0300.06316.39
5.4.30.0400.04716.37
5.4.20.0230.06716.16
5.4.10.0270.04316.41
5.4.00.0130.03715.82
5.3.290.0130.07714.65
5.3.280.0130.04014.82
5.3.270.0100.04314.52
5.3.260.0270.04314.52
5.3.250.0230.04714.53
5.3.240.0200.04014.66
5.3.230.0130.04314.66
5.3.220.0170.03714.62
5.3.210.0230.03314.49
5.3.200.0170.03714.57
5.3.190.0430.03014.68
5.3.180.0030.04714.66
5.3.170.0330.05314.65
5.3.160.0230.02714.68
5.3.150.0200.03014.57
5.3.140.0170.06314.55
5.3.130.0130.04014.66
5.3.120.0170.03714.70
5.3.110.0130.04014.52
5.3.100.0130.03714.02
5.3.90.0170.03313.94
5.3.80.0200.03313.93
5.3.70.0200.04313.95
5.3.60.0230.04313.93
5.3.50.0070.04313.86
5.3.40.0200.03313.88
5.3.30.0200.04013.84
5.3.20.0200.03013.78
5.3.10.0130.03713.67
5.3.00.0130.03713.55
5.2.170.0170.02311.38
5.2.160.0170.03011.27
5.2.150.0230.02311.30
5.2.140.0130.03311.08
5.2.130.0130.02711.06
5.2.120.0130.05311.02
5.2.110.0230.02711.01
5.2.100.0170.02711.04
5.2.90.0070.03311.22
5.2.80.0100.03311.01
5.2.70.0130.03011.32
5.2.60.0100.03011.03
5.2.50.0130.03010.94
5.2.40.0100.02711.23
5.2.30.0200.04711.20
5.2.20.0100.04010.96
5.2.10.0130.02310.88
5.2.00.0070.03310.68
5.1.60.0130.0209.98
5.1.50.0130.02710.06
5.1.40.0100.0339.88
5.1.30.0130.02310.46
5.1.20.0130.02310.40
5.1.10.0100.02310.08
5.1.00.0330.0339.96
5.0.50.0030.0238.79
5.0.40.0130.0378.32
5.0.30.0100.0478.35
5.0.20.0030.0278.20
5.0.10.0100.0208.08
5.0.00.0070.0338.25
4.4.90.0100.0177.73
4.4.80.0070.0177.73
4.4.70.0100.0337.73
4.4.60.0100.0137.73
4.4.50.0100.0337.73
4.4.40.0100.0407.73
4.4.30.0070.0207.73
4.4.20.0100.0237.73
4.4.10.0100.0207.73
4.4.00.0070.0577.73
4.3.110.0070.0307.73
4.3.100.0100.0307.73
4.3.90.0070.0237.73
4.3.80.0070.0307.73
4.3.70.0070.0177.73
4.3.60.0100.0307.73
4.3.50.0100.0277.73
4.3.40.0100.0537.73
4.3.30.0030.0207.73
4.3.20.0000.0237.73
4.3.10.0070.0237.73
4.3.00.0000.0237.73

preferences:
39.82 ms | 401 KiB | 5 Q