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 class Intercept { public function getKey($test) { $array = (array) $test; print_r('reading:'.$array[0] ); } } $intercept = new Intercept; $intercept->getKey($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.60.0100.01018.43
8.3.50.0230.01122.05
8.3.40.0230.00718.89
8.3.30.0070.00719.22
8.3.20.0040.00420.20
8.3.10.0000.00823.56
8.3.00.0040.00419.50
8.2.180.0070.00717.13
8.2.170.0070.00722.96
8.2.160.0170.00320.44
8.2.150.0100.01024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0090.00022.25
8.2.110.0030.00720.35
8.2.100.0040.00817.84
8.2.90.0050.00319.34
8.2.80.0080.00017.97
8.2.70.0080.00017.75
8.2.60.0080.00018.05
8.2.50.0040.00418.10
8.2.40.0040.00419.88
8.2.30.0050.00318.00
8.2.20.0030.00517.69
8.2.10.0040.00418.18
8.2.00.0030.00717.70
8.1.280.0070.01025.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0090.00021.09
8.1.230.0000.01217.70
8.1.220.0000.00917.78
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0000.00917.35
8.1.180.0050.00318.10
8.1.170.0000.01018.27
8.1.160.0000.00722.00
8.1.150.0030.00518.48
8.1.140.0000.00817.30
8.1.130.0000.00717.43
8.1.120.0000.00717.36
8.1.110.0030.00617.29
8.1.100.0050.00317.44
8.1.90.0060.00317.38
8.1.80.0030.00317.23
8.1.70.0040.00417.41
8.1.60.0030.00617.47
8.1.50.0000.00817.52
8.1.40.0000.00717.51
8.1.30.0000.00817.63
8.1.20.0000.00817.50
8.1.10.0000.00717.56
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0060.00316.75
8.0.280.0070.00018.41
8.0.270.0030.00317.28
8.0.260.0030.00316.80
8.0.250.0040.00417.04
8.0.240.0070.00316.91
8.0.230.0000.00817.04
8.0.220.0030.00317.01
8.0.210.0030.00316.98
8.0.200.0030.00316.91
8.0.190.0040.00416.94
8.0.180.0100.00016.96
8.0.170.0040.00417.01
8.0.160.0080.00016.96
8.0.150.0070.00016.96
8.0.140.0060.00316.80
8.0.130.0000.00613.35
8.0.120.0030.00616.94
8.0.110.0040.00416.92
8.0.100.0000.00816.91
8.0.90.0040.00416.87
8.0.80.0100.00716.85
8.0.70.0000.00816.71
8.0.60.0020.00516.83
8.0.50.0040.00416.76
8.0.30.0120.00916.81
8.0.20.0090.01217.40
8.0.10.0050.00316.88
8.0.00.0090.01016.71
7.4.330.0060.00015.00
7.4.320.0030.00316.46
7.4.300.0070.00016.61
7.4.290.0000.00716.60
7.4.280.0030.00316.40
7.4.270.0070.00016.60
7.4.260.0070.00016.63
7.4.250.0080.00016.57
7.4.240.0030.00316.59
7.4.230.0000.00716.40
7.4.220.0000.01916.63
7.4.210.0070.00816.62
7.4.200.0000.00816.69
7.4.190.0030.00316.65
7.4.160.0070.01616.44
7.4.150.0070.01117.40
7.4.140.0100.00817.86
7.4.130.0120.00616.51
7.4.120.0090.00816.55
7.4.110.0170.00716.79
7.4.100.0120.00616.55
7.4.90.0120.00616.57
7.4.80.0070.01919.39
7.4.70.0120.00616.38
7.4.60.0060.01616.64
7.4.50.0000.00816.59
7.4.40.0030.01322.77
7.4.30.0110.00616.58
7.4.00.0100.00615.07
7.3.330.0030.00313.43
7.3.320.0000.00613.31
7.3.310.0030.00616.44
7.3.300.0000.00916.52
7.3.290.0090.00616.38
7.3.280.0050.01316.32
7.3.270.0170.00717.40
7.3.260.0410.00916.40
7.3.250.0060.01116.47
7.3.240.0060.00916.41
7.3.230.0110.01116.39
7.3.210.0110.00616.32
7.3.200.0160.00619.39
7.3.190.0110.00516.51
7.3.180.0040.01216.40
7.3.170.0030.01316.46
7.3.160.0120.00316.52
7.3.120.0060.00814.86
7.3.110.0110.00714.93
7.3.100.0060.01314.98
7.3.90.0040.01115.10
7.3.80.0100.00714.84
7.3.70.0060.00914.84
7.3.60.0090.00014.93
7.3.50.0040.01114.84
7.3.40.0100.00014.89
7.3.30.0000.01314.84
7.3.20.0070.00716.46
7.3.10.0090.00016.55
7.3.00.0080.00316.73
7.2.330.0130.00316.77
7.2.320.0030.01316.48
7.2.310.0060.01016.45
7.2.300.0100.00716.71
7.2.290.0050.01116.89
7.2.250.0060.01514.84
7.2.240.0070.01115.11
7.2.230.0120.00415.22
7.2.220.0000.01515.09
7.2.210.0070.00714.98
7.2.200.0000.01414.97
7.2.190.0000.01815.07
7.2.180.0060.01015.20
7.2.170.0030.01015.30
7.2.160.0090.00615.00
7.2.150.0070.00416.78
7.2.140.0000.01217.06
7.2.130.0030.00917.00
7.2.120.0060.01016.74
7.2.110.0060.00916.69
7.2.100.0110.00317.12
7.2.90.0070.01116.82
7.2.80.0070.01016.75
7.2.70.0030.01017.05
7.2.60.0050.00816.97
7.2.50.0030.00716.98
7.2.40.0070.00716.92
7.2.30.0140.00316.99
7.2.20.0030.01017.13
7.2.10.0060.00916.92
7.2.00.0040.01018.25
7.1.330.0100.00715.68
7.1.320.0000.01215.93
7.1.310.0000.01215.90
7.1.300.0040.01115.88
7.1.290.0000.01315.99
7.1.280.0030.00715.79
7.1.270.0130.00315.61
7.1.260.0090.00615.54
7.1.250.0060.00315.84
7.1.240.0030.00915.77
7.1.230.0120.00315.79
7.1.220.0030.01415.91
7.1.210.0030.00615.80
7.1.200.0030.01015.76
7.1.190.0030.01215.95
7.1.180.0030.01515.55
7.1.170.0090.00015.99
7.1.160.0070.00715.74
7.1.150.0070.00415.46
7.1.140.0130.00015.83
7.1.130.0040.01115.68
7.1.120.0060.00615.94
7.1.110.0030.01215.75
7.1.100.0000.01117.05
7.1.90.0100.00715.88
7.1.80.0080.00815.74
7.1.70.0060.01016.51
7.1.60.0090.00917.52
7.1.50.0040.00916.33
7.1.40.0060.00615.86
7.1.30.0070.01015.87
7.1.20.0030.01315.87
7.1.10.0000.01715.86
7.1.00.0090.04619.02
7.0.330.0040.00715.34
7.0.320.0040.01114.98
7.0.310.0120.00615.52
7.0.300.0000.01315.35
7.0.290.0060.00315.35
7.0.280.0000.01515.47
7.0.270.0060.00315.54
7.0.260.0040.00715.48
7.0.250.0040.00415.38
7.0.240.0080.00615.32
7.0.230.0060.01015.25
7.0.220.0070.01115.55
7.0.210.0030.01315.48
7.0.200.0360.01015.21
7.0.190.0070.00715.48
7.0.180.0090.00315.59
7.0.170.0080.00315.40
7.0.160.0070.00715.43
7.0.150.0090.00915.46
7.0.140.0030.04018.82
7.0.130.0070.00715.55
7.0.120.0030.00515.34
7.0.110.0050.00515.47
7.0.100.0040.00815.18
7.0.90.0030.01015.48
7.0.80.0110.00415.44
7.0.70.0040.01115.20
7.0.60.0030.02517.51
7.0.50.0030.02716.51
7.0.40.0090.04317.55
7.0.30.0150.02217.45
7.0.20.0150.04517.55
7.0.10.0060.03617.54
7.0.00.0050.02517.46
5.6.400.0070.00714.84
5.6.390.0000.01314.84
5.6.380.0030.01314.84
5.6.370.0090.00914.84
5.6.360.0070.00714.84
5.6.350.0030.01014.84
5.6.340.0030.01414.84
5.6.330.0030.01014.84
5.6.320.0060.00914.84
5.6.310.0100.00314.84
5.6.300.0030.00914.84
5.6.290.0030.01014.84
5.6.280.0030.04217.98
5.6.270.0090.00614.84
5.6.260.0000.01514.84
5.6.250.0000.01214.84
5.6.240.0070.00314.84
5.6.230.0000.01114.84
5.6.220.0070.00714.84
5.6.210.0080.04517.79
5.6.200.0030.02716.54
5.6.190.0090.04617.71
5.6.180.0150.04017.71
5.6.170.0120.02917.78
5.6.160.0050.03817.78
5.6.150.0060.04316.51
5.6.140.0050.04416.56
5.6.130.0080.04516.51
5.6.120.0070.04518.00
5.6.110.0050.04817.92
5.6.100.0050.03817.98
5.6.90.0120.04017.96
5.6.80.0070.04417.68
5.6.70.0070.01014.84
5.6.60.0060.00614.84
5.6.50.0030.01214.84
5.6.40.0030.00914.84
5.6.30.0030.01114.84
5.6.20.0000.01214.84
5.6.10.0030.01014.84
5.6.00.0100.00014.84
5.5.380.0110.00014.84
5.5.370.0100.00314.84
5.5.360.0110.00714.84
5.5.350.0210.03817.62
5.5.340.0100.04316.46
5.5.330.0060.02817.63
5.5.320.0150.03117.63
5.5.310.0230.03817.54
5.5.300.0060.02116.44
5.5.290.0020.02816.46
5.5.280.0100.04117.84
5.5.270.0050.02717.84
5.5.260.0070.04617.90
5.5.250.0060.04217.73
5.5.240.2100.02517.50
5.5.230.0060.00914.84
5.5.220.0060.00614.84
5.5.210.0040.01114.84
5.5.200.0070.00714.84
5.5.190.0060.00914.84
5.5.180.0070.00714.84
5.5.170.0030.01314.84
5.5.160.0030.00714.84
5.5.150.0100.00314.84
5.5.140.0000.00914.84
5.5.130.0070.00714.84
5.5.120.0030.00714.84
5.5.110.0070.00714.84
5.5.100.0060.00614.84
5.5.90.0070.00714.84
5.5.80.0000.01014.84
5.5.70.0070.00714.84
5.5.60.0060.00914.84
5.5.50.0030.00914.84
5.5.40.0100.00014.84
5.5.30.0100.00014.84
5.5.20.0040.01114.84
5.5.10.0060.00614.84
5.5.00.0000.01014.84
5.4.450.0430.02917.23
5.4.440.0400.02517.20
5.4.430.0080.03417.00
5.4.420.0450.04117.15
5.4.410.0100.03017.00
5.4.400.0550.02517.03
5.4.390.0530.03017.05
5.4.380.0190.03516.84
5.4.370.0150.03016.82
5.4.360.0150.03116.66
5.4.350.0230.03716.84
5.4.340.0270.02916.84
5.4.330.0000.00714.84
5.4.320.0070.02213.67
5.4.310.0050.02813.67
5.4.300.0040.02213.67
5.4.290.0030.02513.66
5.4.280.0060.02213.62
5.4.270.0050.02113.61
5.4.260.0040.02313.61
5.4.250.0060.02213.61
5.4.240.0040.02313.61
5.4.230.0050.02413.61
5.4.220.0020.02313.61
5.4.210.0060.01913.61
5.4.200.0050.02313.61
5.4.190.0050.02313.61
5.4.180.0030.02413.61
5.4.170.0070.01813.61
5.4.160.0060.01813.61
5.4.150.0080.02113.61
5.4.140.0020.02613.45
5.4.130.0020.02413.45
5.4.120.0040.02313.42
5.4.110.0080.01813.42
5.4.100.0050.02113.42
5.4.90.0050.02213.42
5.4.80.0060.02213.42
5.4.70.0040.02313.42
5.4.60.0090.02713.42
5.4.50.0100.02113.42
5.4.40.0050.02213.41
5.4.30.0040.02213.41
5.4.20.0040.02013.41
5.4.10.0020.02213.41
5.4.00.0040.02213.16
5.3.290.0050.02513.82
5.3.280.0020.02613.78
5.3.270.0050.02313.78
5.3.260.0080.02113.78
5.3.250.0050.02213.78
5.3.240.0070.02113.78
5.3.230.0070.01913.78
5.3.220.0080.01913.76
5.3.210.0070.02013.76
5.3.200.0070.01913.76
5.3.190.0070.01813.76
5.3.180.0040.02013.76
5.3.170.0050.02013.76
5.3.160.0040.02213.76
5.3.150.0040.02113.76
5.3.140.0070.01913.75
5.3.130.0080.01813.75
5.3.120.0040.02113.75
5.3.110.0040.02213.75
5.3.100.0100.02013.48
5.3.90.0080.02613.48
5.3.80.0060.02513.47
5.3.70.0060.02013.47
5.3.60.0060.02013.46
5.3.50.0040.02213.44
5.3.40.0070.02013.44
5.3.30.0050.01913.42
5.3.20.0030.02313.31
5.3.10.0020.02413.29
5.3.00.0070.01913.28
5.2.170.0050.0319.23
5.2.160.0040.0309.22
5.2.150.0050.0309.22
5.2.140.0030.0339.22
5.2.130.0070.0279.18
5.2.120.0050.0289.18
5.2.110.0030.0309.20
5.2.100.0040.0299.19
5.2.90.0080.0269.19
5.2.80.0040.0319.18
5.2.70.0060.0299.18
5.2.60.0030.0329.14
5.2.50.0040.0329.11
5.2.40.0060.0299.09
5.2.30.0040.0319.05
5.2.20.0050.0299.04
5.2.10.0070.0308.95
5.2.00.0040.0338.82
5.1.60.0060.0248.10
5.1.50.0050.0258.09
5.1.40.0030.0268.07
5.1.30.0050.0258.43
5.1.20.0010.0308.45
5.1.10.0060.0268.17
5.1.00.0040.0268.18
5.0.50.0050.0196.65
5.0.40.0030.0206.51
5.0.30.0010.0336.32
5.0.20.0040.0186.29
5.0.10.0030.0206.27
5.0.00.0030.0416.27
4.4.90.0040.0144.78
4.4.80.0030.0154.76
4.4.70.0030.0154.75
4.4.60.0030.0154.76
4.4.50.0040.0144.77
4.4.40.0050.0284.71
4.4.30.0020.0194.76
4.4.20.0040.0144.84
4.4.10.0040.0144.85
4.4.00.0020.0264.75
4.3.110.0020.0244.67
4.3.100.0050.0144.67
4.3.90.0030.0194.63
4.3.80.0030.0264.58
4.3.70.0010.0204.63
4.3.60.0030.0224.63
4.3.50.0030.0194.63
4.3.40.0010.0254.54
4.3.30.0000.0183.30
4.3.20.0030.0153.28
4.3.10.0010.0183.23
4.3.00.0170.01310.54

preferences:
54.61 ms | 401 KiB | 5 Q