3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Challenge 1: Read and write to 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 4. No redefining $test 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 // 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.70.0120.00318.31
8.3.60.0150.00616.75
8.3.50.0070.01022.04
8.3.40.0100.01018.85
8.3.30.0120.00319.04
8.3.20.0040.01120.39
8.3.10.0060.01223.55
8.3.00.0030.00519.26
8.2.180.0120.00318.49
8.2.170.0040.01122.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00022.25
8.2.110.0040.00422.30
8.2.100.0000.01217.91
8.2.90.0050.00319.05
8.2.80.0080.00017.97
8.2.70.0030.00517.38
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0040.00419.95
8.2.30.0040.00418.06
8.2.20.0040.00417.67
8.2.10.0050.00319.66
8.2.00.0030.00717.57
8.1.280.0040.01625.92
8.1.270.0090.00023.82
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00423.97
8.1.230.0070.00419.06
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0000.00717.41
8.1.180.0060.00318.98
8.1.170.0000.01018.49
8.1.160.0050.00321.98
8.1.150.0030.00618.59
8.1.140.0000.00717.32
8.1.130.0000.00717.87
8.1.120.0040.00417.42
8.1.110.0040.00717.32
8.1.100.0040.00317.26
8.1.90.0040.00417.39
8.1.80.0070.00017.45
8.1.70.0050.00217.37
8.1.60.0040.00417.56
8.1.50.0000.00817.54
8.1.40.0080.00017.53
8.1.30.0000.00817.59
8.1.20.0040.00417.63
8.1.10.0000.00717.57
8.1.00.0040.00417.56
8.0.300.0000.00718.77
8.0.290.0040.00417.05
8.0.280.0030.00318.27
8.0.270.0040.00417.12
8.0.260.0030.00317.27
8.0.250.0000.00717.01
8.0.240.0040.00416.88
8.0.230.0050.00316.85
8.0.220.0000.00716.95
8.0.210.0050.00316.81
8.0.200.0030.00316.86
8.0.190.0000.00716.97
8.0.180.0000.01016.92
8.0.170.0000.00816.86
8.0.160.0030.00316.89
8.0.150.0030.00616.77
8.0.140.0000.00816.93
8.0.130.0000.00713.35
8.0.120.0000.00716.91
8.0.110.0080.00016.87
8.0.100.0040.00416.80
8.0.90.0000.00716.80
8.0.80.0100.00716.84
8.0.70.0040.00416.97
8.0.60.0070.00016.74
8.0.50.0070.00016.80
8.0.30.0110.00817.18
8.0.20.0090.00917.40
8.0.10.0070.00017.05
8.0.00.0100.00816.76
7.4.330.0000.00515.00
7.4.320.0030.00316.40
7.4.300.0060.00016.63
7.4.290.0000.00716.52
7.4.280.0030.00316.49
7.4.270.0080.00016.54
7.4.260.0070.00016.37
7.4.250.0070.00016.48
7.4.240.0020.00616.53
7.4.230.0040.00416.35
7.4.220.0090.00916.68
7.4.210.0100.00516.57
7.4.200.0000.00716.45
7.4.190.0030.00316.41
7.4.160.0130.00316.50
7.4.150.0150.00317.40
7.4.140.0070.01017.86
7.4.130.0070.01016.51
7.4.120.0060.01016.46
7.4.110.0070.01016.48
7.4.100.0090.01116.32
7.4.90.0070.01016.52
7.4.80.0160.00319.39
7.4.70.0080.00816.71
7.4.60.0080.00816.55
7.4.50.0000.00816.36
7.4.40.0000.01722.77
7.4.30.0080.00816.68
7.4.00.0070.00714.91
7.3.330.0040.00313.32
7.3.320.0060.00013.17
7.3.310.0040.00416.18
7.3.300.0030.00616.41
7.3.290.0110.00716.39
7.3.280.0090.00716.39
7.3.270.0070.01117.40
7.3.260.0260.01916.39
7.3.250.0100.01016.30
7.3.240.0060.01016.57
7.3.230.0030.01316.39
7.3.210.0120.01216.43
7.3.200.0160.00319.39
7.3.190.0060.01416.59
7.3.180.0090.00916.55
7.3.170.0100.01316.27
7.3.160.0130.00316.30
7.3.120.0070.00014.96
7.2.330.0150.00416.38
7.2.320.0100.00716.47
7.2.310.0070.01016.57
7.2.300.0100.00716.71
7.2.290.0110.00516.57
7.2.60.0040.01116.55
7.2.50.0110.00717.05
7.2.00.0030.00918.92
7.1.200.0060.00915.80
7.1.100.0090.00317.86
7.1.70.0040.00416.89
7.1.60.0170.00719.46
7.1.50.0060.01616.89
7.1.00.0030.07722.54
7.0.200.0700.00614.70
7.0.140.0000.07321.95
7.0.60.0170.07720.01
7.0.50.0170.07017.85
7.0.40.0200.07020.40
7.0.30.0270.07720.06
7.0.20.0370.05320.30
7.0.10.0030.07320.32
7.0.00.0070.08720.24
5.6.280.0000.07321.10
5.6.210.0030.08320.57
5.6.200.0130.08018.18
5.6.190.0070.08720.48
5.6.180.0270.08020.39
5.6.170.0300.07320.53
5.6.160.0100.07720.55
5.6.150.0070.05018.18
5.6.140.0030.04018.18
5.6.130.0130.06318.28
5.6.120.0130.07720.98
5.6.110.0100.07321.14
5.6.100.0100.07720.98
5.6.90.0130.07721.11
5.6.80.0100.07720.51
5.6.70.4430.03720.38
5.5.350.0130.06720.33
5.5.340.0070.07017.96
5.5.330.0030.07320.21
5.5.320.0000.04320.51
5.5.310.0200.04020.23
5.5.300.0030.04018.02
5.5.290.0030.08717.97
5.5.280.0030.04720.78
5.5.270.0100.06720.85
5.5.260.0070.07720.80
5.5.250.0130.08720.70
5.5.240.0300.06720.33
5.4.450.0170.05019.61
5.4.440.0330.06719.17
5.4.430.1030.05319.70
5.4.420.0630.00019.63
5.4.410.0100.05718.81
5.4.400.0200.05318.76
5.4.390.0230.04718.63
5.4.380.0200.04718.64
5.4.370.0130.04718.78
5.4.360.0070.05318.59
5.4.350.0060.03512.02
5.4.340.0040.03712.02
5.4.320.0090.03912.50
5.4.310.0070.05212.50
5.4.300.0050.03812.50
5.4.290.0050.05212.48
5.4.280.0100.05412.39
5.4.270.0100.04912.38
5.4.260.0090.07512.38
5.4.250.0080.04912.39
5.4.240.0160.05612.38
5.4.230.0090.06012.37
5.4.220.0100.03612.37
5.4.210.0100.05112.38
5.4.200.0090.05512.38
5.4.190.0070.05612.38
5.4.180.0170.07112.38
5.4.170.0070.06112.38
5.4.160.0080.05912.38
5.4.150.0160.05112.38
5.4.140.0150.05312.06
5.4.130.0220.08212.05
5.4.120.0100.05612.00
5.4.110.0080.05312.00
5.4.100.0120.04612.00
5.4.90.0140.04812.00
5.4.80.0130.04912.00
5.4.70.0150.04412.00
5.4.60.0110.04812.00
5.4.50.0100.04811.99
5.4.40.0100.04911.99
5.4.30.0090.04811.98
5.4.20.0080.05011.98
5.4.10.0130.04511.98
5.4.00.0110.05011.47
5.3.290.0080.04612.80
5.3.280.0080.04512.70
5.3.270.0100.05112.73
5.3.260.0130.05212.72
5.3.250.0140.05112.72
5.3.240.0170.07212.72
5.3.230.0100.06912.71
5.3.220.0050.05512.68
5.3.210.0100.05112.68
5.3.200.0090.05312.68
5.3.190.0070.05312.68
5.3.180.0070.05312.68
5.3.170.0080.05112.67
5.3.160.0100.05012.68
5.3.150.0090.05212.67
5.3.140.0180.11212.66
5.3.130.0100.06712.66
5.3.120.0090.05612.66
5.3.110.0060.05512.65
5.3.100.0070.04712.13
5.3.90.0130.04212.11
5.3.80.0070.04612.09
5.3.70.0080.05612.09
5.3.60.0080.05512.08
5.3.50.0100.05112.03
5.3.40.0050.05912.03
5.3.30.0040.04611.99
5.3.20.0080.04111.77
5.3.10.0080.05211.73
5.3.00.0110.04411.72
5.2.170.0050.0339.22
5.2.160.0140.0409.23
5.2.150.0070.0359.22
5.2.140.0060.0369.22
5.2.130.0040.0329.18
5.2.120.0070.0319.18
5.2.110.0060.0349.19
5.2.100.0060.0339.18
5.2.90.0020.0399.18
5.2.80.0070.0379.18
5.2.70.0090.0389.18
5.2.60.0070.0369.13
5.2.50.0090.0389.10
5.2.40.0050.0369.08
5.2.30.0060.0379.05
5.2.20.0110.0559.04
5.2.10.0100.0328.95
5.2.00.0100.0838.81
5.1.60.0050.0358.09
5.1.50.0070.0338.09
5.1.40.0050.0358.07
5.1.30.0070.0358.42
5.1.20.0050.0418.44
5.1.10.0050.0368.16
5.1.00.0040.0368.17
5.0.50.0060.0276.64
5.0.40.0030.0276.51
5.0.30.0080.0366.31
5.0.20.0040.0406.28
5.0.10.0040.0316.27
5.0.00.0070.0426.26
4.4.90.0030.0294.78
4.4.80.0040.0264.75
4.4.70.0030.0264.76
4.4.60.0050.0224.75
4.4.50.0050.0234.77
4.4.40.0050.0374.71
4.4.30.0070.0214.76
4.4.20.0020.0284.84
4.4.10.0050.0244.84
4.4.00.0040.0424.76
4.3.110.0030.0264.67
4.3.100.0010.0264.66
4.3.90.0050.0224.63
4.3.80.0030.0364.58
4.3.70.0040.0294.63
4.3.60.0070.0214.62
4.3.50.0080.0254.63
4.3.40.0060.0334.54
4.3.30.0030.0203.30
4.3.20.0040.0303.28
4.3.10.0050.0243.24
4.3.00.0300.0208.14

preferences:
43.31 ms | 401 KiB | 5 Q