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, '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.0130.00718.14
8.3.50.0080.01321.27
8.3.40.0060.00918.84
8.3.30.0000.01420.35
8.3.20.0040.00420.30
8.3.10.0000.00821.91
8.3.00.0040.00422.43
8.2.180.0070.00716.38
8.2.170.0140.00322.96
8.2.160.0030.01020.39
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0140.00026.16
8.2.120.0000.00919.77
8.2.110.0070.01022.21
8.2.100.0080.00417.91
8.2.90.0040.00419.17
8.2.80.0040.00419.34
8.2.70.0050.00317.63
8.2.60.0000.00918.03
8.2.50.0060.00318.07
8.2.40.0000.00818.22
8.2.30.0000.00818.14
8.2.20.0060.00317.75
8.2.10.0060.00317.70
8.2.00.0020.00517.75
8.1.280.0110.00425.92
8.1.270.0040.00424.66
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0030.00623.86
8.1.230.0060.00619.10
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.22
8.1.190.0040.00417.54
8.1.180.0000.00919.01
8.1.170.0000.00818.39
8.1.160.0000.00722.09
8.1.150.0040.00418.55
8.1.140.0000.00717.42
8.1.130.0040.00417.92
8.1.120.0070.00017.39
8.1.110.0000.00717.39
8.1.100.0040.00417.40
8.1.90.0040.00417.43
8.1.80.0050.00217.34
8.1.70.0070.00017.32
8.1.60.0090.00017.48
8.1.50.0000.00717.59
8.1.40.0000.00817.52
8.1.30.0000.00717.59
8.1.20.0060.00317.61
8.1.10.0040.00417.57
8.1.00.0090.00317.53
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0040.00418.41
8.0.270.0000.00817.07
8.0.260.0050.00218.25
8.0.250.0030.00317.04
8.0.240.0050.00416.98
8.0.230.0000.00716.88
8.0.220.0000.00716.82
8.0.210.0070.00016.78
8.0.200.0060.00017.01
8.0.190.0030.00317.04
8.0.180.0030.00616.84
8.0.170.0050.00316.85
8.0.160.0080.00016.88
8.0.150.0080.00016.86
8.0.140.0070.00016.75
8.0.130.0030.00313.30
8.0.120.0030.00616.87
8.0.110.0040.00416.81
8.0.100.0070.00316.91
8.0.90.0030.00516.95
8.0.80.0090.00616.81
8.0.70.0040.00416.82
8.0.60.0070.00016.88
8.0.50.0000.00716.77
8.0.30.0120.00817.27
8.0.20.0100.00817.42
8.0.10.0050.00216.92
8.0.00.0030.01616.75
7.4.330.0050.00015.00
7.4.320.0030.00316.41
7.4.300.0060.00016.49
7.4.290.0040.00416.37
7.4.280.0060.00016.65
7.4.270.0000.00716.54
7.4.260.0030.00316.49
7.4.250.0040.00416.45
7.4.240.0020.00516.58
7.4.230.0000.00716.33
7.4.220.0090.00616.44
7.4.210.0110.00516.59
7.4.200.0000.00716.62
7.4.190.0070.00016.55
7.4.160.0090.00916.54
7.4.150.0110.00717.40
7.4.140.0110.00817.86
7.4.130.0140.00316.47
7.4.120.0090.00816.50
7.4.110.0100.00716.57
7.4.100.0140.00316.50
7.4.90.0120.00616.63
7.4.80.0110.00719.39
7.4.70.0140.00516.49
7.4.60.0030.01316.44
7.4.50.0070.00016.52
7.4.40.0060.00622.77
7.4.30.0030.01716.50
7.4.00.0070.01015.13
7.3.330.0030.00313.24
7.3.320.0020.00213.13
7.3.310.0070.00016.40
7.3.300.0030.00316.36
7.3.290.0070.00716.37
7.3.280.0070.01316.33
7.3.270.0100.00617.40
7.3.260.0130.00316.36
7.3.250.0110.00816.37
7.3.240.0130.00416.50
7.3.230.0130.00316.41
7.3.210.0130.01016.45
7.3.200.0090.00919.39
7.3.190.0130.00316.59
7.3.180.0130.00316.29
7.3.170.0070.01016.27
7.3.160.0040.01216.50
7.3.120.0070.01014.77
7.2.330.0110.00716.45
7.2.320.0060.01116.37
7.2.310.0110.01516.39
7.2.300.0060.01116.76
7.2.290.0130.00316.44
7.2.110.0100.01016.56
7.2.100.0200.00016.28
7.2.90.0100.00716.38
7.2.80.0080.01116.64
7.2.70.0180.00016.89
7.2.60.0100.00116.67
7.2.50.0130.00616.73
7.2.40.0140.00616.79
7.2.30.0170.00316.72
7.2.20.0140.00516.57
7.2.10.0330.00416.96
7.2.00.0120.00618.10
7.1.230.0130.00415.59
7.1.220.0110.00315.48
7.1.210.0420.00615.79
7.1.200.0260.00715.63
7.1.190.0110.00315.42
7.1.180.0140.01015.80
7.1.170.0310.00315.84
7.1.160.0070.00715.44
7.1.150.0120.00615.72
7.1.140.0090.00615.43
7.1.130.0120.00615.55
7.1.120.0170.00015.90
7.1.110.0330.00315.57
7.1.100.0080.00815.73
7.1.90.0110.00715.91
7.1.80.0390.00315.45
7.1.70.0060.00616.44
7.1.60.0050.01016.52
7.1.50.0090.01325.38
7.1.40.0160.00415.51
7.1.30.0180.00315.96
7.1.20.0080.00815.76
7.1.10.0060.01115.83
7.1.00.0070.02719.05
7.0.310.0280.00615.22
7.0.300.0110.00715.37
7.0.290.0090.00915.52
7.0.280.0140.00315.36
7.0.270.0130.00415.34
7.0.260.0090.01015.38
7.0.250.0160.00415.49
7.0.240.0130.00615.36
7.0.230.0070.00715.31
7.0.220.0210.00015.45
7.0.210.0080.00515.47
7.0.200.0080.00915.94
7.0.190.0040.01215.25
7.0.180.0110.00615.35
7.0.170.0060.00915.22
7.0.160.0110.00615.14
7.0.150.0080.00815.38
7.0.140.0100.03818.66
7.0.130.0090.00615.41
7.0.120.0220.01115.22
7.0.110.0100.00515.52
7.0.100.0100.00315.21
7.0.90.0090.00615.16
7.0.80.0110.00415.60
7.0.70.0070.00715.35
7.0.60.0110.03817.65
7.0.50.0050.02516.65
7.0.40.0130.02316.83
7.0.30.0220.04016.73
7.0.20.0230.04316.75
7.0.10.0180.03516.87
7.0.00.0090.02216.84
5.6.380.0090.00614.19
5.6.370.0070.01014.36
5.6.360.0160.00614.40
5.6.350.0090.01214.62
5.6.340.0090.00714.29
5.6.330.0110.00814.63
5.6.320.0120.00814.03
5.6.310.0090.00914.28
5.6.300.0080.00313.98
5.6.290.0150.00314.05
5.6.280.0060.03917.58
5.6.270.0100.00314.30
5.6.260.0130.00214.08
5.6.250.0080.00914.11
5.6.240.0140.00314.55
5.6.230.0070.00714.32
5.6.220.0050.01114.45
5.6.210.0070.03717.45
5.6.200.0080.04416.24
5.6.190.0080.02817.59
5.6.180.0180.04117.43
5.6.170.0170.02517.42
5.6.160.0090.02517.60
5.6.150.0030.02616.36
5.6.140.0140.03416.26
5.6.130.0070.04016.40
5.6.120.0100.03617.79
5.6.110.0120.03817.66
5.6.100.0080.04017.69
5.6.90.0040.02417.62
5.6.80.0080.03317.38
5.6.70.0150.04217.34
5.6.60.0090.00914.15
5.6.50.0070.01014.44
5.6.40.0040.01114.18
5.6.30.0120.00414.21
5.6.20.0100.00714.48
5.6.10.0110.00414.13
5.6.00.0150.00014.16
5.5.380.0070.00712.79
5.5.370.0100.00312.79
5.5.360.0080.00012.79
5.5.350.0090.03116.62
5.5.340.0040.03415.38
5.5.330.0110.02716.53
5.5.320.0170.03416.55
5.5.310.0120.02516.54
5.5.300.0070.04015.41
5.5.290.0080.04115.36
5.5.280.0050.04216.73
5.5.270.0050.04616.78
5.5.260.0100.04216.74
5.5.250.0080.04616.69
5.5.240.0010.04716.41
5.5.230.0000.01112.79
5.5.220.0150.00012.79
5.5.210.0060.01012.79
5.5.200.0070.00512.79
5.5.190.0030.00712.79
5.5.180.0070.00412.79
5.5.170.0170.00014.36
5.5.160.0070.00212.79
5.5.150.0120.00012.79
5.5.140.0070.00712.79
5.5.130.0030.01012.79
5.5.120.0100.00312.79
5.5.110.0100.00312.79
5.5.100.0090.00612.79
5.5.90.0060.00612.79
5.5.80.0060.00912.79
5.5.70.0070.00712.79
5.5.60.0130.00012.79
5.5.50.0100.00312.79
5.5.40.0110.00412.79
5.5.30.0110.00612.79
5.5.20.0070.00412.79
5.5.10.0140.00012.79
5.5.00.0140.00012.79
5.4.450.0110.04116.17
5.4.440.0050.03416.17
5.4.430.0080.03016.09
5.4.420.0070.02315.99
5.4.410.0070.02816.04
5.4.400.0100.02315.89
5.4.390.0050.03915.88
5.4.380.0060.03915.91
5.4.370.0090.02215.95
5.4.360.0090.02015.87
5.4.350.0110.03415.88
5.4.340.0040.03115.94
5.4.330.0100.00512.79
5.4.320.0100.03715.83
5.4.310.0050.03915.97
5.4.300.0070.03615.99
5.4.290.0080.02516.01
5.4.280.0070.02415.96
5.4.270.0070.03615.93
5.4.260.0060.03815.94
5.4.250.0080.02115.93
5.4.240.0030.02815.96
5.4.230.0050.02315.88
5.4.220.0070.03915.94
5.4.210.0040.04316.05
5.4.200.0040.04116.00
5.4.190.0080.03815.88
5.4.180.0090.03615.96
5.4.170.0040.04215.92
5.4.160.0050.03515.82
5.4.150.0070.03516.00
5.4.140.0060.03914.61
5.4.130.0080.02714.54
5.4.120.0090.03614.73
5.4.110.0090.02714.67
5.4.100.0080.02814.58
5.4.90.0100.03514.67
5.4.80.0060.03914.64
5.4.70.0040.02914.48
5.4.60.0090.02814.69
5.4.50.0060.01914.48
5.4.40.0070.02514.66
5.4.30.0030.02314.52
5.4.20.0050.02614.61
5.4.10.0030.02714.56
5.4.00.0050.02514.37
5.3.290.0070.03513.84
5.3.280.0060.02513.69
5.3.270.0060.04113.74
5.3.260.0050.04113.70
5.3.250.0030.03813.69
5.3.240.0070.03613.70
5.3.230.0030.04013.64
5.3.220.0050.04013.74
5.3.210.0020.03413.68
5.3.200.0080.03713.63
5.3.190.0090.03813.72
5.3.180.0050.04213.67
5.3.170.0030.03313.63
5.3.160.0060.02613.73
5.3.150.0090.01713.68
5.3.140.0040.03513.73
5.3.130.0060.03513.71
5.3.120.0090.03413.69
5.3.110.0060.04513.71
5.3.100.0070.03813.45
5.3.90.0030.02413.45
5.3.80.0070.03713.45
5.3.70.0060.01813.44
5.3.60.0070.03013.51
5.3.50.0030.02213.37
5.3.40.0060.01813.41
5.3.30.0060.02913.36
5.3.20.0070.03713.24
5.3.10.0060.03513.23
5.3.00.0040.03913.25
5.2.170.0000.01912.50
5.2.160.0040.02912.50
5.2.150.0030.03512.50
5.2.140.0020.02612.50
5.2.130.0040.02312.50
5.2.120.0050.02312.50
5.2.110.0040.03412.50
5.2.100.0040.02912.50
5.2.90.0020.02012.50
5.2.80.0020.03712.50
5.2.70.0030.03712.50
5.2.60.0030.03012.50
5.2.50.0050.03512.50
5.2.40.0030.03412.50
5.2.30.0090.01712.50
5.2.20.0020.02212.50
5.2.10.0030.02612.50
5.2.00.0040.02612.50
5.1.60.0050.01812.50
5.1.50.0030.02512.50
5.1.40.0040.02812.50
5.1.30.0040.01812.50
5.1.20.0040.03312.50
5.1.10.0020.03112.50
5.1.00.0040.03012.50
5.0.50.0050.02212.50
5.0.40.0050.02312.50
5.0.30.0020.03412.50
5.0.20.0030.02212.50
5.0.10.0030.02512.50
5.0.00.0060.02812.50
4.4.90.0020.02212.50
4.4.80.0020.01212.50
4.4.70.0010.02112.50
4.4.60.0050.01312.50
4.4.50.0010.02112.50
4.4.40.0020.02912.50
4.4.30.0030.01812.50
4.4.20.0040.01712.50
4.4.10.0060.01512.50
4.4.00.0030.01812.50
4.3.110.0060.01612.50
4.3.100.0020.01912.50
4.3.90.0020.01312.50
4.3.80.0020.02612.50
4.3.70.0020.02112.50
4.3.60.0050.01612.50
4.3.50.0040.01812.50
4.3.40.0040.02912.50
4.3.30.0040.01612.50
4.3.20.0030.01212.50
4.3.10.0000.02312.50
4.3.00.0000.02412.50

preferences:
40.9 ms | 401 KiB | 5 Q