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 class C implements ArrayAccess { public $key = false; public function offsetGet($offset) { return $this->key ? "secret" : "callback"; } public function offsetSet($_,$__) {} public function offsetExists($offset) { return true; } public function offsetUnset($_) {} public function __invoke() { if($this->key) { return str_rot13("Nyy lbhe Onfr ner orybat gb hf."); } else { return function() {}; } } } $c = new C(); $test->blah = $c; $c->key = true; $test->blah = $c; // 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.70.0070.01316.75
8.3.60.0140.00716.63
8.3.50.0090.00921.95
8.3.40.0150.00018.92
8.3.30.0140.00319.01
8.3.20.0080.00020.19
8.3.10.0040.00421.90
8.3.00.0030.00720.77
8.2.190.0160.00016.58
8.2.180.0130.00916.63
8.2.170.0040.01122.96
8.2.160.0090.00622.20
8.2.150.0070.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0030.00721.00
8.2.100.0000.01217.63
8.2.90.0040.00419.35
8.2.80.0090.00017.97
8.2.70.0040.00417.38
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0050.00319.91
8.2.30.0100.00018.21
8.2.20.0040.00417.77
8.2.10.0000.00818.08
8.2.00.0080.00017.64
8.1.280.0070.00725.92
8.1.270.0070.00320.68
8.1.260.0000.00826.35
8.1.250.0070.00328.09
8.1.240.0000.01023.92
8.1.230.0060.00617.42
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0000.00917.13
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00818.53
8.1.160.0030.00521.97
8.1.150.0000.00818.92
8.1.140.0060.00317.41
8.1.130.0030.00517.75
8.1.120.0070.00017.39
8.1.110.0040.00417.37
8.1.100.0050.00217.50
8.1.90.0070.00317.37
8.1.80.0040.00417.48
8.1.70.0040.00417.51
8.1.60.0030.00617.48
8.1.50.0060.00317.61
8.1.40.0000.00817.54
8.1.30.0030.00517.61
8.1.20.0030.00617.59
8.1.10.0060.00317.39
8.1.00.0040.00417.54
8.0.300.0000.00718.77
8.0.290.0030.00316.75
8.0.280.0000.00718.47
8.0.270.0050.00317.28
8.0.260.0000.00817.33
8.0.250.0070.00016.98
8.0.240.0030.00516.96
8.0.230.0040.00417.00
8.0.220.0070.00016.79
8.0.210.0070.00016.93
8.0.200.0060.00016.96
8.0.190.0040.00316.93
8.0.180.0050.00316.80
8.0.170.0030.00516.96
8.0.160.0000.00716.93
8.0.150.0000.00716.88
8.0.140.0000.00716.88
8.0.130.0060.00013.34
8.0.120.0000.00816.82
8.0.110.0000.00716.82
8.0.100.0000.00716.90
8.0.90.0040.00416.98
8.0.80.0130.00316.91
8.0.70.0020.00516.98
8.0.60.0040.00416.91
8.0.50.0000.00716.84
8.0.30.0160.00917.11
8.0.20.0110.00817.40
8.0.10.0040.00417.04
8.0.00.0080.00916.74
7.4.330.0040.00415.03
7.4.320.0000.00716.61
7.4.300.0030.00316.63
7.4.290.0030.00316.54
7.4.280.0000.00716.61
7.4.270.0070.00016.63
7.4.260.0040.00416.49
7.4.250.0040.00416.39
7.4.240.0070.00016.59
7.4.230.0050.00316.43
7.4.220.0030.01316.45
7.4.210.0090.00616.66
7.4.200.0040.00416.54
7.4.160.0080.00816.45
7.4.150.0100.01017.40
7.4.140.0110.01217.86
7.4.130.0130.00416.57
7.4.120.0110.00716.61
7.4.110.0110.00716.49
7.4.100.0110.00716.58
7.4.90.0130.00316.49
7.4.80.0150.00416.50
7.4.70.0070.01016.37
7.4.60.0130.00316.59
7.4.50.0030.00616.48
7.4.40.0070.01016.56
7.4.30.0060.01716.53
7.4.00.0120.00315.02
7.3.330.0020.00213.23
7.3.320.0050.00913.26
7.3.310.0050.00316.24
7.3.300.0000.00716.38
7.3.290.0070.00016.26
7.3.280.0080.00816.40
7.3.270.0050.01417.40
7.3.260.0100.01016.34
7.3.250.0100.00816.55
7.3.240.0080.00816.38
7.3.230.0100.00716.62
7.3.210.0130.00416.38
7.3.200.0070.01019.39
7.3.190.0070.01016.35
7.3.180.0150.00316.45
7.3.170.0100.00716.61
7.3.160.0060.01216.44
7.3.10.0060.00916.75
7.3.00.0140.00016.39
7.2.330.0060.01516.75
7.2.320.0100.00616.65
7.2.310.0070.01016.42
7.2.300.0120.00816.86
7.2.290.0090.00916.63
7.2.130.0100.00316.97
7.2.120.0110.00416.85
7.2.110.0100.00716.97
7.2.100.0080.00616.89
7.2.90.0090.00616.91
7.2.80.0030.01016.95
7.2.70.0100.00616.98
7.2.60.0090.00917.01
7.2.50.0100.00317.04
7.2.40.0070.00716.98
7.2.30.0070.00716.96
7.2.20.0120.00316.93
7.2.10.0040.01116.96
7.2.00.0050.01018.29
7.1.250.0060.00315.61
7.1.100.0000.00817.72
7.1.70.0030.00917.01
7.1.60.0110.01419.46
7.1.50.0030.00716.82
7.1.00.0070.07322.44
7.0.200.0670.00714.59
7.0.140.0030.05322.07
7.0.60.0070.08719.94
7.0.50.0000.06717.89
7.0.40.0030.05020.20
7.0.30.0230.07320.17
7.0.20.0130.05320.09
7.0.10.0130.08320.15
7.0.00.0130.03320.23
5.6.280.0030.07321.16
5.6.210.0070.08020.54
5.6.200.0000.06318.19
5.6.190.0070.04320.41
5.6.180.0430.07720.54
5.6.170.0230.07320.56
5.6.160.0030.04720.57
5.6.150.0030.08718.19
5.6.140.0070.05718.18
5.6.130.0030.04018.26
5.6.120.0030.04321.14
5.6.110.0100.07721.06
5.6.100.0030.04721.05
5.6.90.0130.03721.02
5.6.80.0100.03020.43
5.5.350.0300.07720.48
5.5.340.0000.05317.99
5.5.330.0070.08320.40
5.5.320.0070.07320.20
5.5.310.0270.04320.41
5.5.300.0000.04018.09
5.5.290.0070.08017.98
5.5.280.0000.04320.82
5.5.270.0000.04320.77
5.5.260.0130.07320.76
5.5.250.0070.08320.63
5.5.240.0130.07020.05
5.4.450.0700.06319.48
5.4.440.0670.07719.61
5.4.430.1130.05319.60
5.4.420.0730.06719.45
5.4.410.1000.06319.42
5.4.400.0070.05319.26
5.4.390.0300.05018.50
5.4.380.0330.04018.78
5.4.370.0130.06018.84
5.4.360.0270.05318.78
5.4.350.0230.07018.79
5.4.340.0270.06018.60
5.4.320.0200.07318.71
5.4.310.0070.06318.79
5.4.300.0170.05318.78
5.4.290.0100.06718.54
5.4.280.0230.06318.78
5.4.270.0230.05018.46
5.4.260.0300.05018.57
5.4.250.0170.06018.49
5.4.240.0270.04718.58
5.4.230.0170.05318.77
5.4.220.0230.05318.81
5.4.210.0100.06318.46
5.4.200.0300.04016.61
5.4.190.0130.06018.76
5.4.180.0130.05718.74
5.4.170.0170.05718.57
5.4.160.0170.05318.71
5.4.150.0170.05718.59
5.4.140.0200.05016.22
5.4.130.0130.05316.18
5.4.120.0200.04716.43
5.4.110.0130.05016.19
5.4.100.0200.04716.27
5.4.90.0170.05016.28
5.4.80.0170.04716.20
5.4.70.0230.04316.34
5.4.60.0170.04716.31
5.4.50.0130.05016.24
5.4.40.0130.05716.21
5.4.30.0330.03316.27
5.4.20.0170.05316.44
5.4.10.0230.04716.25
5.4.00.0170.06015.63
5.3.290.0170.05714.86
5.3.280.0200.05314.71
5.3.270.0200.05314.76
5.3.260.0230.04714.73
5.3.250.0170.05014.66
5.3.240.0200.05014.71
5.3.230.0300.06714.64
5.3.220.0370.06014.63
5.3.210.0230.05314.71
5.3.200.0200.05314.60
5.3.190.0200.08314.59
5.3.180.0200.05014.71
5.3.170.0230.05014.57
5.3.160.0300.04014.75
5.3.150.0200.05314.63
5.3.140.0300.04314.74
5.3.130.0170.05714.77
5.3.120.0170.06014.74
5.3.110.0170.05714.73
5.3.100.0300.04714.08
5.3.90.0300.04314.09
5.3.80.0170.05714.16
5.3.70.0230.04714.05
5.3.60.0200.05014.19
5.3.50.0170.05713.96
5.3.40.0130.06013.98
5.3.30.0200.05313.95
5.3.20.0200.05713.82
5.3.10.0200.05313.84
5.3.00.0170.05313.90
5.2.170.0100.04711.30
5.2.160.0400.03311.14
5.2.150.0200.03711.39
5.2.140.0170.04011.14
5.2.130.0200.04011.16
5.2.120.0130.04011.10
5.2.110.0100.04711.13
5.2.100.0130.04011.22
5.2.90.0130.04311.23
5.2.80.0070.05311.31
5.2.70.0200.04011.31
5.2.60.0230.03711.30
5.2.50.0230.03311.08
5.2.40.0070.04711.04
5.2.30.0230.05010.97
5.2.20.0070.06311.02
5.2.10.0200.05010.86
5.2.00.0330.04310.91
5.1.60.0100.04710.08
5.1.50.0170.04010.03
5.1.40.0200.03710.00
5.1.30.0130.03310.40
5.1.20.0070.04010.46
5.1.10.0130.03310.16
5.1.00.0100.03710.22
5.0.50.0130.0238.62
5.0.40.0100.0278.62
5.0.30.0030.0478.42
5.0.20.0100.0238.20
5.0.10.0070.0278.26
5.0.00.0100.0408.35
4.4.90.0130.0235.88
4.4.80.0070.0235.88
4.4.70.0030.0275.88
4.4.60.0030.0235.91
4.4.50.0070.0206.01
4.4.40.0070.0375.89
4.4.30.0100.0175.92
4.4.20.0030.0235.94
4.4.10.0100.0175.97
4.4.00.0070.0335.95
4.3.110.0030.0235.82
4.3.100.0070.0205.84
4.3.90.0070.0205.89
4.3.80.0100.0305.79
4.3.70.0100.0175.82
4.3.60.0100.0175.82
4.3.50.0070.0205.78
4.3.40.0030.0335.78
4.3.30.0030.0234.58
4.3.20.0100.0174.61
4.3.10.0030.0204.52
4.3.00.0130.02014.62

preferences:
51.3 ms | 401 KiB | 5 Q