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->callback = 'hello'; function hello(){ echo 'Hi'; } // 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.0070.00719.03
8.3.30.0030.01020.26
8.3.20.0040.00420.29
8.3.10.0080.00022.10
8.3.00.0050.00322.51
8.2.170.0100.00322.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0140.00426.16
8.2.120.0100.00017.80
8.2.110.0100.00022.25
8.2.100.0040.00719.21
8.2.90.0050.00319.05
8.2.80.0000.00819.21
8.2.70.0030.00517.75
8.2.60.0060.00317.80
8.2.50.0060.00318.07
8.2.40.0030.00518.22
8.2.30.0050.00218.07
8.2.20.0080.00017.66
8.2.10.0020.00517.75
8.2.00.0000.00817.82
8.1.270.0040.00424.66
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0060.00323.92
8.1.230.0090.00319.15
8.1.220.0000.00817.76
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0030.00517.30
8.1.180.0050.00318.82
8.1.170.0050.00318.45
8.1.160.0050.00222.16
8.1.150.0040.00418.55
8.1.140.0000.00717.26
8.1.130.0070.00017.82
8.1.120.0040.00417.45
8.1.110.0000.00717.37
8.1.100.0050.00317.46
8.1.90.0040.00317.32
8.1.80.0080.00017.40
8.1.70.0000.00717.31
8.1.60.0040.00417.60
8.1.50.0080.00017.58
8.1.40.0070.00017.44
8.1.30.0000.00817.56
8.1.20.0040.00417.61
8.1.10.0000.00717.57
8.1.00.0040.00417.43
8.0.300.0000.00818.77
8.0.290.0000.00717.05
8.0.280.0000.00818.39
8.0.270.0000.00717.13
8.0.260.0030.00316.71
8.0.250.0030.00316.97
8.0.240.0030.00516.99
8.0.230.0030.00316.88
8.0.220.0000.00716.97
8.0.210.0070.00016.90
8.0.200.0000.00716.89
8.0.190.0040.00416.98
8.0.180.0040.00416.83
8.0.170.0000.00716.89
8.0.160.0000.00716.80
8.0.150.0040.00416.90
8.0.140.0040.00416.83
8.0.130.0030.00313.41
8.0.120.0040.00416.86
8.0.110.0000.00716.88
8.0.100.0000.00716.81
8.0.90.0040.00416.86
8.0.80.0110.00716.86
8.0.70.0050.00216.82
8.0.60.0030.00516.75
8.0.50.0070.00016.97
8.0.30.0140.00517.06
8.0.20.0080.01117.40
8.0.10.0040.00416.90
8.0.00.0160.00316.83
7.4.330.0070.00015.00
7.4.320.0000.00816.59
7.4.300.0030.00316.54
7.4.290.0090.00016.63
7.4.280.0040.00416.51
7.4.270.0000.00716.54
7.4.260.0070.00016.52
7.4.250.0000.00716.41
7.4.240.0010.00616.56
7.4.230.0050.00316.51
7.4.220.0100.00716.55
7.4.210.0090.00716.64
7.4.200.0030.00316.46
7.4.190.0000.00816.77
7.4.160.0130.00316.70
7.4.150.0140.00717.40
7.4.140.0100.00717.86
7.4.130.0100.00816.54
7.4.120.0090.00816.49
7.4.110.0060.01216.55
7.4.100.0060.01216.67
7.4.90.0070.01016.42
7.4.80.0120.00619.39
7.4.70.0030.01316.46
7.4.60.0100.00616.73
7.4.50.0020.00216.40
7.4.40.0070.00722.77
7.4.30.0100.00516.57
7.4.00.0110.00415.16
7.3.330.0020.00213.43
7.3.320.0000.00513.30
7.3.310.0080.00016.41
7.3.300.0070.00016.31
7.3.290.0030.01416.44
7.3.280.0080.00916.42
7.3.270.0140.00317.40
7.3.260.0070.01016.60
7.3.250.0070.01016.54
7.3.240.0040.01516.34
7.3.230.0080.00916.64
7.3.210.0090.00916.52
7.3.200.0070.01119.39
7.3.190.0170.00016.57
7.3.180.0010.00716.54
7.3.170.0060.00916.31
7.3.160.0140.00316.61
7.3.120.0090.00614.82
7.2.330.0160.00716.72
7.2.320.0060.01716.73
7.2.310.0070.01016.83
7.2.300.0030.01416.73
7.2.290.0150.00616.46
7.2.60.0000.01516.85
7.2.00.0040.00819.65
7.1.200.0100.00315.55
7.1.100.0060.00618.07
7.1.70.0000.00917.23
7.1.60.0100.01419.43
7.1.50.0060.01916.89
7.1.00.0030.03322.57
7.0.200.0000.00816.61
7.0.140.0030.07321.92
7.0.60.0100.08320.09
7.0.50.0200.07717.89
7.0.40.0100.04320.11
7.0.30.0270.07320.30
7.0.20.0270.07020.10
7.0.10.0130.08020.05
7.0.00.0100.03720.16
5.6.210.0030.08720.47
5.6.200.0070.04318.27
5.6.190.0070.08720.61
5.6.180.0070.06320.61
5.6.170.0400.06320.62
5.6.160.0130.06720.52
5.6.150.0070.07718.16
5.6.140.0030.08718.19
5.6.130.0070.08318.12
5.6.120.0000.05721.06
5.6.110.0030.07021.03
5.6.100.0070.08320.98
5.6.90.0230.07320.98
5.6.80.0100.08020.51
5.5.350.0030.08320.33
5.5.340.0070.07017.98
5.5.330.0070.08020.21
5.5.320.0300.04320.27
5.5.310.0200.05020.30
5.5.300.0130.07318.01
5.5.290.0100.03718.08
5.5.280.0070.04720.99
5.5.270.0100.07320.85
5.5.260.0200.07020.80
5.5.250.0070.08020.70
5.5.240.0200.05320.16
5.4.450.0470.04719.57
5.4.440.0570.03719.30
5.4.430.0770.03319.19
5.4.420.0170.04719.68
5.4.410.0100.05719.36
5.4.400.0000.06019.22
5.4.390.0170.04719.16
5.4.380.0130.05719.09
5.4.370.0070.05719.21
5.4.360.0000.06019.11
5.4.350.0060.03812.02
5.4.340.0060.04012.02
5.4.320.0050.03812.51
5.4.310.0030.03912.50
5.4.300.0060.03912.51
5.4.290.0070.04712.50
5.4.280.0070.04212.40
5.4.270.0040.03812.40
5.4.260.0040.03812.40
5.4.250.0100.05318.95
5.4.240.0130.05318.67
5.4.230.0070.05018.66
5.4.220.0070.07319.03
5.4.210.0130.04718.77
5.4.200.0130.04718.95
5.4.190.0070.07018.77
5.4.180.0200.04318.84
5.4.170.0130.05318.96
5.4.160.0170.04318.93
5.4.150.0100.05318.79
5.4.140.0170.05316.44
5.4.130.0200.03716.44
5.4.120.0100.04716.47
5.4.110.0170.04016.55
5.4.100.0070.05016.61
5.4.90.0170.04016.61
5.4.80.0100.04716.53
5.4.70.0070.05016.45
5.4.60.0100.04716.60
5.4.50.0100.04716.63
5.4.40.0070.05016.45
5.4.30.0100.04716.50
5.4.20.0030.07016.45
5.4.10.0070.05316.48
5.4.00.0100.04715.77
5.3.290.0060.04412.80
5.3.280.0100.05014.62
5.3.270.0100.06314.64
5.3.260.0130.05014.63
5.3.250.0000.08314.60
5.3.240.0100.05014.75
5.3.230.0000.06314.69
5.3.220.0000.05314.66
5.3.210.0100.05014.66
5.3.200.0130.04314.40
5.3.190.0030.05714.54
5.3.180.0100.05314.56
5.3.170.0130.04014.56
5.3.160.0130.05014.75
5.3.150.0130.04714.57
5.3.140.0030.05314.54
5.3.130.0230.06014.66
5.3.120.0070.05314.77
5.3.110.0070.05714.54
5.3.100.0070.05014.02
5.3.90.0100.04714.11
5.3.80.0000.05313.85
5.3.70.0100.04713.93
5.3.60.0070.05014.19
5.3.50.0070.05014.02
5.3.40.0200.06713.85
5.3.30.0070.04713.98
5.3.20.0100.04713.92
5.3.10.0130.04313.56
5.3.00.0170.06713.73
5.2.170.0100.03711.15
5.2.160.0100.03311.15
5.2.150.0000.04311.23
5.2.140.0100.04711.24
5.2.130.0070.03711.09
5.2.120.0070.04011.29
5.2.110.0130.04311.18
5.2.100.0030.04011.06
5.2.90.0070.04311.21
5.2.80.0030.04711.10
5.2.70.0070.04011.27
5.2.60.0030.04710.91
5.2.50.0070.04311.00
5.2.40.0030.04311.09
5.2.30.0000.04311.07
5.2.20.0000.04311.04
5.2.10.0100.03310.82
5.2.00.0030.04310.80
5.1.60.0070.03310.16
5.1.50.0070.05010.05
5.1.40.0070.03010.05
5.1.30.0070.03310.32
5.1.20.0070.03710.26
5.1.10.0070.03310.13
5.1.00.0030.03710.11
5.0.50.0000.0308.50
5.0.40.0030.0308.40
5.0.30.0000.0508.20
5.0.20.0070.0238.12
5.0.10.0030.0278.11
5.0.00.0100.0438.41
4.4.90.0000.0337.38
4.4.80.0000.0307.38
4.4.70.0000.0277.38
4.4.60.0000.0237.38
4.4.50.0000.0237.38
4.4.40.0070.0307.38
4.4.30.0070.0177.38
4.4.20.0030.0207.38
4.4.10.0070.0237.38
4.4.00.0000.0377.38
4.3.110.0000.0237.38
4.3.100.0070.0177.38
4.3.90.0030.0237.38
4.3.80.0000.0377.38
4.3.70.0030.0207.38
4.3.60.0030.0207.37
4.3.50.0000.0237.37
4.3.40.0000.0337.37
4.3.30.0100.0137.37
4.3.20.0030.0207.37
4.3.10.0070.0177.37
4.3.00.0070.01714.48

preferences:
45.34 ms | 400 KiB | 5 Q