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 $test = Test('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.0000.01518.31
8.3.50.0090.00721.09
8.3.40.0120.00318.69
8.3.30.0070.01020.38
8.3.20.0050.00320.34
8.3.10.0000.00822.09
8.3.00.0050.00322.58
8.2.180.0040.01817.00
8.2.170.0110.00422.96
8.2.160.0100.00320.53
8.2.150.0080.00024.18
8.2.140.0120.00424.66
8.2.130.0120.00326.16
8.2.120.0080.00019.44
8.2.110.0090.00019.11
8.2.100.0080.00417.59
8.2.90.0040.00419.08
8.2.80.0040.00419.46
8.2.70.0000.00917.63
8.2.60.0050.00317.91
8.2.50.0030.00518.07
8.2.40.0040.00418.21
8.2.30.0080.00017.92
8.2.20.0000.00717.59
8.2.10.0000.00917.70
8.2.00.0040.00417.71
8.1.280.0140.00025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00323.65
8.1.230.0040.00720.96
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0000.00817.35
8.1.190.0080.00017.53
8.1.180.0030.00620.30
8.1.170.0040.00418.49
8.1.160.0000.00722.15
8.1.150.0000.00818.53
8.1.140.0000.00817.41
8.1.130.0080.00017.91
8.1.120.0000.00717.38
8.1.110.0070.00017.44
8.1.100.0040.00417.41
8.1.90.0050.00317.32
8.1.80.0070.00017.37
8.1.70.0070.00017.42
8.1.60.0000.00817.47
8.1.50.0030.00617.54
8.1.40.0040.00417.36
8.1.30.0000.00717.52
8.1.20.0000.00817.64
8.1.10.0070.00017.51
8.1.00.0000.00717.46
8.0.300.0080.00018.77
8.0.290.0070.00016.93
8.0.280.0120.00018.25
8.0.270.0030.00317.21
8.0.260.0030.00316.83
8.0.250.0000.00716.87
8.0.240.0040.00416.92
8.0.230.0070.00016.97
8.0.220.0070.00016.82
8.0.210.0000.00716.97
8.0.200.0030.00316.86
8.0.190.0090.00016.88
8.0.180.0030.00516.93
8.0.170.0080.00016.79
8.0.160.0030.00416.93
8.0.150.0000.00716.68
8.0.140.0050.00316.90
8.0.130.0000.00513.31
8.0.120.0060.00316.89
8.0.110.0040.00416.95
8.0.100.0000.00716.73
8.0.90.0050.00216.97
8.0.80.0040.01116.93
8.0.70.0000.00716.82
8.0.60.0020.00516.86
8.0.50.0000.00816.91
8.0.30.0110.01017.13
8.0.20.0100.01017.40
8.0.10.0050.00317.02
8.0.00.0070.01516.82
7.4.330.0050.00015.00
7.4.320.0000.00616.37
7.4.300.0030.00316.41
7.4.290.0050.00216.52
7.4.280.0060.00016.64
7.4.270.0070.00016.53
7.4.260.0070.00016.48
7.4.250.0000.00716.59
7.4.240.0020.00516.64
7.4.230.0000.00716.41
7.4.220.0160.00016.63
7.4.210.0060.01016.52
7.4.200.0000.00816.49
7.4.190.0040.00416.79
7.4.160.0150.00616.57
7.4.150.0030.01417.40
7.4.140.0090.01017.86
7.4.130.0050.01316.47
7.4.120.0100.01016.60
7.4.110.0030.01316.64
7.4.100.0140.00316.38
7.4.90.0170.00016.43
7.4.80.0100.01019.39
7.4.70.0090.01316.57
7.4.60.0030.01316.40
7.4.50.0080.00016.29
7.4.40.0030.01422.77
7.4.30.0160.00016.46
7.4.00.0090.00615.10
7.3.330.0030.00313.28
7.3.320.0030.00313.30
7.3.310.0020.00516.21
7.3.300.0000.00716.30
7.3.290.0070.00716.27
7.3.280.0060.01016.30
7.3.270.0070.01117.40
7.3.260.0130.00416.50
7.3.250.0110.00616.47
7.3.240.0090.00916.59
7.3.230.0130.00716.39
7.3.210.0130.00416.18
7.3.200.0070.01319.39
7.3.190.0120.00616.50
7.3.180.0090.00616.24
7.3.170.0120.01316.39
7.3.160.0060.01516.45
7.3.120.0060.00614.66
7.2.330.0090.00916.58
7.2.320.0100.01016.58
7.2.310.0060.01016.64
7.2.300.0160.00016.63
7.2.290.0090.00616.36
7.2.60.0040.00716.66
7.1.200.0170.00211.43
7.1.100.0040.00817.81
7.1.70.0000.01016.90
7.1.60.0040.01919.43
7.1.50.0080.00416.44
7.1.00.0030.05322.57
7.0.200.0270.00314.88
7.0.140.0130.06321.99
7.0.60.0100.07319.95
7.0.50.0030.04017.87
7.0.40.0070.04320.20
7.0.30.0400.04320.16
7.0.20.0270.03320.23
7.0.10.0270.06320.25
7.0.00.0130.07320.25
5.6.280.0030.07021.09
5.6.210.0100.08720.75
5.6.200.0030.05018.25
5.6.190.0030.07320.42
5.6.180.0300.06020.60
5.6.170.0270.07320.50
5.6.160.0070.04320.62
5.6.150.0130.06018.16
5.6.140.0100.07718.24
5.6.130.0030.08018.29
5.6.120.0130.07021.15
5.6.110.0030.08321.14
5.6.100.0130.07320.99
5.6.90.0200.07721.10
5.6.80.0170.04320.54
5.6.70.2530.03320.39
5.5.350.0100.07020.41
5.5.340.0030.04717.96
5.5.330.0030.07720.19
5.5.320.0300.04320.19
5.5.310.0130.04320.30
5.5.300.0030.07718.04
5.5.290.0130.05317.99
5.5.280.0000.09020.78
5.5.270.0030.04020.84
5.5.260.0100.05320.76
5.5.250.0070.06720.69
5.5.240.0200.02720.07
5.4.450.0770.06719.46
5.4.440.1000.06719.21
5.4.430.1100.05319.38
5.4.420.0870.05319.73
5.4.410.1070.06019.32
5.4.400.0400.04718.87
5.4.390.0330.05318.73
5.4.380.0330.06718.78
5.4.370.0070.06018.61
5.4.360.0170.06018.72
5.4.350.0090.03712.02
5.4.340.0100.04312.02
5.4.320.0030.03812.50
5.4.310.0040.03912.50
5.4.300.0050.03612.50
5.4.290.0060.04012.50
5.4.280.0040.03612.39
5.4.270.0040.04012.40
5.4.260.0050.04312.40
5.4.250.0100.05019.05
5.4.240.0130.07018.64
5.4.230.0030.06319.09
5.4.220.0170.06018.92
5.4.210.0170.04718.87
5.4.200.0070.05319.09
5.4.190.0130.07018.64
5.4.180.0070.07019.09
5.4.170.0100.05318.82
5.4.160.0100.05718.91
5.4.150.0100.05319.00
5.4.140.0030.07716.39
5.4.130.0130.04316.43
5.4.120.0130.06316.40
5.4.110.0100.07316.51
5.4.100.0070.07316.64
5.4.90.0100.04716.39
5.4.80.0130.04716.52
5.4.70.0200.06016.36
5.4.60.0130.05316.54
5.4.50.0230.03716.54
5.4.40.0100.05016.38
5.4.30.0070.05716.38
5.4.20.0030.05016.44
5.4.10.0000.06016.45
5.4.00.0200.05015.79
5.3.290.0090.03412.80
5.3.280.0100.05314.57
5.3.270.0100.06014.70
5.3.260.0130.04714.64
5.3.250.0130.04314.68
5.3.240.0130.04714.69
5.3.230.0100.05014.82
5.3.220.0100.05314.40
5.3.210.0130.05714.40
5.3.200.0200.04014.54
5.3.190.0100.05014.71
5.3.180.0100.05014.65
5.3.170.0200.06314.65
5.3.160.0100.05014.79
5.3.150.0130.04714.79
5.3.140.0100.06014.54
5.3.130.0130.05314.61
5.3.120.0070.05014.52
5.3.110.0070.05014.63
5.3.100.0130.04714.04
5.3.90.0070.05714.10
5.3.80.0130.06013.85
5.3.70.0130.04013.95
5.3.60.0100.05313.99
5.3.50.0170.06313.95
5.3.40.0070.05014.02
5.3.30.0130.06313.93
5.3.20.0030.06313.76
5.3.10.0100.04313.72
5.3.00.0070.05013.70
5.2.170.0070.04011.13
5.2.160.0030.05711.07
5.2.150.0100.04311.23
5.2.140.0100.03711.23
5.2.130.0030.04311.06
5.2.120.0030.04011.06
5.2.110.0030.05711.29
5.2.100.0000.05011.00
5.2.90.0100.03711.07
5.2.80.0030.04711.18
5.2.70.0000.04311.06
5.2.60.0030.04311.03
5.2.50.0130.04311.10
5.2.40.0030.05311.00
5.2.30.0070.05011.05
5.2.20.0070.05011.05
5.2.10.0130.04711.08
5.2.00.0030.04010.63
5.1.60.0070.03310.24
5.1.50.0000.0409.98
5.1.40.0070.0379.96
5.1.30.0070.03310.24
5.1.20.0170.02710.58
5.1.10.0130.03310.16
5.1.00.0100.03010.27
5.0.50.0070.0279.66
5.0.40.0070.0339.66
5.0.30.0030.0479.66
5.0.20.0070.0379.66
5.0.10.0030.0409.65
5.0.00.0030.0479.65
4.4.90.0000.0279.66
4.4.80.0070.0179.66
4.4.70.0000.0279.66
4.4.60.0070.0279.66
4.4.50.0000.0239.66
4.4.40.0070.0409.66
4.4.30.0100.0239.66
4.4.20.0070.0279.66
4.4.10.0100.0179.66
4.4.00.0000.0379.66
4.3.110.0000.0239.66
4.3.100.0070.0239.66
4.3.90.0070.0209.66
4.3.80.0070.0339.66
4.3.70.0000.0239.66
4.3.60.0030.0239.66
4.3.50.0030.0209.66
4.3.40.0070.0309.66
4.3.30.0030.0209.66
4.3.20.0000.0279.66
4.3.10.0000.0239.66
4.3.00.0070.0175.85

preferences:
35.29 ms | 401 KiB | 5 Q