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 = (new Test)->secret('test'); // 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.40.0070.00718.97
8.3.30.0100.01020.18
8.3.20.0040.00420.13
8.3.10.0040.00422.04
8.3.00.0040.00422.57
8.2.170.0120.00318.82
8.2.160.0130.00022.96
8.2.150.0000.00725.66
8.2.140.0000.00824.66
8.2.130.0110.00326.16
8.2.120.0050.00219.54
8.2.110.0090.00022.35
8.2.100.0090.00319.29
8.2.90.0000.00719.23
8.2.80.0040.00419.32
8.2.70.0060.00317.50
8.2.60.0030.00717.91
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0080.00018.00
8.2.20.0050.00217.57
8.2.10.0080.00017.69
8.2.00.0040.00417.71
8.1.270.0000.00824.66
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00623.72
8.1.230.0040.00719.00
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0090.00017.00
8.1.190.0000.00817.39
8.1.180.0040.00420.24
8.1.170.0000.00818.34
8.1.160.0000.00722.14
8.1.150.0040.00418.57
8.1.140.0080.00017.41
8.1.130.0060.00317.79
8.1.120.0040.00317.42
8.1.110.0000.00817.28
8.1.100.0000.00717.29
8.1.90.0000.00717.34
8.1.80.0000.00717.37
8.1.70.0070.00017.33
8.1.60.0030.00617.47
8.1.50.0000.00717.53
8.1.40.0060.00317.41
8.1.30.0040.00417.70
8.1.20.0030.00517.69
8.1.10.0050.00217.61
8.1.00.0030.00717.40
8.0.300.0000.00718.77
8.0.290.0070.00017.04
8.0.280.0090.00018.40
8.0.270.0030.00317.21
8.0.260.0000.00716.75
8.0.250.0000.00716.95
8.0.240.0080.00016.84
8.0.230.0030.00516.83
8.0.220.0000.00716.80
8.0.210.0000.00716.81
8.0.200.0030.00317.03
8.0.190.0000.00716.97
8.0.180.0030.00616.83
8.0.170.0040.00416.88
8.0.160.0030.00316.78
8.0.150.0070.00016.73
8.0.140.0000.00816.92
8.0.130.0000.00513.39
8.0.120.0050.00216.75
8.0.110.0030.00516.97
8.0.100.0000.00716.72
8.0.90.0030.00316.85
8.0.80.0060.01016.88
8.0.70.0040.00416.88
8.0.60.0030.00516.77
8.0.50.0050.00316.70
8.0.30.0110.01217.13
8.0.20.0140.01017.40
8.0.10.0070.00016.86
8.0.00.0100.01216.56
7.4.330.0000.00515.00
7.4.320.0030.00316.54
7.4.300.0060.00016.59
7.4.290.0070.00016.54
7.4.280.0000.00716.37
7.4.270.0000.00716.44
7.4.260.0030.00316.48
7.4.250.0070.00016.50
7.4.240.0050.00316.64
7.4.230.0030.00316.40
7.4.220.0090.01216.55
7.4.210.0090.00616.51
7.4.200.0030.00316.72
7.4.190.0070.00016.71
7.4.160.0100.00616.30
7.4.150.0150.00317.40
7.4.140.0120.00817.86
7.4.130.0150.00716.48
7.4.120.0050.01116.57
7.4.110.0090.00916.54
7.4.100.0030.01416.53
7.4.90.0030.01416.59
7.4.80.0150.00319.39
7.4.70.0120.01216.46
7.4.60.0090.00916.44
7.4.50.0030.00616.55
7.4.40.0050.00822.77
7.4.30.0070.01016.34
7.4.00.0080.00815.20
7.3.330.0050.00013.30
7.3.320.0030.00313.06
7.3.310.0040.00416.16
7.3.300.0000.00616.17
7.3.290.0030.01016.27
7.3.280.0060.00916.26
7.3.270.0060.01017.40
7.3.260.0100.00716.37
7.3.250.0110.01116.45
7.3.240.0060.01616.29
7.3.230.0070.01116.39
7.3.210.0130.00316.30
7.3.200.0100.00719.39
7.3.190.0110.00516.51
7.3.180.0130.00616.33
7.3.170.0100.00716.49
7.3.160.0080.01516.30
7.3.120.0040.00814.86
7.3.110.0060.00915.12
7.3.100.0000.01015.00
7.3.90.0110.00314.68
7.3.80.0070.00714.94
7.3.70.0040.01414.94
7.3.60.0030.01014.86
7.3.50.0000.01614.84
7.3.40.0030.01314.81
7.3.30.0030.01014.68
7.3.20.0080.00816.73
7.3.10.0090.00616.69
7.3.00.0070.01016.61
7.2.330.0070.01716.31
7.2.320.0080.01116.41
7.2.310.0110.00716.60
7.2.300.0060.01316.55
7.2.290.0030.01316.78
7.2.240.0090.00615.09
7.2.230.0030.01514.98
7.2.220.0040.01214.56
7.2.210.0070.01114.85
7.2.200.0090.00314.80
7.2.190.0070.00714.88
7.2.180.0060.01015.00
7.2.170.0100.00315.06
7.2.160.0070.00715.01
7.2.150.0080.00416.93
7.2.140.0080.01116.90
7.2.130.0060.01016.88
7.2.120.0060.01116.62
7.2.110.0070.01016.80
7.2.100.0050.00516.86
7.2.90.0070.00316.94
7.2.80.0140.00017.02
7.2.70.0080.00416.77
7.2.60.0030.01116.76
7.2.50.0090.00616.90
7.2.40.0060.01016.95
7.2.30.0140.00016.76
7.2.20.0060.00916.81
7.2.10.0060.00316.86
7.2.00.0030.01116.61
7.1.330.0100.00715.35
7.1.320.0040.00715.47
7.1.310.0110.00315.52
7.1.300.0060.00615.48
7.1.290.0000.01515.55
7.1.280.0060.00915.65
7.1.270.0040.00815.34
7.1.260.0110.00315.66
7.1.250.0140.00415.29
7.1.200.0030.00715.39
7.1.70.0000.01117.17
7.1.60.0130.01319.43
7.1.50.0040.01816.80
7.1.00.0000.03722.41
7.0.200.0100.00714.82
7.0.140.0000.07322.02
7.0.60.0070.04019.93
7.0.50.0130.04717.85
7.0.40.0070.07720.18
7.0.30.0230.04320.28
7.0.20.0170.04320.15
7.0.10.0170.05720.25
7.0.00.0200.07020.07
5.6.280.0100.06720.93
5.6.210.0070.05720.55
5.6.200.0070.06018.25
5.6.190.0070.06320.40
5.6.180.0270.07020.67
5.6.170.0370.07320.50
5.6.160.0000.05020.48
5.6.150.0030.08018.25
5.6.140.0070.04318.23
5.6.130.0070.07018.28
5.6.120.0100.03321.00
5.6.110.0130.08020.99
5.6.100.0070.08021.12
5.6.90.0100.05320.98
5.6.80.0100.05020.53
5.6.70.0200.08720.43
5.5.350.0030.04020.32
5.5.340.0070.03717.99
5.5.330.0100.04020.39
5.5.320.0070.05020.51
5.5.310.0230.07720.19
5.5.300.0030.04017.95
5.5.290.0170.06718.08
5.5.280.0130.06320.97
5.5.270.0070.03720.77
5.5.260.0100.06320.77
5.5.250.0070.08720.69
5.5.240.0030.05720.16
5.4.450.0670.06319.39
5.4.440.1170.06719.20
5.4.430.1070.06719.58
5.4.420.0930.06019.57
5.4.410.1030.06319.17
5.4.400.0330.06318.74
5.4.390.0500.07318.63
5.4.380.0070.07018.80
5.4.370.0370.05018.60
5.4.360.1100.04718.73
5.4.350.0070.03412.03
5.4.340.0050.04712.02
5.4.320.0030.04512.50
5.4.310.0060.04112.50
5.4.300.0100.03212.51
5.4.290.0020.04112.50
5.4.280.0050.03612.40
5.4.270.0070.04812.40
5.4.260.0040.04812.40
5.4.250.0130.04718.89
5.4.240.0000.06018.78
5.4.230.0070.08718.98
5.4.220.0000.06018.98
5.4.210.0100.07018.98
5.4.200.0170.04718.92
5.4.190.0130.06018.77
5.4.180.0170.04318.98
5.4.170.0200.04019.00
5.4.160.0030.08018.88
5.4.150.0070.07318.72
5.4.140.0130.04716.39
5.4.130.0130.05716.54
5.4.120.0100.05316.58
5.4.110.0130.06016.48
5.4.100.0100.04716.37
5.4.90.0030.07716.40
5.4.80.0000.07016.52
5.4.70.0100.04716.41
5.4.60.0130.05716.62
5.4.50.0100.05316.45
5.4.40.0130.04716.50
5.4.30.0070.05016.61
5.4.20.0030.05316.61
5.4.10.0170.05016.52
5.4.00.0070.05015.95
5.3.290.0090.04112.80
5.3.280.0200.05714.68
5.3.270.0130.04714.70
5.3.260.0130.04714.58
5.3.250.0030.06014.60
5.3.240.0170.06014.60
5.3.230.0070.05314.59
5.3.220.0100.04714.66
5.3.210.0200.04014.57
5.3.200.0100.06714.66
5.3.190.0100.04714.73
5.3.180.0130.06314.54
5.3.170.0070.05714.79
5.3.160.0070.05014.64
5.3.150.0100.05314.79
5.3.140.0130.04714.62
5.3.130.0130.07314.53
5.3.120.0100.05014.64
5.3.110.0030.06314.58
5.3.100.0030.05314.11
5.3.90.0070.04714.11
5.3.80.0070.05014.02
5.3.70.0070.05014.10
5.3.60.0170.04013.98
5.3.50.0200.05714.09
5.3.40.0070.06013.79
5.3.30.0070.05313.83
5.3.20.0070.06713.78
5.3.10.0000.05313.73
5.3.00.0070.07313.82
5.2.170.0070.05311.23
5.2.160.0030.04311.24
5.2.150.0100.03711.24
5.2.140.0000.04711.22
5.2.130.0070.03710.93
5.2.120.0000.04310.93
5.2.110.0100.04711.01
5.2.100.0130.05311.09
5.2.90.0070.04011.05
5.2.80.0070.06011.09
5.2.70.0100.03310.92
5.2.60.0070.03711.14
5.2.50.0100.05311.00
5.2.40.0030.04310.99
5.2.30.0130.03310.93
5.2.20.0030.04311.18
5.2.10.0070.03310.95
5.2.00.0030.04710.81
5.1.60.0030.0339.95
5.1.50.0030.03710.25
5.1.40.0000.0379.96
5.1.30.0030.04010.29
5.1.20.0070.03710.27
5.1.10.0030.04010.17
5.1.00.0100.0379.99
5.0.50.0030.0308.55
5.0.40.0030.0278.51
5.0.30.0100.0408.19
5.0.20.0070.0278.24
5.0.10.0070.0378.14
5.0.00.0030.0438.27
4.4.90.0070.0177.36
4.4.80.0070.0277.36
4.4.70.0000.0337.36
4.4.60.0000.0307.36
4.4.50.0000.0237.36
4.4.40.0030.0337.36
4.4.30.0070.0277.36
4.4.20.0000.0237.36
4.4.10.0070.0177.36
4.4.00.0030.0337.36
4.3.110.0000.0237.36
4.3.100.0070.0277.36
4.3.90.0000.0337.36
4.3.80.0000.0377.36
4.3.70.0030.0207.36
4.3.60.0070.0177.36
4.3.50.0000.0277.36
4.3.40.0030.0477.36
4.3.30.0030.0277.36
4.3.20.0000.0337.36
4.3.10.0000.0237.36
4.3.00.0000.0235.86

preferences:
44.78 ms | 400 KiB | 5 Q