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 // 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.70.0120.00316.75
8.3.60.0060.01318.55
8.3.50.0160.00321.14
8.3.40.0070.00718.98
8.3.30.0100.00320.16
8.3.20.0040.00419.97
8.3.10.0000.00821.93
8.3.00.0050.00322.47
8.2.180.0090.00625.92
8.2.170.0150.00018.96
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0070.00719.64
8.2.110.0070.00322.24
8.2.100.0040.00719.36
8.2.90.0080.00019.05
8.2.80.0000.00819.39
8.2.70.0090.00017.63
8.2.60.0060.00318.04
8.2.50.0080.00018.07
8.2.40.0080.00018.16
8.2.30.0040.00418.07
8.2.20.0000.00817.66
8.2.10.0060.00317.57
8.2.00.0000.00717.57
8.1.280.0090.00625.92
8.1.270.0030.01324.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.96
8.1.230.0110.00019.14
8.1.220.0090.00017.74
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0000.00917.41
8.1.180.0030.00620.11
8.1.170.0040.00418.48
8.1.160.0030.00522.25
8.1.150.0040.00418.59
8.1.140.0070.00017.40
8.1.130.0030.00617.80
8.1.120.0040.00417.32
8.1.110.0030.00517.30
8.1.100.0000.00717.33
8.1.90.0030.00317.44
8.1.80.0080.00017.47
8.1.70.0000.00717.30
8.1.60.0050.00517.61
8.1.50.0040.00417.46
8.1.40.0000.00817.41
8.1.30.0000.00817.53
8.1.20.0080.00017.61
8.1.10.0030.00517.44
8.1.00.0060.00317.42
8.0.300.0040.00418.77
8.0.290.0080.00017.05
8.0.280.0060.00318.40
8.0.270.0030.00317.13
8.0.260.0000.00616.88
8.0.250.0030.00316.89
8.0.240.0000.00816.98
8.0.230.0030.00316.84
8.0.220.0040.00416.92
8.0.210.0030.00316.93
8.0.200.0030.00316.93
8.0.190.0070.00016.99
8.0.180.0000.01016.94
8.0.170.0040.00416.88
8.0.160.0040.00416.77
8.0.150.0070.00016.84
8.0.140.0040.00416.72
8.0.130.0030.00313.32
8.0.120.0080.00016.89
8.0.110.0080.00016.72
8.0.100.0030.00316.71
8.0.90.0020.00516.82
8.0.80.0000.01516.93
8.0.70.0070.00016.95
8.0.60.0030.00516.80
8.0.50.0000.00816.94
8.0.30.0130.00717.04
8.0.20.0100.01117.40
8.0.10.0070.00017.06
8.0.00.0060.01316.62
7.4.330.0050.00015.00
7.4.320.0000.00616.45
7.4.300.0050.00216.60
7.4.290.0000.00716.52
7.4.280.0070.00016.61
7.4.270.0030.00316.62
7.4.260.0000.00716.39
7.4.250.0000.00716.43
7.4.240.0040.00316.61
7.4.230.0070.00016.63
7.4.220.0130.00316.61
7.4.210.0080.00616.47
7.4.200.0000.00716.70
7.4.190.0030.00316.48
7.4.160.0090.00616.73
7.4.150.0150.00317.40
7.4.140.0120.00617.86
7.4.130.0060.01016.39
7.4.120.0150.00416.57
7.4.110.0070.01016.55
7.4.100.0090.01516.61
7.4.90.0090.00916.59
7.4.80.0110.00719.39
7.4.70.0130.01016.61
7.4.60.0130.00316.50
7.4.50.0030.00516.53
7.4.40.0060.01322.77
7.4.30.0100.00716.36
7.4.00.0090.00914.87
7.3.330.0060.00013.31
7.3.320.0030.00313.37
7.3.310.0040.00416.40
7.3.300.0030.00316.24
7.3.290.0030.01116.36
7.3.280.0080.00916.37
7.3.270.0080.00817.40
7.3.260.0130.00616.33
7.3.250.0140.00516.47
7.3.240.0070.01016.43
7.3.230.0060.01716.48
7.3.210.0130.00316.33
7.3.200.0090.00619.39
7.3.190.0090.00916.38
7.3.180.0130.00316.51
7.3.170.0190.00316.59
7.3.160.0150.00016.56
7.3.120.0050.01014.81
7.3.110.0080.00614.75
7.3.100.0040.01514.65
7.3.90.0090.00914.73
7.3.80.0060.00614.46
7.3.70.0030.01314.79
7.3.60.0000.01014.69
7.3.50.0040.01214.89
7.3.40.0120.00314.92
7.3.30.0030.00914.90
7.3.20.0000.01016.43
7.3.10.0040.01116.71
7.3.00.0100.00716.62
7.2.330.0090.00916.57
7.2.320.0140.00916.84
7.2.310.0090.00916.38
7.2.300.0060.01016.76
7.2.290.0090.00616.48
7.2.250.0040.01514.95
7.2.240.0070.01014.96
7.2.230.0090.01215.20
7.2.220.0090.00615.38
7.2.210.0000.01415.08
7.2.200.0070.00714.96
7.2.190.0060.01114.83
7.2.180.0030.01215.22
7.2.170.0080.00415.03
7.2.00.0070.00719.14
7.1.330.0090.00615.64
7.1.320.0000.01215.64
7.1.310.0060.00615.86
7.1.300.0090.00615.74
7.1.290.0060.00915.72
7.1.280.0070.00715.46
7.1.270.0000.01615.74
7.1.260.0110.00415.72
7.1.200.0000.01515.57
7.1.100.0080.00817.83
7.1.70.0000.00916.89
7.1.60.0100.01419.21
7.1.50.0060.00916.69
7.1.00.0030.03722.54
7.0.200.0170.00714.68
7.0.140.0030.07322.09
7.0.70.5030.03719.99
7.0.60.0100.08319.91
7.0.50.0030.07317.98
7.0.40.0170.07720.20
7.0.30.0530.07320.21
7.0.20.0300.07020.07
7.0.10.0330.07020.05
7.0.00.0130.04020.17
5.6.280.0070.07021.15
5.6.210.0100.06320.50
5.6.200.0030.04018.29
5.6.190.0070.04020.41
5.6.180.0130.08720.53
5.6.170.0300.05020.48
5.6.160.0000.08720.71
5.6.150.0100.07718.28
5.6.140.0030.06018.14
5.6.130.0030.04318.14
5.6.120.0070.08721.02
5.6.110.0130.04720.89
5.6.100.0070.08021.14
5.6.90.0130.06321.04
5.6.80.0130.07020.44
5.6.70.0130.06020.54
5.5.350.0070.07320.43
5.5.340.0100.07018.07
5.5.330.0030.05720.27
5.5.320.0030.04320.38
5.5.310.0470.06320.51
5.5.300.0070.08317.98
5.5.290.0070.04017.98
5.5.280.0100.08720.68
5.5.270.0070.08020.98
5.5.260.0030.07720.73
5.5.250.0070.03720.59
5.5.240.0030.04020.37
5.4.450.0100.05719.54
5.4.440.0370.07319.47
5.4.430.0370.06019.58
5.4.420.0370.03719.63
5.4.410.0270.04319.07
5.4.400.0300.07018.88
5.4.390.0330.05718.98
5.4.380.0100.05718.50
5.4.370.0070.04018.55
5.4.360.0100.04318.74
5.4.350.0090.03512.02
5.4.340.0060.03612.02
5.4.320.0060.04612.51
5.4.310.0030.04112.50
5.4.300.0060.04212.50
5.4.290.0080.03512.50
5.4.280.0060.05012.40
5.4.270.0090.04912.40
5.4.260.0080.03512.39
5.4.250.0070.05018.90
5.4.240.0300.03719.05
5.4.230.0170.06718.97
5.4.220.0070.06719.00
5.4.210.0100.05318.93
5.4.200.0100.06719.02
5.4.190.0130.07318.92
5.4.180.0130.05318.96
5.4.170.0070.05718.84
5.4.160.0030.06018.82
5.4.150.0130.05318.75
5.4.140.0070.06716.36
5.4.130.0070.06716.34
5.4.120.0030.05316.38
5.4.110.0100.06716.51
5.4.100.0100.05016.49
5.4.90.0070.04716.44
5.4.80.0100.05016.40
5.4.70.0100.07016.55
5.4.60.0170.04316.47
5.4.50.0070.05016.36
5.4.40.0030.05316.44
5.4.30.0030.06016.47
5.4.20.0000.07316.33
5.4.10.0030.05716.43
5.4.00.0070.04715.89
5.3.290.0100.04512.80
5.3.280.0170.05714.68
5.3.270.0130.05014.69
5.3.260.0070.06714.70
5.3.250.0030.05314.79
5.3.240.0070.07314.69
5.3.230.0070.05314.51
5.3.220.0030.05714.59
5.3.210.0070.05314.57
5.3.200.0130.04714.55
5.3.190.0100.05314.58
5.3.180.0130.07014.54
5.3.170.0070.05014.57
5.3.160.0070.04714.54
5.3.150.0100.04714.79
5.3.140.0070.06014.64
5.3.130.0130.05014.64
5.3.120.0070.05314.52
5.3.110.0030.06014.63
5.3.100.0170.06014.22
5.3.90.0130.04714.20
5.3.80.0000.06313.85
5.3.70.0100.04714.01
5.3.60.0100.04714.07
5.3.50.0030.05313.97
5.3.40.0070.04714.02
5.3.30.0070.05013.90
5.3.20.0100.07013.70
5.3.10.0200.04713.62
5.3.00.0070.04713.71
5.2.170.0070.04011.14
5.2.160.0030.06011.10
5.2.150.0070.04311.23
5.2.140.0070.04711.23
5.2.130.0030.04011.18
5.2.120.0100.03711.20
5.2.110.0070.04311.11
5.2.100.0030.04011.18
5.2.90.0130.04711.06
5.2.80.0130.03711.18
5.2.70.0000.04711.16
5.2.60.0000.06710.96
5.2.50.0030.04010.86
5.2.40.0100.04311.08
5.2.30.0070.05311.14
5.2.20.0130.03010.98
5.2.10.0000.04310.97
5.2.00.0130.04310.81
5.1.60.0170.04010.09
5.1.50.0030.0379.92
5.1.40.0100.03310.04
5.1.30.0030.04010.42
5.1.20.0070.05010.34
5.1.10.0130.05010.04
5.1.00.0200.02710.04
5.0.50.0130.0338.64
5.0.40.0100.0308.46
5.0.30.0000.0538.23
5.0.20.0070.0338.04
5.0.10.0100.0338.18
5.0.00.0030.0438.22
4.4.90.0030.0207.35
4.4.80.0000.0237.35
4.4.70.0000.0277.35
4.4.60.0070.0177.35
4.4.50.0030.0307.35
4.4.40.0000.0507.33
4.4.30.0000.0237.33
4.4.20.0000.0277.33
4.4.10.0030.0307.33
4.4.00.0030.0437.33
4.3.110.0130.0237.33
4.3.100.0030.0207.33
4.3.90.0030.0207.33
4.3.80.0000.0377.33
4.3.70.0070.0207.33
4.3.60.0030.0207.33
4.3.50.0000.0377.33
4.3.40.0070.0407.33
4.3.30.0030.0207.33
4.3.20.0030.0207.33
4.3.10.0100.0207.33
4.3.00.0000.0237.26

preferences:
46.83 ms | 401 KiB | 5 Q