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 (new Test)->secret('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.40.0140.00018.85
8.3.30.0110.00719.94
8.3.20.0060.00320.34
8.3.10.0040.00421.92
8.3.00.0050.00322.46
8.2.170.0110.00322.96
8.2.160.0100.00320.35
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0120.00326.16
8.2.120.0090.00619.41
8.2.110.0030.00622.13
8.2.100.0080.00419.44
8.2.90.0000.00719.05
8.2.80.0040.00419.09
8.2.70.0040.00417.50
8.2.60.0030.00617.78
8.2.50.0050.00318.07
8.2.40.0000.00818.02
8.2.30.0050.00317.98
8.2.20.0000.00717.66
8.2.10.0040.00417.76
8.2.00.0050.00217.57
8.1.270.0040.00424.66
8.1.260.0110.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.98
8.1.230.0120.00019.08
8.1.220.0000.00717.74
8.1.210.0050.00318.77
8.1.200.0030.00617.22
8.1.190.0080.00017.39
8.1.180.0000.00820.29
8.1.170.0030.00618.48
8.1.160.0040.00422.06
8.1.150.0000.00718.52
8.1.140.0040.00417.31
8.1.130.0030.00717.88
8.1.120.0040.00417.43
8.1.110.0040.00417.30
8.1.100.0040.00317.41
8.1.90.0000.00717.23
8.1.80.0040.00417.42
8.1.70.0070.00017.42
8.1.60.0060.00317.55
8.1.50.0070.00017.52
8.1.40.0000.00717.39
8.1.30.0020.00517.61
8.1.20.0050.00317.56
8.1.10.0000.00817.52
8.1.00.0030.00917.49
8.0.300.0040.00418.77
8.0.290.0000.00817.18
8.0.280.0040.00418.39
8.0.270.0000.00717.11
8.0.260.0030.00316.84
8.0.250.0000.00716.99
8.0.240.0050.00316.98
8.0.230.0000.00716.95
8.0.220.0000.00716.92
8.0.210.0000.00716.84
8.0.200.0060.00016.96
8.0.190.0000.00716.99
8.0.180.0080.00416.86
8.0.170.0040.00416.93
8.0.160.0070.00016.78
8.0.150.0040.00416.85
8.0.140.0000.00816.87
8.0.130.0000.00513.29
8.0.120.0000.00816.79
8.0.110.0050.00216.86
8.0.100.0030.00416.84
8.0.90.0030.00316.91
8.0.80.0100.00716.85
8.0.70.0000.00717.02
8.0.60.0070.00016.72
8.0.50.0070.00016.90
8.0.30.0160.00716.96
8.0.20.0090.01017.40
8.0.10.0000.00716.88
8.0.00.0070.01016.88
7.4.330.0020.00215.00
7.4.320.0000.00616.47
7.4.300.0030.00316.62
7.4.290.0000.00816.41
7.4.280.0030.00316.61
7.4.270.0000.00716.61
7.4.260.0040.00416.56
7.4.250.0030.00616.62
7.4.240.0040.00316.63
7.4.230.0030.00316.68
7.4.220.0040.01116.63
7.4.210.0090.00516.47
7.4.200.0030.00316.59
7.4.190.0000.00716.61
7.4.160.0060.01016.53
7.4.150.0120.00617.40
7.4.140.0110.01017.86
7.4.130.0070.01216.60
7.4.120.0100.00716.53
7.4.110.0030.01316.38
7.4.100.0090.00916.43
7.4.90.0130.00716.43
7.4.80.0090.00919.39
7.4.70.0100.00716.77
7.4.60.0120.00316.56
7.4.50.0030.00616.32
7.4.40.0070.00722.77
7.4.30.0100.00716.37
7.4.00.0060.00814.88
7.3.330.0050.00013.30
7.3.320.0000.00513.07
7.3.310.0080.00016.31
7.3.300.0030.00316.26
7.3.290.0060.01316.21
7.3.280.0020.01216.28
7.3.270.0030.01317.40
7.3.260.0110.00616.59
7.3.250.0120.00916.28
7.3.240.0070.01016.43
7.3.230.0070.01016.41
7.3.210.0130.00616.54
7.3.200.0090.01319.39
7.3.190.0170.00616.31
7.3.180.0060.00916.31
7.3.170.0060.01316.54
7.3.160.0090.00616.59
7.3.120.0070.01114.90
7.2.330.0140.00416.66
7.2.320.0070.01016.78
7.2.310.0030.01316.61
7.2.300.0110.00716.42
7.2.290.0070.01016.53
7.2.60.0140.00316.71
7.2.00.0000.01219.52
7.1.200.0100.00715.64
7.1.100.0090.00618.06
7.1.70.0000.00817.05
7.1.60.0100.01419.43
7.1.50.0130.01016.85
7.1.00.0000.03722.44
7.0.200.0140.00314.75
7.0.140.0070.07022.08
7.0.60.0100.07719.94
7.0.50.0100.04317.88
7.0.40.0030.05020.11
7.0.30.0270.05020.17
7.0.20.0170.05720.21
7.0.10.0230.04720.24
7.0.00.0100.08720.21
5.6.280.0070.07021.00
5.6.210.0130.07320.71
5.6.200.0000.06718.16
5.6.190.0130.06320.46
5.6.180.0300.07720.77
5.6.170.0200.07020.50
5.6.160.0030.05720.50
5.6.150.0070.06318.16
5.6.140.0130.07718.12
5.6.130.0130.07018.18
5.6.120.0000.04321.15
5.6.110.0030.07721.11
5.6.100.0070.05720.98
5.6.90.0100.07720.98
5.6.80.0030.04020.43
5.6.70.0200.05320.52
5.5.350.0070.07320.37
5.5.340.0070.03718.04
5.5.330.0100.03720.19
5.5.320.0230.07320.27
5.5.310.0170.04320.35
5.5.300.0070.04318.09
5.5.290.0070.05718.08
5.5.280.0170.07320.88
5.5.270.0070.04020.79
5.5.260.0100.09020.87
5.5.250.0030.08720.75
5.5.240.0000.06320.19
5.4.450.0700.05719.16
5.4.440.1200.05719.58
5.4.430.1130.05019.38
5.4.420.1170.05019.61
5.4.410.1000.05019.41
5.4.400.0370.04718.76
5.4.390.0430.04318.74
5.4.380.0070.06718.50
5.4.370.0170.05018.52
5.4.360.0100.05718.80
5.4.350.0050.04112.02
5.4.340.0040.03912.02
5.4.320.0060.04412.50
5.4.310.0070.04112.50
5.4.300.0080.04912.50
5.4.290.0090.03512.50
5.4.280.0080.03912.40
5.4.270.0090.04712.40
5.4.260.0040.04012.39
5.4.250.0030.07718.80
5.4.240.0070.05318.99
5.4.230.0070.05318.76
5.4.220.0130.05019.02
5.4.210.0170.05019.00
5.4.200.0030.07318.79
5.4.190.0030.06018.99
5.4.180.0100.04718.98
5.4.170.0070.05719.09
5.4.160.0100.05018.79
5.4.150.0100.05018.94
5.4.140.0170.04016.56
5.4.130.0070.04716.31
5.4.120.0100.04316.43
5.4.110.0100.05016.48
5.4.100.0100.05016.65
5.4.90.0070.05716.40
5.4.80.0000.05716.50
5.4.70.0000.07316.55
5.4.60.0000.07016.62
5.4.50.0170.04316.38
5.4.40.0070.05016.56
5.4.30.0100.04716.33
5.4.20.0070.05316.34
5.4.10.0000.06316.53
5.4.00.0100.04315.94
5.3.290.0020.04212.80
5.3.280.0200.03714.61
5.3.270.0130.04314.68
5.3.260.0000.05714.78
5.3.250.0100.05714.77
5.3.240.0100.04714.63
5.3.230.0100.05714.60
5.3.220.0100.07014.40
5.3.210.0070.05314.65
5.3.200.0030.05014.40
5.3.190.0170.04314.66
5.3.180.0170.05714.56
5.3.170.0130.06314.64
5.3.160.0070.05314.40
5.3.150.0100.05314.55
5.3.140.0070.06314.74
5.3.130.0070.05714.54
5.3.120.0030.05314.73
5.3.110.0070.08014.45
5.3.100.0070.05014.11
5.3.90.0070.05013.93
5.3.80.0070.04714.10
5.3.70.0000.05314.03
5.3.60.0130.04014.20
5.3.50.0100.04314.02
5.3.40.0100.04714.18
5.3.30.0070.04713.90
5.3.20.0070.05013.68
5.3.10.0030.05013.73
5.3.00.0030.07713.63
5.2.170.0100.04011.21
5.2.160.0030.04011.15
5.2.150.0030.04311.12
5.2.140.0030.05010.98
5.2.130.0030.04011.17
5.2.120.0030.04011.18
5.2.110.0100.03311.19
5.2.100.0100.03311.09
5.2.90.0100.03710.93
5.2.80.0100.03711.32
5.2.70.0030.04310.92
5.2.60.0070.05311.13
5.2.50.0070.03710.86
5.2.40.0070.05011.09
5.2.30.0030.06310.95
5.2.20.0070.04010.93
5.2.10.0000.04310.86
5.2.00.0030.04310.73
5.1.60.0170.03010.15
5.1.50.0030.03710.16
5.1.40.0000.04010.18
5.1.30.0100.05010.43
5.1.20.0100.04310.33
5.1.10.0070.03010.16
5.1.00.0030.03710.31
5.0.50.0030.0279.66
5.0.40.0030.0379.66
5.0.30.0000.0439.66
5.0.20.0070.0239.66
5.0.10.0000.0309.66
5.0.00.0000.0539.66
4.4.90.0070.0179.66
4.4.80.0000.0339.66
4.4.70.0030.0239.66
4.4.60.0000.0239.66
4.4.50.0100.0239.66
4.4.40.0000.0479.66
4.4.30.0070.0279.66
4.4.20.0030.0239.66
4.4.10.0000.0239.66
4.4.00.0030.0379.66
4.3.110.0070.0179.66
4.3.100.0030.0209.66
4.3.90.0000.0209.66
4.3.80.0000.0339.66
4.3.70.0030.0179.66
4.3.60.0000.0209.66
4.3.50.0000.0209.66
4.3.40.0000.0339.66
4.3.30.0030.0209.66
4.3.20.0000.0239.66
4.3.10.0000.0209.66
4.3.00.0000.0235.85

preferences:
42.59 ms | 400 KiB | 5 Q