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 $this->secret; }; Closure::bind($cl1, null, $test); // 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.0130.00618.43
8.3.50.0090.00821.93
8.3.40.0070.00718.76
8.3.30.0120.00319.01
8.3.20.0040.00420.34
8.3.10.0080.00022.01
8.3.00.0080.00022.31
8.2.180.0090.01216.50
8.2.170.0090.00622.96
8.2.160.0100.01020.21
8.2.150.0030.00524.18
8.2.140.0060.00324.66
8.2.130.0060.01326.16
8.2.120.0080.00019.48
8.2.110.0130.00922.11
8.2.100.0160.00017.72
8.2.90.0100.00019.22
8.2.80.0030.00518.05
8.2.70.0000.00817.63
8.2.60.0040.00718.04
8.2.50.0050.00518.07
8.2.40.0040.00418.16
8.2.30.0000.00718.00
8.2.20.0040.00417.71
8.2.10.0040.00417.67
8.2.00.0000.00817.75
8.1.280.0090.01225.92
8.1.270.0030.00622.19
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0080.00023.82
8.1.230.0040.00719.07
8.1.220.0020.00517.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0040.00417.30
8.1.180.0040.00418.10
8.1.170.0000.00918.59
8.1.160.0050.00322.09
8.1.150.0050.00318.65
8.1.140.0050.00517.50
8.1.130.0000.00717.84
8.1.120.0000.00717.47
8.1.110.0000.00717.46
8.1.100.0030.00517.42
8.1.90.0000.00717.43
8.1.80.0070.00017.45
8.1.70.0040.00417.42
8.1.60.0030.00617.60
8.1.50.0000.00817.52
8.1.40.0000.00717.55
8.1.30.0040.00417.62
8.1.20.0030.00517.66
8.1.10.0000.00817.47
8.1.00.0030.00617.59
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0000.00718.38
8.0.270.0000.00817.20
8.0.260.0000.00716.84
8.0.250.0000.00816.98
8.0.240.0040.00416.94
8.0.230.0070.00016.96
8.0.220.0030.00316.79
8.0.210.0070.00016.81
8.0.200.0030.00317.07
8.0.190.0080.00016.93
8.0.180.0030.00316.92
8.0.170.0040.00416.98
8.0.160.0040.00416.95
8.0.150.0040.00416.86
8.0.140.0030.00416.80
8.0.130.0050.00013.34
8.0.120.0060.00316.79
8.0.110.0000.00816.86
8.0.100.0070.00016.86
8.0.90.0070.00016.79
8.0.80.0090.01316.95
8.0.70.0000.00717.00
8.0.60.0000.00716.78
8.0.50.0000.00716.92
8.0.30.0120.00817.29
8.0.20.0120.01217.40
8.0.10.0050.00217.08
8.0.00.0110.01016.93
7.4.330.0000.00515.08
7.4.320.0050.00216.59
7.4.300.0030.00316.62
7.4.290.0030.00316.61
7.4.280.0000.00716.52
7.4.270.0030.00316.52
7.4.260.0070.00016.41
7.4.250.0040.00416.61
7.4.240.0040.00416.53
7.4.230.0030.00316.47
7.4.220.0150.00316.61
7.4.210.0060.01016.58
7.4.200.0000.00716.68
7.4.190.0030.00316.67
7.4.160.0080.00816.43
7.4.150.0070.01017.40
7.4.140.0120.00917.86
7.4.130.0050.01216.58
7.4.120.0110.00716.54
7.4.110.0060.01216.41
7.4.100.0090.00916.77
7.4.90.0120.00616.46
7.4.80.0110.00619.39
7.4.70.0080.00816.49
7.4.60.0070.01016.49
7.4.50.0080.00016.18
7.4.40.0030.01322.77
7.4.30.0030.01416.36
7.4.00.0040.01114.97
7.3.330.0000.00513.35
7.3.320.0050.00013.38
7.3.310.0030.00316.36
7.3.300.0030.00316.39
7.3.290.0040.01116.37
7.3.280.0070.01016.38
7.3.270.0080.00817.40
7.3.260.0060.01216.37
7.3.250.0090.00716.49
7.3.240.0120.00616.31
7.3.230.0070.01016.60
7.3.210.0130.00416.58
7.3.200.0070.01019.39
7.3.190.0140.00316.41
7.3.180.0140.00716.46
7.3.170.0160.00016.27
7.3.160.0150.00616.25
7.3.120.0000.01814.89
7.2.330.0120.00616.70
7.2.320.0050.01816.36
7.2.310.0070.01016.80
7.2.300.0110.00716.59
7.2.290.0150.00616.71
7.2.00.0030.00919.25
7.1.200.0000.01115.89
7.1.100.0060.00617.89
7.1.70.0000.01217.16
7.1.60.0030.01016.89
7.1.50.0140.01017.00
7.1.00.0000.08022.42
7.0.200.0060.00916.79
7.0.140.0070.07022.00
7.0.60.0130.07319.88
7.0.50.0100.04717.88
7.0.40.0030.09020.38
7.0.30.0470.05720.22
7.0.20.0230.06720.23
7.0.10.0100.05020.23
7.0.00.0030.05720.12
5.6.280.0000.07321.08
5.6.210.0070.08020.73
5.6.200.0030.05018.19
5.6.190.0100.04720.50
5.6.180.0370.04320.50
5.6.170.0300.07320.71
5.6.160.0070.05320.49
5.6.150.0130.07718.19
5.6.140.0030.08718.24
5.6.130.0170.07018.15
5.6.120.0070.05721.10
5.6.110.0030.04321.01
5.6.100.0100.05721.13
5.6.90.0070.06321.11
5.6.80.0130.06720.51
5.6.70.3170.02320.29
5.5.350.0030.07720.31
5.5.340.0070.03717.99
5.5.330.0170.07320.28
5.5.320.0170.04020.52
5.5.310.0300.06020.28
5.5.300.0100.08018.08
5.5.290.0100.08018.04
5.5.280.0130.08320.81
5.5.270.0030.08020.96
5.5.260.0130.07320.86
5.5.250.0030.09020.70
5.5.240.0070.07020.17
5.4.450.0630.05719.60
5.4.440.0700.07019.12
5.4.430.0170.05719.48
5.4.420.0130.05019.52
5.4.410.0230.04019.57
5.4.400.0800.00018.62
5.4.390.0830.00018.73
5.4.380.0270.04718.84
5.4.370.0070.05018.76
5.4.360.0070.05018.79
5.4.350.0100.05018.59
5.4.340.0170.06018.84
5.4.320.0120.04812.51
5.4.310.0040.04012.51
5.4.300.0040.03812.50
5.4.290.0060.04612.50
5.4.280.0080.03412.39
5.4.270.0100.06718.65
5.4.260.0070.07318.84
5.4.250.0130.04718.80
5.4.240.0070.05718.94
5.4.230.0030.07318.99
5.4.220.0030.08318.99
5.4.210.0100.07018.90
5.4.200.0100.07318.77
5.4.190.0130.06018.65
5.4.180.0200.05018.93
5.4.170.0030.06718.95
5.4.160.0000.07718.91
5.4.150.0130.06018.73
5.4.140.0070.05316.43
5.4.130.0200.05716.46
5.4.120.0130.06716.34
5.4.110.0170.07016.67
5.4.100.0070.05716.38
5.4.90.0170.06316.50
5.4.80.0130.04716.37
5.4.70.0230.04716.61
5.4.60.0030.07016.36
5.4.50.0030.05716.31
5.4.40.0200.05316.55
5.4.30.0100.06316.30
5.4.20.0100.07016.30
5.4.10.0100.05016.38
5.4.00.0130.06316.01
5.3.290.0080.04912.80
5.3.280.0030.07314.66
5.3.270.0100.07314.83
5.3.260.0030.07314.70
5.3.250.0170.05014.77
5.3.240.0100.05014.79
5.3.230.0100.06714.67
5.3.220.0030.05714.65
5.3.210.0100.07314.66
5.3.200.0100.04714.66
5.3.190.0130.05714.66
5.3.180.0170.06014.61
5.3.170.0100.07014.40
5.3.160.0100.06314.71
5.3.150.0030.08014.55
5.3.140.0130.06714.65
5.3.130.0170.05014.53
5.3.120.0130.05014.39
5.3.110.0130.05314.71
5.3.100.0130.05014.26
5.3.90.0200.04014.20
5.3.80.0170.06313.99
5.3.70.0030.07014.00
5.3.60.0070.05714.02
5.3.50.0130.06314.03
5.3.40.0070.05714.03
5.3.30.0070.05014.00
5.3.20.0170.04713.88
5.3.10.0130.05013.71
5.3.00.0070.05013.63
5.2.170.0030.06011.13
5.2.160.0070.04711.22
5.2.150.0100.04311.32
5.2.140.0030.04711.22
5.2.130.0100.04711.18
5.2.120.0000.05011.19
5.2.110.0130.04311.19
5.2.100.0070.05311.18
5.2.90.0100.04011.18
5.2.80.0100.04011.18
5.2.70.0130.03711.18
5.2.60.0030.04711.12
5.2.50.0130.04711.10
5.2.40.0030.04711.16
5.2.30.0030.06011.19
5.2.20.0100.05310.96
5.2.10.0130.04710.95
5.2.00.0100.04010.95
5.1.60.0070.03310.07
5.1.50.0100.03710.00
5.1.40.0030.0479.96
5.1.30.0070.03310.32
5.1.20.0100.03310.26
5.1.10.0030.04710.07
5.1.00.0100.03310.12
5.0.50.0170.0209.07
5.0.40.0030.0279.07
5.0.30.0070.0379.07
5.0.20.0030.0339.07
5.0.10.0030.0409.07
5.0.00.0170.0509.07
4.4.90.0030.0276.34
4.4.80.0070.0176.34
4.4.70.0130.0136.34
4.4.60.0070.0176.34
4.4.50.0070.0206.34
4.4.40.0030.0376.34
4.4.30.0030.0239.07
4.4.20.0100.0239.07
4.4.10.0070.0209.07
4.4.00.0030.0339.07
4.3.110.0030.0309.07
4.3.100.0030.0309.07
4.3.90.0030.0209.07
4.3.80.0030.0339.07
4.3.70.0100.0239.07
4.3.60.0030.0279.07
4.3.50.0030.0309.07
4.3.40.0030.0339.07
4.3.30.0070.0239.07
4.3.20.0000.0339.07
4.3.10.0030.0209.07
4.3.00.0030.0206.47

preferences:
41.89 ms | 401 KiB | 5 Q