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 4. No redefining $test 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 $this->callback = function() { var_dump('asd'); }; // 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.0180.00418.11
8.3.50.0100.00621.94
8.3.40.0060.00918.84
8.3.30.0080.00819.23
8.3.20.0040.00420.34
8.3.10.0040.00421.73
8.3.00.0040.00422.58
8.2.180.0070.01116.88
8.2.170.0090.00622.96
8.2.160.0130.00620.40
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0090.00017.63
8.2.110.0060.00322.09
8.2.100.0040.00817.72
8.2.90.0030.00619.09
8.2.80.0000.00817.97
8.2.70.0070.00317.50
8.2.60.0040.00417.80
8.2.50.0030.00618.07
8.2.40.0070.00218.03
8.2.30.0040.00417.93
8.2.20.0050.00317.65
8.2.10.0040.00419.39
8.2.00.0050.00217.69
8.1.280.0110.00425.92
8.1.270.0040.00422.19
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00323.87
8.1.230.0090.00319.15
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0040.00417.11
8.1.190.0040.00417.53
8.1.180.0090.00018.10
8.1.170.0040.00418.51
8.1.160.0050.00221.93
8.1.150.0000.00718.63
8.1.140.0020.00517.40
8.1.130.0050.00317.85
8.1.120.0000.00717.37
8.1.110.0070.00017.38
8.1.100.0000.00817.47
8.1.90.0070.00017.35
8.1.80.0040.00417.30
8.1.70.0000.00717.31
8.1.60.0000.00817.57
8.1.50.0040.00417.41
8.1.40.0050.00517.51
8.1.30.0040.00417.48
8.1.20.0000.00817.69
8.1.10.0040.00417.47
8.1.00.0030.00517.45
8.0.300.0040.00418.77
8.0.290.0030.00517.05
8.0.280.0070.00018.38
8.0.270.0030.00317.13
8.0.260.0030.00516.82
8.0.250.0080.00016.93
8.0.240.0050.00216.87
8.0.230.0040.00416.85
8.0.220.0030.00316.96
8.0.210.0040.00416.93
8.0.200.0000.00717.03
8.0.190.0000.00716.93
8.0.180.0020.00516.93
8.0.170.0000.00716.96
8.0.160.0040.00416.78
8.0.150.0040.00416.86
8.0.140.0000.00716.88
8.0.130.0060.00013.29
8.0.120.0040.00416.98
8.0.110.0050.00216.75
8.0.100.0070.00016.82
8.0.90.0000.00716.99
8.0.80.0000.01516.91
8.0.70.0040.00416.93
8.0.60.0040.00416.80
8.0.50.0040.00416.92
8.0.30.0150.00317.00
8.0.20.0110.00717.40
8.0.10.0030.00516.89
8.0.00.0070.01216.62
7.4.330.0000.00515.00
7.4.320.0090.00016.67
7.4.300.0030.00316.47
7.4.290.0030.00316.61
7.4.280.0000.00716.55
7.4.270.0050.00316.51
7.4.260.0060.00316.42
7.4.250.0000.00716.41
7.4.240.0060.00116.47
7.4.230.0040.00416.64
7.4.220.0040.01416.51
7.4.210.0100.00516.58
7.4.200.0000.00716.43
7.4.190.0000.00716.38
7.4.160.0170.00016.43
7.4.150.0110.00717.40
7.4.140.0100.01017.86
7.4.130.0110.00916.61
7.4.120.0110.00616.53
7.4.110.0110.00516.59
7.4.100.0180.00616.40
7.4.90.0130.00616.55
7.4.80.0060.01219.39
7.4.70.0060.01016.63
7.4.60.0140.00416.64
7.4.50.0090.00016.66
7.4.40.0070.00722.77
7.4.30.0110.00816.61
7.4.00.0070.00714.98
7.3.330.0030.00313.14
7.3.320.0000.00513.24
7.3.310.0070.00016.34
7.3.300.0000.00716.27
7.3.290.0040.01516.22
7.3.280.0090.00816.29
7.3.270.0070.01017.40
7.3.260.0110.00616.34
7.3.250.0140.00616.41
7.3.240.0100.01316.50
7.3.230.0130.00416.39
7.3.210.0110.00716.48
7.3.200.0060.01219.39
7.3.190.0050.01316.32
7.3.180.0090.00616.48
7.3.170.0130.00716.40
7.3.160.0130.00316.57
7.3.120.0030.01014.66
7.2.330.0040.01416.55
7.2.320.0090.00916.63
7.2.310.0120.01216.73
7.2.300.0040.01616.43
7.2.290.0060.01216.71
7.2.60.0080.00316.76
7.2.50.0070.00716.80
7.1.200.0090.00315.35
7.1.70.0030.01416.96
7.1.60.0000.01117.09
7.1.50.0130.01016.83
7.1.00.0070.07322.44
7.0.200.0040.00416.72
7.0.140.0070.07021.94
7.0.60.0100.07719.91
7.0.50.0000.04717.89
7.0.40.0130.03719.96
7.0.30.0470.04020.09
7.0.20.0070.06020.23
7.0.10.0130.04720.23
7.0.00.0130.07320.24
5.6.280.0100.06720.90
5.6.210.0130.06720.63
5.6.200.0100.08718.19
5.6.190.0070.08720.46
5.6.180.0100.04320.47
5.6.170.0270.07320.46
5.6.160.0130.05020.52
5.6.150.0000.07318.18
5.6.140.0070.04718.18
5.6.130.0070.08018.21
5.6.120.0070.07721.03
5.6.110.0070.05721.00
5.6.100.0170.07720.98
5.6.90.0170.07321.02
5.6.80.0070.06320.45
5.6.70.0270.07720.27
5.5.350.0000.08720.34
5.5.340.0070.03717.95
5.5.330.0070.05020.27
5.5.320.0270.03320.25
5.5.310.0230.04020.51
5.5.300.0070.08017.96
5.5.290.0070.06718.08
5.5.280.0070.05020.69
5.5.270.0100.06020.73
5.5.260.0000.05320.77
5.5.250.0100.08020.62
5.5.240.0030.04320.16
5.4.450.0430.06019.34
5.4.440.0600.06019.47
5.4.430.0330.05019.58
5.4.420.0230.04319.57
5.4.410.0070.05719.22
5.4.400.0200.04318.87
5.4.390.0130.04718.77
5.4.380.0270.05318.53
5.4.370.0230.04718.71
5.4.360.0230.04718.78
5.4.350.0230.05018.73
5.4.340.0170.05318.58
5.4.320.0030.04012.51
5.4.310.0050.04612.50
5.4.300.0090.03312.51
5.4.290.0070.04012.50
5.4.280.0080.03612.40
5.4.270.0200.06019.00
5.4.260.0070.05718.91
5.4.250.0100.05718.93
5.4.240.0330.05719.08
5.4.230.0200.04718.97
5.4.220.0070.06719.14
5.4.210.0270.06319.22
5.4.200.0070.07019.04
5.4.190.0170.07018.99
5.4.180.0100.05318.96
5.4.170.0170.07019.00
5.4.160.0200.06318.98
5.4.150.0030.08019.08
5.4.140.0100.05316.62
5.4.130.0070.05716.41
5.4.120.0070.05316.63
5.4.110.0170.04316.64
5.4.100.0100.05016.57
5.4.90.0100.05016.57
5.4.80.0100.05716.67
5.4.70.0130.06716.67
5.4.60.0070.05316.68
5.4.50.0030.05716.60
5.4.40.0030.05316.44
5.4.30.0070.07316.39
5.4.20.0100.07016.66
5.4.10.0230.05316.39
5.4.00.0100.06716.09
5.3.290.0090.04312.80
5.3.280.0100.05314.48
5.3.270.0230.05314.82
5.3.260.0100.06014.89
5.3.250.0370.04014.61
5.3.240.0000.08314.61
5.3.230.0200.07014.88
5.3.220.0130.07314.89
5.3.210.0070.06714.70
5.3.200.0170.04314.57
5.3.190.0070.05014.75
5.3.180.0070.06714.57
5.3.170.0170.07314.63
5.3.160.0130.07014.80
5.3.150.0200.05014.57
5.3.140.0100.06714.83
5.3.130.0100.06714.55
5.3.120.0170.06314.61
5.3.110.0130.05314.82
5.3.100.0030.07014.03
5.3.90.0000.06313.90
5.3.80.0070.05014.32
5.3.70.0170.05314.22
5.3.60.0030.05714.23
5.3.50.0170.06014.13
5.3.40.0170.06014.01
5.3.30.0130.06314.18
5.3.20.0030.05713.75
5.3.10.0100.06313.77
5.3.00.0070.07013.76
5.2.170.0030.04711.38
5.2.160.0100.04711.33
5.2.150.0100.04311.14
5.2.140.0130.05011.41
5.2.130.0100.05711.16
5.2.120.0130.04711.40
5.2.110.0070.05311.13
5.2.100.0100.05711.10
5.2.90.0030.04011.31
5.2.80.0130.03711.21
5.2.70.0070.05311.21
5.2.60.0170.04311.24
5.2.50.0000.05311.33
5.2.40.0100.04711.30
5.2.30.0070.05311.14
5.2.20.0070.05011.27
5.2.10.0130.03311.07
5.2.00.0070.03710.85
5.1.60.0100.02710.09
5.1.50.0070.03310.09
5.1.40.0100.0409.86
5.1.30.0100.04010.63
5.1.20.0030.05310.64
5.1.10.0100.04710.23
5.1.00.0030.03710.36
5.0.50.0000.0338.87
5.0.40.0130.0308.75
5.0.30.0100.0508.38
5.0.20.0000.0378.28
5.0.10.0100.0238.34
5.0.00.0030.0608.32
4.4.90.0070.0208.85
4.4.80.0100.0277.44
4.4.70.0030.0207.44
4.4.60.0000.0237.44
4.4.50.0030.0207.44
4.4.40.0070.0437.44
4.4.30.0130.0207.44
4.4.20.0000.0337.44
4.4.10.0000.0237.44
4.4.00.0000.0377.44
4.3.110.0000.0237.44
4.3.100.0030.0277.44
4.3.90.0000.0277.44
4.3.80.0030.0477.44
4.3.70.0030.0207.44
4.3.60.0030.0207.44
4.3.50.0000.0277.44
4.3.40.0070.0337.44
4.3.30.0000.0237.44
4.3.20.0030.0307.44
4.3.10.0030.0307.44
4.3.00.0030.0204.48

preferences:
41.53 ms | 401 KiB | 5 Q