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 = 1; // 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.0070.01418.68
8.3.50.0110.00621.09
8.3.40.0120.00318.97
8.3.30.0140.00020.25
8.3.20.0040.00420.34
8.3.10.0090.00022.04
8.3.00.0040.00722.58
8.2.180.0130.00618.38
8.2.170.0110.00422.96
8.2.160.0100.00320.38
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0140.00026.16
8.2.120.0030.00617.93
8.2.110.0090.00020.29
8.2.100.0110.00017.84
8.2.90.0000.00819.41
8.2.80.0030.00519.30
8.2.70.0060.00317.75
8.2.60.0060.00318.04
8.2.50.0090.00018.07
8.2.40.0040.00718.03
8.2.30.0030.00618.05
8.2.20.0040.00417.84
8.2.10.0000.00817.82
8.2.00.0060.00317.61
8.1.280.0110.00325.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.54
8.1.230.0100.00320.95
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.25
8.1.190.0030.00517.54
8.1.180.0050.00319.14
8.1.170.0050.00318.45
8.1.160.0070.00022.16
8.1.150.0050.00218.63
8.1.140.0080.00017.35
8.1.130.0030.00317.79
8.1.120.0050.00317.36
8.1.110.0000.00717.41
8.1.100.0070.00317.30
8.1.90.0030.00417.27
8.1.80.0070.00017.47
8.1.70.0000.00717.36
8.1.60.0030.00617.57
8.1.50.0080.00017.43
8.1.40.0000.00817.53
8.1.30.0040.00417.54
8.1.20.0030.00517.68
8.1.10.0050.00217.58
8.1.00.0050.00317.59
8.0.300.0050.00319.90
8.0.290.0050.00217.16
8.0.280.0070.00018.45
8.0.270.0000.00717.27
8.0.260.0040.00416.71
8.0.250.0030.00316.99
8.0.240.0040.00417.02
8.0.230.0040.00416.85
8.0.220.0040.00416.82
8.0.210.0000.00716.91
8.0.200.0000.00616.99
8.0.190.0030.00717.04
8.0.180.0000.00716.93
8.0.170.0030.00516.86
8.0.160.0000.00716.89
8.0.150.0080.00016.89
8.0.140.0030.00316.86
8.0.130.0030.00313.41
8.0.120.0050.00316.86
8.0.110.0030.00516.92
8.0.100.0070.00016.86
8.0.90.0040.00416.94
8.0.80.0130.00316.87
8.0.70.0000.00716.74
8.0.60.0040.00416.79
8.0.50.0040.00416.74
8.0.30.0090.00917.09
8.0.20.0110.00717.40
8.0.10.0050.00316.96
8.0.00.0170.01516.83
7.4.330.0060.00015.00
7.4.320.0060.00016.46
7.4.300.0040.00416.54
7.4.290.0050.00616.41
7.4.280.0030.00316.59
7.4.270.0000.00816.45
7.4.260.0030.00516.51
7.4.250.0040.00416.44
7.4.240.0030.00316.58
7.4.230.0030.00316.52
7.4.220.0090.00616.58
7.4.210.0060.00916.57
7.4.200.0000.00716.72
7.4.190.0030.00316.57
7.4.160.0090.00616.44
7.4.150.0120.00917.40
7.4.140.0140.00417.86
7.4.130.0060.01016.55
7.4.120.0060.01216.56
7.4.110.0060.01216.47
7.4.100.0070.01416.75
7.4.90.0070.01016.45
7.4.80.0100.00719.39
7.4.70.0100.00616.29
7.4.60.0090.01216.40
7.4.50.0000.00416.51
7.4.40.0030.01322.77
7.4.30.0120.00816.46
7.4.00.0080.01014.81
7.3.330.0060.00013.29
7.3.320.0000.00513.36
7.3.310.0000.00716.48
7.3.300.0030.00316.46
7.3.290.0100.00316.38
7.3.280.0070.00916.39
7.3.270.0130.01017.40
7.3.260.0110.01116.64
7.3.250.0110.01016.55
7.3.240.0120.00616.61
7.3.230.0100.00716.44
7.3.210.0100.00616.65
7.3.200.0150.00619.39
7.3.190.0060.01616.29
7.3.180.0100.01016.30
7.3.170.0080.00816.30
7.3.160.0030.01316.37
7.3.120.0050.01214.85
7.3.110.0050.01314.69
7.3.100.0100.00714.79
7.3.90.0100.00514.82
7.3.80.0090.00615.04
7.3.70.0100.00514.80
7.3.60.0080.00714.79
7.3.50.0070.00414.60
7.3.40.0070.00514.84
7.3.30.0060.00614.86
7.3.20.0030.00716.55
7.3.10.0090.00316.65
7.3.00.0060.00816.62
7.2.330.0120.00616.27
7.2.320.0100.01416.87
7.2.310.0150.00616.48
7.2.300.0060.01016.63
7.2.290.0070.01316.79
7.2.250.0090.01014.92
7.2.240.0080.01015.10
7.2.230.0050.01014.91
7.2.220.0090.00714.97
7.2.210.0090.00615.12
7.2.200.0050.01015.12
7.2.190.0060.01015.08
7.2.180.0050.00715.13
7.2.170.0090.00315.12
7.2.60.0100.00316.57
7.2.00.0040.00819.46
7.1.330.0030.01115.93
7.1.320.0090.00415.78
7.1.310.0090.01015.84
7.1.300.0070.01015.82
7.1.290.0070.00515.91
7.1.280.0050.00615.53
7.1.270.0040.00615.81
7.1.260.0040.01015.86
7.1.200.0030.00915.52
7.1.100.0090.00618.13
7.1.70.0040.00417.32
7.1.60.0110.01419.43
7.1.50.0210.00416.97
7.1.00.0030.03322.51
7.0.200.0000.00816.70
7.0.140.0030.07722.08
7.0.60.0100.05019.95
7.0.50.0100.07317.87
7.0.40.0100.07320.11
7.0.30.0230.09020.16
7.0.20.0230.03720.33
7.0.10.0070.05320.30
7.0.00.0000.07720.22
5.6.280.0030.07321.10
5.6.210.0100.06720.48
5.6.200.0070.08018.21
5.6.190.0030.06020.67
5.6.180.0200.05320.47
5.6.170.0270.07720.47
5.6.160.0100.03720.55
5.6.150.0070.04018.16
5.6.140.0130.07018.29
5.6.130.0100.06018.17
5.6.120.0070.08021.02
5.6.110.0170.07021.09
5.6.100.0200.06720.95
5.6.90.0070.07720.95
5.6.80.0030.07720.45
5.5.350.4500.03720.45
5.5.340.0130.07717.99
5.5.330.0030.04720.43
5.5.320.0370.04720.27
5.5.310.0430.04720.39
5.5.300.0130.08017.99
5.5.290.0000.05017.98
5.5.280.0100.07320.81
5.5.270.0070.08720.97
5.5.260.0000.07720.87
5.5.250.0130.08020.59
5.5.240.0200.03720.04
5.4.450.0270.05019.53
5.4.440.0300.06019.46
5.4.430.0330.04319.16
5.4.420.0370.07019.27
5.4.410.0200.04719.07
5.4.400.0330.06019.09
5.4.390.0200.05319.22
5.4.380.0270.06318.95
5.4.370.0230.04718.95
5.4.360.0270.05719.16
5.4.350.0200.04719.16
5.4.340.0200.05019.22
5.4.320.0330.04019.11
5.4.310.0230.05019.05
5.4.300.0270.03319.08
5.4.290.0330.07019.20
5.4.280.0200.05018.98
5.4.270.0300.04319.08
5.4.260.0270.06319.08
5.4.250.0270.07719.07
5.4.240.0270.05018.98
5.4.230.0200.04019.13
5.4.220.0330.06719.30
5.4.210.0330.04019.04
5.4.200.0370.06718.96
5.4.190.0270.05019.18
5.4.180.0270.04319.10
5.4.170.0300.04019.21
5.4.160.0230.04719.21
5.4.150.0300.06718.95
5.4.140.0270.05016.37
5.4.130.0230.07316.28
5.4.120.0230.05016.49
5.4.110.0230.06016.36
5.4.100.0300.07016.45
5.4.90.0330.06716.25
5.4.80.0370.07316.47
5.4.70.0330.06016.60
5.4.60.0200.05016.17
5.4.50.0300.04316.46
5.4.40.0270.06316.60
5.4.30.0200.06016.48
5.4.20.0230.04316.32
5.4.10.0370.06316.53
5.4.00.0300.04015.79
5.3.290.0270.06314.59
5.3.280.0230.03714.52
5.3.270.0370.06014.61
5.3.260.0300.07014.69
5.3.250.0330.04014.51
5.3.240.0270.05714.61
5.3.230.0270.07314.60
5.3.220.0270.06014.71
5.3.210.0370.06314.57
5.3.200.0230.04714.57
5.3.190.0300.04714.57
5.3.180.0330.06314.57
5.3.170.0300.07014.46
5.3.160.0430.03014.79
5.3.150.0330.06714.71
5.3.140.0330.07014.61
5.3.130.0230.05314.52
5.3.120.0300.05714.63
5.3.110.0370.06314.47
5.3.100.0200.04714.11
5.3.90.0370.04314.10
5.3.80.0300.05013.95
5.3.70.0270.06014.02
5.3.60.0300.06314.06
5.3.50.0300.07013.86
5.3.40.0330.06013.93
5.3.30.0230.03714.00
5.3.20.0300.03713.92
5.3.10.0300.06013.80
5.3.00.0370.06013.80
5.2.170.0230.03713.80
5.2.160.0130.04013.80
5.2.150.0230.03313.80
5.2.140.0300.02713.80
5.2.130.0200.03013.80
5.2.120.0230.02313.80
5.2.110.0230.05713.80
5.2.100.0170.05013.80
5.2.90.0300.05013.80
5.2.80.0270.05713.80
5.2.70.0230.04713.80
5.2.60.0300.05713.80
5.2.50.0230.04313.80
5.2.40.0200.05713.80
5.2.30.0170.04013.80
5.2.20.0270.05313.80
5.2.10.0270.05713.80
5.2.00.0200.05313.80
5.1.60.0170.04313.80
5.1.50.0230.03713.80
5.1.40.0200.03313.80
5.1.30.0170.05713.80
5.1.20.0200.04013.80
5.1.10.0200.05013.80
5.1.00.0170.05313.80
5.0.50.0130.02013.80
5.0.40.0170.04013.80
5.0.30.0070.03313.80
5.0.20.0130.02013.80
5.0.10.0130.02013.80
5.0.00.0100.06313.80
4.4.90.0100.03313.80
4.4.80.0100.03313.80
4.4.70.0100.03013.80
4.4.60.0170.02313.80
4.4.50.0100.03313.80
4.4.40.0070.02713.80
4.4.30.0070.03013.80
4.4.20.0100.03713.80
4.4.10.0070.04013.80
4.4.00.0070.05013.80
4.3.110.0130.02713.80
4.3.100.0070.02313.80
4.3.90.0170.02713.80
4.3.80.0100.04313.80
4.3.70.0130.02713.80
4.3.60.0100.02313.80
4.3.50.0170.02713.80
4.3.40.0130.05013.80
4.3.30.0070.03013.80
4.3.20.0030.03313.80
4.3.10.0030.02313.80
4.3.00.0030.03713.80

preferences:
44.47 ms | 401 KiB | 5 Q