3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Challenge 1: Modify Test::$secret before it's output. Rules:: 1. No use of Reflection API / runkit extension 2. No stopping execution before Test::run() 3. No Exceptions or PHP errors / warnings notices allowed Hints: 1. Caesar 2. Magic methods 3. Requires a new feature of PHP 5.4 */ 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 A implements ArrayAccess { public function __call($name, $args){ return function(){ echo "HELLO WORLD"; }; } public function offsetSet($offset, $value) {} public function offsetExists($offset) { return true; } public function offsetUnset($offset) {} public function offsetGet($offset) { return $this; } } $test->foo = new A; // 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.0100.01018.20
8.3.50.0110.01121.21
8.3.40.0070.00718.81
8.3.30.0160.00020.29
8.3.20.0070.00020.28
8.3.10.0080.00021.96
8.3.00.0050.00222.51
8.2.180.0070.01718.54
8.2.170.0030.01722.96
8.2.160.0100.00720.46
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00919.76
8.2.110.0060.00320.39
8.2.100.0060.00617.91
8.2.90.0040.00419.17
8.2.80.0040.00419.14
8.2.70.0060.00417.38
8.2.60.0000.00918.03
8.2.50.0030.00518.07
8.2.40.0040.00418.34
8.2.30.0000.00718.01
8.2.20.0040.00417.78
8.2.10.0040.00417.70
8.2.00.0060.00317.87
8.1.280.0100.01025.92
8.1.270.0050.00324.66
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0050.00524.02
8.1.230.0090.00317.58
8.1.220.0040.00417.74
8.1.210.0060.00618.77
8.1.200.0060.00317.35
8.1.190.0030.00517.64
8.1.180.0000.00720.19
8.1.170.0050.00318.37
8.1.160.0040.00422.15
8.1.150.0000.00718.69
8.1.140.0040.00417.51
8.1.130.0000.00817.93
8.1.120.0050.00217.44
8.1.110.0040.00417.52
8.1.100.0070.00017.44
8.1.90.0030.00517.34
8.1.80.0000.00717.50
8.1.70.0030.00317.45
8.1.60.0040.00417.64
8.1.50.0030.00617.56
8.1.40.0040.00417.48
8.1.30.0020.00517.70
8.1.20.0030.00617.54
8.1.10.0040.00417.61
8.1.00.0080.00317.51
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0030.00318.50
8.0.270.0000.00817.27
8.0.260.0000.00716.82
8.0.250.0030.00317.10
8.0.240.0080.00416.87
8.0.230.0000.00717.02
8.0.220.0000.00717.04
8.0.210.0070.00016.98
8.0.200.0000.00717.02
8.0.190.0000.00717.00
8.0.180.0020.00516.92
8.0.170.0030.00517.00
8.0.160.0000.00816.91
8.0.150.0000.00816.80
8.0.140.0000.00816.83
8.0.130.0050.00013.41
8.0.120.0080.00016.78
8.0.110.0000.00816.98
8.0.100.0050.00217.04
8.0.90.0030.00516.80
8.0.80.0040.01116.97
8.0.70.0040.00416.86
8.0.60.0070.00016.84
8.0.50.0080.00017.01
8.0.30.0140.00916.98
8.0.20.0120.00617.40
8.0.10.0050.00316.98
8.0.00.0090.01016.75
7.4.330.0020.00215.00
7.4.320.0030.00316.57
7.4.300.0040.00416.53
7.4.290.0030.00316.62
7.4.280.0040.00416.66
7.4.270.0060.00016.63
7.4.260.0000.00816.40
7.4.250.0050.00216.63
7.4.240.0040.00416.49
7.4.230.0030.00316.56
7.4.220.0140.00416.73
7.4.210.0070.00716.48
7.4.200.0080.00016.71
7.4.190.0000.00716.70
7.4.160.0110.00716.47
7.4.150.0170.00717.40
7.4.140.0050.01317.86
7.4.130.0080.01016.56
7.4.120.0120.00716.61
7.4.110.0110.00716.52
7.4.100.0070.01016.63
7.4.90.0140.00716.45
7.4.80.0130.00319.39
7.4.70.0130.00316.41
7.4.60.0040.01216.44
7.4.50.0000.00816.58
7.4.40.0110.00422.77
7.4.30.0150.00616.45
7.4.00.0080.01014.92
7.3.330.0060.00013.43
7.3.320.0000.00513.22
7.3.310.0040.00416.27
7.3.300.0070.00016.40
7.3.290.0130.00516.38
7.3.280.0040.01316.36
7.3.270.0100.01017.40
7.3.260.0180.00716.43
7.3.250.0130.01016.49
7.3.240.0060.01316.32
7.3.230.0040.01316.39
7.3.210.0060.01116.38
7.3.200.0140.00319.39
7.3.190.0210.00316.53
7.3.180.0100.00716.38
7.3.170.0030.01316.48
7.3.160.0180.00016.55
7.3.120.0040.01414.95
7.3.110.0070.00914.77
7.3.100.0020.01515.01
7.3.90.0080.00614.68
7.3.80.0090.00714.72
7.3.70.0060.01114.87
7.3.60.0050.00714.84
7.3.50.0090.00514.83
7.3.40.0030.01214.76
7.3.30.0040.01114.85
7.3.20.0080.00616.57
7.3.10.0070.00716.61
7.3.00.0080.00616.59
7.2.330.0080.01016.79
7.2.320.0120.00616.75
7.2.310.0090.01316.44
7.2.300.0080.00816.66
7.2.290.0160.00016.70
7.2.250.0100.00914.99
7.2.240.0110.00815.09
7.2.230.0080.00615.04
7.2.220.0090.00615.07
7.2.210.0020.01314.99
7.2.200.0050.01015.18
7.2.190.0080.00615.11
7.2.180.0050.01115.10
7.2.170.0070.00914.98
7.2.130.0060.00917.04
7.2.120.0090.00617.06
7.2.110.0030.01016.77
7.2.100.0060.00316.89
7.2.90.0040.01217.23
7.2.80.0000.01616.75
7.2.70.0090.00616.98
7.2.60.0120.00316.79
7.2.50.0100.00516.98
7.2.40.0080.00417.05
7.2.30.0070.00416.90
7.2.20.0030.01317.14
7.2.10.0080.00316.86
7.2.00.0050.01118.12
7.1.330.0070.00615.80
7.1.320.0080.00415.77
7.1.310.0080.00915.84
7.1.300.0090.00515.78
7.1.290.0070.00915.92
7.1.280.0080.00315.61
7.1.270.0030.01115.74
7.1.260.0050.00815.79
7.1.250.0070.00715.76
7.1.200.0130.00015.76
7.1.70.0000.01116.93
7.1.60.0100.01319.21
7.1.50.0090.01616.93
7.1.00.0100.02722.33
7.0.200.0030.01016.84
7.0.140.0000.07022.16
7.0.60.0070.06319.94
7.0.50.0100.06017.90
7.0.40.0070.05320.23
7.0.30.0130.05320.19
7.0.20.0270.06320.08
7.0.10.0330.07720.23
7.0.00.0300.04020.25
5.6.280.0070.07321.04
5.6.210.0100.06720.70
5.6.200.0070.08318.19
5.6.190.0070.09020.76
5.6.180.0200.04720.45
5.6.170.0530.07020.50
5.6.160.0000.05020.52
5.6.150.0170.06718.29
5.6.140.0000.09018.27
5.6.130.0130.04718.29
5.6.120.0130.06721.13
5.6.110.0100.06721.00
5.6.100.0070.07321.00
5.6.90.0030.06020.89
5.6.80.0030.04020.43
5.6.70.0270.07320.54
5.5.350.0000.07020.42
5.5.340.0030.03718.02
5.5.330.0000.04720.13
5.5.320.0200.05720.27
5.5.310.0200.04720.51
5.5.300.0070.04017.99
5.5.290.0070.07717.95
5.5.280.0000.04320.89
5.5.270.0130.08720.80
5.5.260.0070.04720.74
5.5.250.0070.08320.48
5.5.240.0100.06720.09
5.4.450.0670.05319.31
5.4.440.0700.05719.55
5.4.430.0770.07719.47
5.4.420.0730.05719.47
5.4.410.0130.05319.21
5.4.400.0370.05718.63
5.4.390.0330.07018.54
5.4.380.0230.05018.63
5.4.370.0200.04718.58
5.4.360.0200.04318.79
5.4.350.0060.04412.04
5.4.340.0070.03512.03
5.4.320.0060.04512.52
5.4.310.0070.04712.52
5.4.300.0090.03512.52
5.4.290.0060.03712.51
5.4.280.0030.03712.41
5.4.270.0080.05012.41
5.4.260.0090.04812.41
5.4.250.0100.05318.89
5.4.240.0030.05718.84
5.4.230.0030.08018.91
5.4.220.0100.05718.98
5.4.210.0130.07018.93
5.4.200.0000.08018.77
5.4.190.0000.07018.94
5.4.180.0100.07018.97
5.4.170.0270.05718.95
5.4.160.0000.09018.75
5.4.150.0030.07318.87
5.4.140.0000.05316.55
5.4.130.0000.07716.54
5.4.120.0070.04316.47
5.4.110.0130.04716.40
5.4.100.0030.06316.46
5.4.90.0030.06716.42
5.4.80.0070.06316.40
5.4.70.0200.03716.51
5.4.60.0100.05316.38
5.4.50.0070.05316.33
5.4.40.0100.04316.38
5.4.30.0070.05316.44
5.4.20.0030.06016.36
5.4.10.0000.06716.30
5.4.00.0030.06015.75
5.3.290.0060.03912.80
5.3.280.0030.05014.68
5.3.270.0100.07014.69
5.3.260.0130.06314.69
5.3.250.0130.05714.70
5.3.240.0000.06014.80
5.3.230.0130.06314.70
5.3.220.0070.06714.67
5.3.210.0000.05314.73
5.3.200.0070.05714.66
5.3.190.0000.06314.66
5.3.180.0070.04314.66
5.3.170.0030.08714.65
5.3.160.0100.06314.56
5.3.150.0070.07014.65
5.3.140.0070.05014.40
5.3.130.0070.07314.39
5.3.120.0100.05014.55
5.3.110.0070.07714.74
5.3.100.0070.05014.12
5.3.90.0030.05314.01
5.3.80.0030.05714.11
5.3.70.0070.06014.00
5.3.60.0100.06314.09
5.3.50.0030.05013.95
5.3.40.0030.05013.79
5.3.30.0070.07014.01
5.3.20.0070.05013.69
5.3.10.0100.04313.75
5.3.00.0070.06713.64
5.2.170.0030.04011.13
5.2.160.0000.04311.13
5.2.150.0030.04311.11
5.2.140.0030.04011.13
5.2.130.0100.05011.05
5.2.120.0100.03011.07
5.2.110.0030.03711.17
5.2.100.0030.03711.07
5.2.90.0070.04011.12
5.2.80.0030.04711.17
5.2.70.0030.05710.92
5.2.60.0030.05711.14
5.2.50.0070.04311.02
5.2.40.0070.03311.13
5.2.30.0070.03710.96
5.2.20.0030.04011.05
5.2.10.0030.04010.84
5.2.00.0030.04010.80
5.1.60.0000.04710.24
5.1.50.0000.04310.24
5.1.40.0100.04010.24
5.1.30.0030.05010.24
5.1.20.0070.04710.44
5.1.10.0030.03710.24
5.1.00.0000.03710.24
5.0.50.0030.03710.24
5.0.40.0070.02310.24
5.0.30.0070.05710.24
5.0.20.0000.03710.24
5.0.10.0000.03010.24
5.0.00.0100.03310.24
4.4.90.0030.02010.24
4.4.80.0070.02310.24
4.4.70.0070.02710.24
4.4.60.0000.02310.24
4.4.50.0000.02310.24
4.4.40.0030.04010.24
4.4.30.0000.02310.24
4.4.20.0030.02010.24
4.4.10.0000.02310.24
4.4.00.0000.04010.24
4.3.110.0030.03010.24
4.3.100.0070.01710.24
4.3.90.0000.02010.24
4.3.80.0000.03310.24
4.3.70.0000.02010.24
4.3.60.0070.02010.24
4.3.50.0030.03010.24
4.3.40.0070.02710.24
4.3.30.0070.02010.24
4.3.20.0030.02010.24
4.3.10.0000.02310.24
4.3.00.0100.0206.09

preferences:
53.14 ms | 401 KiB | 5 Q