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 = $test->__set($test->$callback, 'secret'); // 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.0040.01118.31
8.3.50.0140.00821.14
8.3.40.0040.01118.70
8.3.30.0040.01120.30
8.3.20.0070.00020.22
8.3.10.0080.00021.95
8.3.00.0040.00422.43
8.2.180.0150.00016.88
8.2.170.0060.01122.96
8.2.160.0040.00920.35
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.65
8.2.110.0060.00322.16
8.2.100.0110.00019.40
8.2.90.0040.00419.17
8.2.80.0050.00319.28
8.2.70.0040.00417.63
8.2.60.0050.00317.91
8.2.50.0000.00818.07
8.2.40.0060.00318.34
8.2.30.0020.00518.05
8.2.20.0030.00517.86
8.2.10.0000.00717.73
8.2.00.0040.00417.88
8.1.280.0090.00625.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00623.88
8.1.230.0080.00419.15
8.1.220.0080.00017.79
8.1.210.0080.00018.77
8.1.200.0030.00617.22
8.1.190.0040.00417.64
8.1.180.0030.00519.84
8.1.170.0080.00018.51
8.1.160.0000.00722.15
8.1.150.0040.00418.52
8.1.140.0040.00417.42
8.1.130.0030.00617.77
8.1.120.0030.00417.51
8.1.110.0040.00417.50
8.1.100.0020.00517.46
8.1.90.0050.00217.40
8.1.80.0000.00717.34
8.1.70.0000.00717.37
8.1.60.0000.00817.48
8.1.50.0000.00717.47
8.1.40.0000.00717.52
8.1.30.0050.00217.66
8.1.20.0040.00417.65
8.1.10.0000.00817.61
8.1.00.0070.00317.56
8.0.300.0030.00618.77
8.0.290.0070.00016.91
8.0.280.0040.00418.51
8.0.270.0030.00317.27
8.0.260.0000.00716.90
8.0.250.0000.00717.00
8.0.240.0030.00617.03
8.0.230.0040.00416.86
8.0.220.0050.00316.96
8.0.210.0000.00716.96
8.0.200.0030.00317.02
8.0.190.0000.00817.02
8.0.180.0120.00016.96
8.0.170.0030.00616.93
8.0.160.0040.00416.91
8.0.150.0070.00016.80
8.0.140.0040.00416.77
8.0.130.0030.00313.39
8.0.120.0030.00616.96
8.0.110.0040.00416.93
8.0.100.0000.00716.91
8.0.90.0000.00817.04
8.0.80.0040.01116.93
8.0.70.0040.00416.82
8.0.60.0050.00317.00
8.0.50.0040.00416.85
8.0.30.0140.00717.04
8.0.20.0050.01617.40
8.0.10.0040.00416.98
8.0.00.0110.00816.94
7.4.330.0030.00315.00
7.4.320.0070.00016.41
7.4.300.0070.00016.48
7.4.290.0000.00716.62
7.4.280.0000.00816.54
7.4.270.0000.00716.66
7.4.260.0030.00316.54
7.4.250.0020.00516.58
7.4.240.0000.00716.47
7.4.230.0000.00716.51
7.4.220.0070.01016.46
7.4.210.0060.01016.60
7.4.200.0040.00416.59
7.4.190.0040.00416.46
7.4.160.0100.00616.53
7.4.150.0130.01017.40
7.4.140.0120.01317.86
7.4.130.0140.00316.59
7.4.120.0080.00916.45
7.4.110.0080.00816.48
7.4.100.0130.00616.69
7.4.90.0100.00716.51
7.4.80.0160.00319.39
7.4.70.0110.00616.65
7.4.60.0260.01616.48
7.4.50.0050.00316.45
7.4.40.0060.00922.77
7.4.30.0100.01016.38
7.4.00.0040.01215.23
7.3.330.0060.00013.43
7.3.320.0000.00613.54
7.3.310.0000.00816.39
7.3.300.0000.00716.45
7.3.290.0100.00616.48
7.3.280.0100.00916.42
7.3.270.0130.00617.40
7.3.260.0100.01316.63
7.3.250.0130.00716.46
7.3.240.0130.00416.67
7.3.230.0080.01116.64
7.3.210.0170.00716.38
7.3.200.0060.01019.39
7.3.190.0130.00916.30
7.3.180.0110.00616.36
7.3.170.0060.01116.30
7.3.160.0140.00716.28
7.3.120.0030.01314.98
7.2.330.0130.00416.30
7.2.320.0090.00916.79
7.2.310.0090.00916.38
7.2.300.0080.00816.79
7.2.290.0090.00616.73
7.2.60.0000.00916.87
7.2.50.0080.00616.95
7.1.200.0030.00615.79
7.1.70.0050.00317.16
7.1.60.0040.00817.20
7.1.50.0100.01017.04
7.1.00.0000.03722.57
7.0.200.0090.00316.84
7.0.140.0030.07722.08
7.0.60.0070.04319.92
7.0.50.0170.07017.87
7.0.40.0130.08320.20
7.0.30.0300.07320.23
7.0.20.0230.07020.30
7.0.10.0200.06320.16
7.0.00.0200.07720.29
5.6.280.0000.07720.91
5.6.210.0070.05320.51
5.6.200.0170.06018.20
5.6.190.0130.08020.32
5.6.180.0200.04020.67
5.6.170.0300.07020.45
5.6.160.0000.08020.61
5.6.150.0170.05018.23
5.6.140.0130.04718.13
5.6.130.0130.07018.19
5.6.120.0030.04020.90
5.6.110.0030.08021.03
5.6.100.0070.06720.99
5.6.90.0070.07021.02
5.6.80.0070.04020.44
5.6.70.0370.05320.40
5.5.350.0070.07720.41
5.5.340.0070.04018.09
5.5.330.0070.04020.27
5.5.320.0200.04720.34
5.5.310.0230.04320.34
5.5.300.0030.03717.98
5.5.290.0070.05017.96
5.5.280.0170.06020.80
5.5.270.0000.04320.88
5.5.260.0030.06320.74
5.5.250.0130.07720.60
5.5.240.0130.07720.27
5.4.450.0730.06019.45
5.4.440.0270.08019.63
5.4.430.0530.05719.34
5.4.420.0570.04719.58
5.4.410.0230.05019.50
5.4.400.0430.04718.62
5.4.390.0400.05718.61
5.4.380.0270.05018.81
5.4.370.0200.04718.72
5.4.360.0170.05018.63
5.4.350.0090.03612.02
5.4.340.0060.04312.02
5.4.320.0040.03812.50
5.4.310.0050.03912.50
5.4.300.0070.03612.50
5.4.290.0090.04012.50
5.4.280.0030.04112.40
5.4.270.0070.03412.39
5.4.260.0090.03712.39
5.4.250.0170.05319.09
5.4.240.0130.05318.77
5.4.230.0100.05718.79
5.4.220.0070.05718.94
5.4.210.0100.05318.72
5.4.200.0070.07318.84
5.4.190.0000.06018.83
5.4.180.0230.05719.00
5.4.170.0170.05318.75
5.4.160.0070.07318.73
5.4.150.0130.05719.10
5.4.140.0000.07316.36
5.4.130.0230.05016.41
5.4.120.0030.07716.55
5.4.110.0130.07316.44
5.4.100.0070.06716.36
5.4.90.0230.04316.36
5.4.80.0170.04016.37
5.4.70.0030.05716.64
5.4.60.0030.05716.36
5.4.50.0170.05716.39
5.4.40.0130.06716.68
5.4.30.0030.06716.45
5.4.20.0130.06716.45
5.4.10.0070.05716.52
5.4.00.0070.07015.83
5.3.290.0050.04012.80
5.3.280.0130.05314.82
5.3.270.0100.08314.75
5.3.260.0100.07014.60
5.3.250.0100.06014.77
5.3.240.0130.06714.77
5.3.230.0070.06314.69
5.3.220.0000.06314.66
5.3.210.0100.06014.66
5.3.200.0100.07014.79
5.3.190.0100.06714.59
5.3.180.0130.04314.57
5.3.170.0000.07714.73
5.3.160.0100.06014.57
5.3.150.0230.05014.63
5.3.140.0070.05014.56
5.3.130.0070.07314.73
5.3.120.0030.06314.57
5.3.110.0170.04714.74
5.3.100.0130.06714.22
5.3.90.0130.06314.25
5.3.80.0100.06314.09
5.3.70.0000.06014.19
5.3.60.0030.05714.18
5.3.50.0170.04014.04
5.3.40.0100.06013.92
5.3.30.0030.06313.98
5.3.20.0100.04313.67
5.3.10.0130.06713.62
5.3.00.0130.04313.63
5.2.170.0030.05711.13
5.2.160.0030.05711.13
5.2.150.0030.06011.22
5.2.140.0070.04311.11
5.2.130.0170.03310.94
5.2.120.0030.06010.94
5.2.110.0170.04711.07
5.2.100.0130.03011.19
5.2.90.0100.03711.20
5.2.80.0070.05711.08
5.2.70.0100.03711.08
5.2.60.0130.03311.23
5.2.50.0070.06311.11
5.2.40.0200.03711.00
5.2.30.0100.03711.14
5.2.20.0070.04311.09
5.2.10.0100.04010.85
5.2.00.0030.04710.56
5.1.60.0100.03310.09
5.1.50.0100.03010.04
5.1.40.0070.0379.90
5.1.30.0030.04010.29
5.1.20.0070.03310.45
5.1.10.0070.03710.23
5.1.00.0070.03710.11
5.0.50.0100.0238.52
5.0.40.0100.0208.34
5.0.30.0000.0508.30
5.0.20.0070.0378.39
5.0.10.0070.0308.42
5.0.00.0000.0508.09
4.4.90.0030.0307.37
4.4.80.0070.0207.37
4.4.70.0070.0377.37
4.4.60.0100.0137.37
4.4.50.0000.0307.37
4.4.40.0030.0437.37
4.4.30.0100.0177.37
4.4.20.0000.0307.37
4.4.10.0000.0277.35
4.4.00.0030.0437.35
4.3.110.0000.0277.36
4.3.100.0070.0177.36
4.3.90.0100.0137.36
4.3.80.0030.0377.36
4.3.70.0030.0207.36
4.3.60.0070.0207.36
4.3.50.0130.0177.36
4.3.40.0030.0307.36
4.3.30.0030.0207.36
4.3.20.0070.0237.36
4.3.10.0030.0277.36
4.3.00.0070.0175.87

preferences:
36.27 ms | 401 KiB | 5 Q