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 = 'Nyy lbhe Onfr ner orybat gb hf.'; // 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.68
8.3.50.0210.00221.21
8.3.40.0170.00018.92
8.3.30.0110.00420.36
8.3.20.0070.00020.38
8.3.10.0050.00322.09
8.3.00.0000.00822.46
8.2.180.0090.00616.50
8.2.170.0140.00722.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0190.00026.16
8.2.120.0060.00317.80
8.2.110.0000.00919.21
8.2.100.0070.00717.79
8.2.90.0050.00319.22
8.2.80.0000.00719.21
8.2.70.0080.00017.50
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0000.00918.09
8.2.30.0030.00618.14
8.2.20.0050.00317.63
8.2.10.0050.00317.83
8.2.00.0040.00417.81
8.1.280.0070.01025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00622.74
8.1.230.0080.00417.54
8.1.220.0000.00717.74
8.1.210.0030.00518.77
8.1.200.0040.00417.10
8.1.190.0000.00817.50
8.1.180.0000.00819.01
8.1.170.0050.00318.45
8.1.160.0020.00522.06
8.1.150.0040.00418.50
8.1.140.0000.00717.28
8.1.130.0030.00317.71
8.1.120.0000.00717.46
8.1.110.0000.00817.33
8.1.100.0040.00417.30
8.1.90.0040.00317.44
8.1.80.0000.00717.41
8.1.70.0020.00517.38
8.1.60.0060.00317.63
8.1.50.0000.00817.43
8.1.40.0000.00817.49
8.1.30.0000.00817.50
8.1.20.0020.00517.68
8.1.10.0000.00817.54
8.1.00.0040.00417.53
8.0.300.0060.00318.77
8.0.290.0070.00017.18
8.0.280.0030.00318.34
8.0.270.0000.00717.21
8.0.260.0040.00416.76
8.0.250.0000.00716.96
8.0.240.0030.00516.98
8.0.230.0030.00316.92
8.0.220.0040.00416.88
8.0.210.0000.00716.88
8.0.200.0040.00417.01
8.0.190.0080.00016.95
8.0.180.0050.00216.94
8.0.170.0070.00016.83
8.0.160.0040.00416.96
8.0.150.0030.00616.95
8.0.140.0000.00816.86
8.0.130.0000.00513.30
8.0.120.0000.00816.71
8.0.110.0000.00716.84
8.0.100.0000.00716.91
8.0.90.0000.00716.86
8.0.80.0110.00716.89
8.0.70.0070.00017.03
8.0.60.0000.00716.75
8.0.50.0000.00716.82
8.0.30.0090.00917.23
8.0.20.0120.00717.40
8.0.10.0000.00717.07
8.0.00.0150.00316.58
7.4.330.0000.00515.00
7.4.320.0040.00416.40
7.4.300.0030.00316.48
7.4.290.0110.00016.53
7.4.280.0030.00316.51
7.4.270.0000.00716.44
7.4.260.0000.00716.40
7.4.250.0000.00716.52
7.4.240.0040.00416.62
7.4.230.0030.00316.43
7.4.220.0070.01116.72
7.4.210.0070.01016.50
7.4.200.0000.00716.36
7.4.190.0000.00716.77
7.4.160.0040.01116.56
7.4.150.0030.01417.40
7.4.140.0030.01417.86
7.4.130.0090.00816.53
7.4.120.0110.01016.72
7.4.110.0090.00916.56
7.4.100.0110.00716.67
7.4.90.0130.00416.34
7.4.80.0090.01319.39
7.4.70.0060.01216.54
7.4.60.0060.00916.50
7.4.50.0030.00316.49
7.4.40.0070.01022.77
7.4.30.0100.01116.54
7.4.00.0060.00915.12
7.3.330.0050.00013.37
7.3.320.0050.00013.30
7.3.310.0040.00416.41
7.3.300.0000.00716.41
7.3.290.0030.01016.34
7.3.280.0070.01016.36
7.3.270.0110.00517.40
7.3.260.0130.00616.62
7.3.250.0090.00916.49
7.3.240.0030.01316.34
7.3.230.0090.00916.39
7.3.210.0030.01316.25
7.3.200.0120.00919.39
7.3.190.0100.00616.45
7.3.180.0100.01116.62
7.3.170.0030.01216.46
7.3.160.0080.00816.48
7.3.120.0060.01214.55
7.2.330.0160.00316.66
7.2.320.0080.01016.76
7.2.310.0070.01316.75
7.2.300.0070.01016.55
7.2.290.0030.01616.44
7.2.60.0060.00616.41
7.2.00.0030.00919.50
7.1.200.0110.00815.63
7.1.100.0040.00818.04
7.1.70.0000.00717.10
7.1.60.0060.01919.43
7.1.50.0150.00816.70
7.1.00.0030.03322.32
7.0.200.0000.00816.82
7.0.140.0070.07022.08
7.0.100.0130.06320.02
7.0.90.0070.05719.94
7.0.80.0100.04719.87
7.0.70.0070.07319.89
7.0.60.0330.07019.87
7.0.50.0170.08320.32
7.0.40.0170.06720.18
7.0.30.0070.07320.04
7.0.20.0000.08020.10
7.0.10.0070.08020.06
7.0.00.0030.07320.09
5.6.280.0100.06720.89
5.6.250.0070.07720.64
5.6.240.0070.08320.64
5.6.230.0070.07020.51
5.6.220.0070.06320.59
5.6.210.0130.07020.60
5.6.200.0070.08721.00
5.6.190.0100.07020.93
5.6.180.0130.06721.07
5.6.170.0070.08721.02
5.6.160.0030.09321.03
5.6.150.0130.07321.14
5.6.140.0070.08320.97
5.6.130.0070.08721.11
5.6.120.0000.08721.05
5.6.110.0170.07721.00
5.6.100.0030.08721.02
5.6.90.0130.07721.00
5.6.80.0130.05020.41
5.6.70.0030.04720.41
5.6.60.0200.05020.49
5.6.50.0070.04720.57
5.6.40.0030.07020.50
5.6.30.0070.07320.29
5.6.20.0100.07320.39
5.6.10.0000.08020.47
5.6.00.0130.07020.31
5.5.380.0070.07720.43
5.5.370.0070.05020.36
5.5.360.0070.06020.32
5.5.350.0130.09020.41
5.5.340.0100.07320.95
5.5.330.0070.08320.65
5.5.320.0070.06020.88
5.5.310.0070.08720.88
5.5.300.0130.07320.93
5.5.290.0100.04720.93
5.5.280.0070.08020.94
5.5.270.0100.07720.79
5.5.260.0070.08720.92
5.5.250.0100.07720.62
5.5.240.0170.07020.26
5.5.230.0070.08020.19
5.5.220.0270.06320.16
5.5.210.0100.04720.03
5.5.200.0030.06720.14
5.5.190.0070.09320.22
5.5.180.0130.07020.20
5.5.160.0100.04720.29
5.5.150.0130.07320.29
5.5.140.0100.07020.14
5.5.130.0070.07720.18
5.5.120.0070.07720.27
5.5.110.0100.07720.25
5.5.100.0070.07720.05
5.5.90.0030.05020.07
5.5.80.0070.08019.93
5.5.70.0070.07720.11
5.5.60.0030.07720.06
5.5.50.0070.07720.06
5.5.40.0030.07720.17
5.5.30.0200.06320.14
5.5.20.0070.07320.06
5.5.10.0130.06720.12
5.5.00.0070.08020.09
5.4.450.0200.07019.42
5.4.440.0100.05719.21
5.4.430.0100.07719.17
5.4.420.0030.08719.37
5.4.410.0130.07019.33
5.4.400.0070.07719.24
5.4.390.0170.06319.13
5.4.380.0030.07719.21
5.4.370.0070.07318.99
5.4.360.0070.07018.88
5.4.350.0070.07318.90
5.4.340.0070.07318.86
5.4.320.0030.07319.14
5.4.310.0130.05319.16
5.4.300.0170.06018.85
5.4.290.0070.07719.23
5.4.280.0030.08719.09
5.4.270.0100.07319.03
5.4.260.0000.05019.12
5.4.250.0200.06319.03
5.4.240.0100.07019.20
5.4.230.0100.06319.03
5.4.220.0070.07719.13
5.4.210.0000.08019.04
5.4.200.0200.06019.04
5.4.190.0070.07319.04
5.4.180.0070.07319.11
5.4.170.0130.07019.17
5.4.160.0070.07719.21
5.4.150.0130.07019.19
5.4.140.0070.08016.46
5.4.130.0100.07016.45
5.4.120.0000.07716.45
5.4.110.0000.08016.47
5.4.100.0070.07316.29
5.4.90.0000.08016.27
5.4.80.0030.06316.46
5.4.70.0030.08316.46
5.4.60.0130.06716.37
5.4.50.0100.06016.37
5.4.40.0100.07316.30
5.4.30.0100.07016.33
5.4.20.0070.07716.43
5.4.10.0000.05716.44
5.4.00.0100.06715.95
5.3.290.0100.07714.59
5.3.280.0070.07714.63
5.3.270.0030.07714.67
5.3.260.0030.07714.73
5.3.250.0100.03714.57
5.3.240.0130.06014.55
5.3.230.0030.04314.63
5.3.220.0070.04314.55
5.3.210.0000.08714.64
5.3.200.0000.08014.61
5.3.190.0030.06314.53
5.3.180.0030.07014.54
5.3.170.0030.06314.56
5.3.160.0100.07314.63
5.3.150.0030.07714.50
5.3.140.0100.07014.59
5.3.130.0170.06314.61
5.3.120.0170.06714.54
5.3.110.0070.06714.59
5.3.100.0030.08014.00
5.3.90.0130.07013.96
5.3.80.0070.06014.11
5.3.70.0100.07314.01
5.3.60.0030.05714.00
5.3.50.0130.05313.84
5.3.40.0070.07313.96
5.3.30.0100.06714.04
5.3.20.0030.04713.76
5.3.10.0100.05713.78
5.3.00.0030.07713.74
5.2.170.0070.06011.07
5.2.160.0000.06711.21
5.2.150.0100.06011.22
5.2.140.0070.06311.28
5.2.130.0100.05711.25
5.2.120.0030.05011.20
5.2.110.0000.06311.04
5.2.100.0070.03311.02
5.2.90.0070.05311.23
5.2.80.0070.06011.02
5.2.70.0100.05711.13
5.2.60.0030.06311.08
5.2.50.0070.05010.95
5.2.40.0070.06311.14
5.2.30.0070.06011.13
5.2.20.0070.03311.10
5.2.10.0000.06010.78
5.2.00.0070.05710.64
5.1.60.0100.0509.84
5.1.50.0000.06010.03
5.1.40.0100.0479.97
5.1.30.0030.05710.28
5.1.20.0070.04310.38
5.1.10.0070.05310.05
5.1.00.0030.05710.08
5.0.50.0030.0479.31
5.0.40.0030.0479.31
5.0.30.0070.0609.31
5.0.20.0030.0309.31
5.0.10.0000.0439.31
5.0.00.0100.0579.31
4.4.90.0070.0379.31
4.4.80.0000.0379.31
4.4.70.0000.0409.31
4.4.60.0000.0379.31
4.4.50.0000.0379.31
4.4.40.0070.0509.31
4.4.30.0000.0379.31
4.4.20.0030.0309.31
4.4.10.0000.0239.31
4.4.00.0030.0539.31
4.3.110.0070.0179.31
4.3.100.0070.0309.31
4.3.90.0030.0339.31
4.3.80.0000.0579.31
4.3.70.0030.0209.31
4.3.60.0000.0239.31
4.3.50.0000.0409.31
4.3.40.0070.0479.31
4.3.30.0000.0279.31
4.3.20.0070.0309.31
4.3.10.0030.0139.31
4.3.00.0030.0179.31

preferences:
41.77 ms | 401 KiB | 5 Q