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($this, '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.0070.00718.43
8.3.50.0230.00521.20
8.3.40.0120.00318.99
8.3.30.0070.01520.34
8.3.20.0050.00220.34
8.3.10.0060.00322.08
8.3.00.0080.00022.39
8.2.180.0160.00616.50
8.2.170.0110.00422.96
8.2.160.0070.00720.55
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0090.00026.16
8.2.120.0100.00619.65
8.2.110.0000.00921.87
8.2.100.0040.00719.39
8.2.90.0020.00519.23
8.2.80.0070.00019.33
8.2.70.0000.00817.63
8.2.60.0070.00417.68
8.2.50.0000.00818.07
8.2.40.0000.00718.22
8.2.30.0040.00418.06
8.2.20.0030.00517.75
8.2.10.0000.00817.62
8.2.00.0070.00017.72
8.1.280.0170.00325.92
8.1.270.0080.00024.66
8.1.260.0070.01126.35
8.1.250.0040.00428.09
8.1.240.0090.00023.79
8.1.230.0040.00719.15
8.1.220.0110.00017.74
8.1.210.0040.00418.77
8.1.200.0090.00017.35
8.1.190.0000.00717.52
8.1.180.0000.00720.25
8.1.170.0090.00018.41
8.1.160.0050.00222.15
8.1.150.0000.00718.63
8.1.140.0040.00417.50
8.1.130.0030.00617.88
8.1.120.0040.00417.46
8.1.110.0000.00817.39
8.1.100.0020.00517.26
8.1.90.0070.00017.41
8.1.80.0040.00317.25
8.1.70.0070.00017.42
8.1.60.0060.00317.59
8.1.50.0040.00417.50
8.1.40.0030.00617.59
8.1.30.0000.00917.57
8.1.20.0020.00517.59
8.1.10.0020.00517.52
8.1.00.0050.00517.58
8.0.300.0030.00318.77
8.0.290.0000.00717.05
8.0.280.0030.00618.44
8.0.270.0070.00017.19
8.0.260.0030.00316.89
8.0.250.0020.00516.95
8.0.240.0080.00016.92
8.0.230.0070.00016.86
8.0.220.0030.00316.75
8.0.210.0070.00016.80
8.0.200.0070.00017.00
8.0.190.0040.00416.99
8.0.180.0070.00316.99
8.0.170.0040.00416.94
8.0.160.0040.00416.77
8.0.150.0030.00316.80
8.0.140.0050.00316.93
8.0.130.0050.00013.34
8.0.120.0000.00816.75
8.0.110.0000.00716.93
8.0.100.0070.00016.97
8.0.90.0070.00016.82
8.0.80.0070.01016.90
8.0.70.0000.00816.78
8.0.60.0000.00716.90
8.0.50.0000.00716.89
8.0.30.0090.01217.28
8.0.20.0080.01117.40
8.0.10.0000.00816.85
8.0.00.0100.01016.83
7.4.330.0000.00515.00
7.4.320.0060.00016.46
7.4.300.0000.00616.68
7.4.290.0000.00716.62
7.4.280.0030.00516.48
7.4.270.0030.00316.45
7.4.260.0030.00316.49
7.4.250.0030.00516.57
7.4.240.0010.00616.48
7.4.230.0030.00316.62
7.4.220.0060.00916.54
7.4.210.0070.00716.60
7.4.200.0000.00716.42
7.4.190.0000.00716.39
7.4.160.0030.01316.53
7.4.150.0110.00717.40
7.4.140.0090.01317.86
7.4.130.0070.01116.63
7.4.120.0150.00216.58
7.4.110.0120.00616.72
7.4.100.0100.00716.54
7.4.90.0120.00616.58
7.4.80.0130.00919.39
7.4.70.0060.01616.49
7.4.60.0070.01016.59
7.4.50.0000.01016.49
7.4.40.0150.00322.77
7.4.30.0140.00316.53
7.4.00.0050.01314.98
7.3.330.0000.00513.23
7.3.320.0000.00513.18
7.3.310.0040.00416.42
7.3.300.0050.00216.33
7.3.290.0100.00316.43
7.3.280.0090.00916.36
7.3.270.0090.00917.40
7.3.260.0130.00616.41
7.3.250.0120.01116.36
7.3.240.0070.01016.60
7.3.230.0090.00916.39
7.3.210.0080.00816.57
7.3.200.0070.01419.39
7.3.190.0070.01016.27
7.3.180.0060.01016.43
7.3.170.0180.00716.50
7.3.160.0100.00716.29
7.3.120.0050.01114.79
7.3.110.0100.01014.79
7.3.100.0040.01114.70
7.3.90.0040.00414.68
7.3.80.0150.00014.81
7.3.70.0120.00314.87
7.3.60.0000.01414.88
7.3.50.0040.01214.73
7.3.40.0060.00614.87
7.3.30.0060.00614.64
7.3.20.0030.00916.52
7.3.10.0100.00316.72
7.3.00.0100.00316.70
7.2.330.0150.00816.41
7.2.320.0090.00916.32
7.2.310.0160.00016.58
7.2.300.0110.01016.66
7.2.290.0060.00916.57
7.2.250.0120.00914.83
7.2.240.0070.01414.66
7.2.230.0130.00314.88
7.2.220.0030.01014.91
7.2.210.0080.00315.23
7.2.200.0090.00914.83
7.2.190.0060.01214.98
7.2.180.0070.00714.88
7.2.170.0030.00915.07
7.2.60.0000.01516.57
7.2.00.0040.00818.98
7.1.330.0060.00915.77
7.1.320.0030.01015.66
7.1.310.0100.00315.57
7.1.300.0060.00615.54
7.1.290.0130.00315.67
7.1.280.0080.00615.32
7.1.270.0100.00315.62
7.1.260.0070.00415.63
7.1.200.0030.00915.58
7.1.100.0070.00417.84
7.1.70.0040.00417.07
7.1.60.0110.01419.43
7.1.50.0140.01116.64
7.1.00.0070.06322.40
7.0.200.0070.00716.36
7.0.140.0030.07321.93
7.0.60.0030.06319.84
7.0.50.0030.04017.88
7.0.40.0000.09020.04
7.0.30.0330.07320.24
7.0.20.0170.04320.07
7.0.10.0070.06320.21
7.0.00.0130.08020.33
5.6.280.0070.07021.12
5.6.210.0100.07020.51
5.6.200.0070.03718.29
5.6.190.0030.05320.48
5.6.180.0300.07720.52
5.6.170.0400.08020.56
5.6.160.0030.08720.57
5.6.150.0000.08318.15
5.6.140.0030.06318.19
5.6.130.0100.06718.21
5.6.120.0130.07721.12
5.6.110.0000.04321.05
5.6.100.0100.07020.97
5.6.90.0030.08720.98
5.6.80.0030.04020.48
5.5.350.0000.03720.38
5.5.340.0130.07018.05
5.5.330.0030.05020.35
5.5.320.0130.04720.29
5.5.310.0270.04020.35
5.5.300.0030.08018.07
5.5.290.0000.07717.97
5.5.280.0070.04020.88
5.5.270.0030.08320.88
5.5.260.0200.07020.73
5.5.250.0170.06320.62
5.5.240.0330.06720.38
5.4.450.0200.08719.53
5.4.440.0730.06319.48
5.4.430.0870.05719.16
5.4.420.0070.05719.47
5.4.410.0700.05719.06
5.4.400.0970.05019.18
5.4.390.0770.05319.11
5.4.380.0370.04018.73
5.4.370.0130.05318.52
5.4.360.0100.05318.46
5.4.350.0130.04012.02
5.4.340.0090.04512.02
5.4.320.0060.03612.50
5.4.310.0050.04112.50
5.4.300.0060.03712.50
5.4.290.0060.03912.50
5.4.280.0070.03412.40
5.4.270.0060.03512.40
5.4.260.0080.04412.40
5.4.250.0070.06318.96
5.4.240.0030.07318.76
5.4.230.0000.06018.99
5.4.220.0030.06018.91
5.4.210.0100.05318.89
5.4.200.0130.04719.05
5.4.190.0130.04719.08
5.4.180.0070.07718.74
5.4.170.0070.05318.82
5.4.160.0030.07318.93
5.4.150.0030.05718.90
5.4.140.0130.06716.55
5.4.130.0100.06316.37
5.4.120.0130.06716.42
5.4.110.0030.05016.37
5.4.100.0030.05016.40
5.4.90.0200.04716.40
5.4.80.0030.05316.27
5.4.70.0070.04716.33
5.4.60.0130.05716.46
5.4.50.0030.05016.48
5.4.40.0130.04016.47
5.4.30.0100.04716.44
5.4.20.0030.05016.46
5.4.10.0030.05316.28
5.4.00.0030.04715.88
5.3.290.0090.03412.80
5.3.280.0030.05314.68
5.3.270.0130.06014.70
5.3.260.0070.05014.63
5.3.250.0070.05314.83
5.3.240.0200.05714.77
5.3.230.0030.05314.59
5.3.220.0070.07014.66
5.3.210.0000.05714.79
5.3.200.0200.06314.81
5.3.190.0130.04714.71
5.3.180.0100.05014.47
5.3.170.0070.05014.65
5.3.160.0100.07314.79
5.3.150.0000.07014.55
5.3.140.0070.04714.64
5.3.130.0170.06314.62
5.3.120.0000.05714.78
5.3.110.0100.04714.64
5.3.100.0030.05314.17
5.3.90.0070.04714.16
5.3.80.0070.04713.85
5.3.70.0130.06014.09
5.3.60.0070.05014.07
5.3.50.0100.04314.03
5.3.40.0100.04714.13
5.3.30.0070.04713.74
5.3.20.0070.04713.92
5.3.10.0070.04713.74
5.3.00.0100.04713.66
5.2.170.0070.04011.22
5.2.160.0030.04711.37
5.2.150.0070.03711.23
5.2.140.0030.04011.13
5.2.130.0030.04011.19
5.2.120.0030.03711.18
5.2.110.0070.04011.32
5.2.100.0070.03711.19
5.2.90.0030.04311.21
5.2.80.0030.04311.32
5.2.70.0070.05311.11
5.2.60.0030.04311.14
5.2.50.0100.03711.10
5.2.40.0030.04011.23
5.2.30.0030.06310.93
5.2.20.0030.05310.95
5.2.10.0070.04710.93
5.2.00.0070.03710.80
5.1.60.0070.03010.24
5.1.50.0070.0309.98
5.1.40.0070.0309.95
5.1.30.0130.03010.42
5.1.20.0100.03010.44
5.1.10.0030.03710.16
5.1.00.0030.03310.31
5.0.50.0070.0279.66
5.0.40.0070.0239.66
5.0.30.0000.0439.66
5.0.20.0030.0279.66
5.0.10.0030.0279.66
5.0.00.0070.0379.66
4.4.90.0070.0179.66
4.4.80.0000.0239.66
4.4.70.0000.0239.66
4.4.60.0000.0239.66
4.4.50.0000.0239.66
4.4.40.0030.0339.66
4.4.30.0070.0179.66
4.4.20.0000.0239.66
4.4.10.0000.0239.66
4.4.00.0000.0409.66
4.3.110.0070.0279.66
4.3.100.0000.0209.66
4.3.90.0000.0209.66
4.3.80.0030.0309.66
4.3.70.0030.0179.66
4.3.60.0000.0239.66
4.3.50.0000.0239.66
4.3.40.0030.0309.66
4.3.30.0000.0239.66
4.3.20.0030.0209.66
4.3.10.0070.0209.66
4.3.00.0030.0238.10

preferences:
47.82 ms | 401 KiB | 5 Q