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 ); } } $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.0120.00616.50
8.3.50.0130.00322.05
8.3.40.0030.01418.82
8.3.30.0070.01019.07
8.3.20.0070.00020.34
8.3.10.0050.00323.64
8.3.00.0040.00419.38
8.2.180.0120.00318.43
8.2.170.0070.01022.96
8.2.160.0140.00720.33
8.2.150.0000.00824.18
8.2.140.0090.00624.66
8.2.130.0070.00726.16
8.2.120.0000.00822.08
8.2.110.0070.00322.11
8.2.100.0120.00017.72
8.2.90.0080.00019.08
8.2.80.0040.00418.05
8.2.70.0030.00517.75
8.2.60.0060.00317.93
8.2.50.0000.00818.07
8.2.40.0030.00519.69
8.2.30.0040.00417.94
8.2.20.0000.00717.81
8.2.10.0000.00818.04
8.2.00.0070.00317.80
8.1.280.0130.00725.92
8.1.270.0030.00623.97
8.1.260.0040.00426.35
8.1.250.0000.01528.09
8.1.240.0040.00423.68
8.1.230.0050.00519.23
8.1.220.0080.00017.79
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0040.00417.63
8.1.180.0000.00918.10
8.1.170.0050.00518.59
8.1.160.0070.00021.86
8.1.150.0030.00618.50
8.1.140.0040.00417.45
8.1.130.0030.00317.82
8.1.120.0070.00017.30
8.1.110.0030.00717.41
8.1.100.0000.00717.41
8.1.90.0070.00017.39
8.1.80.0070.00017.32
8.1.70.0060.00317.38
8.1.60.0050.00317.56
8.1.50.0030.00617.51
8.1.40.0000.00717.45
8.1.30.0000.00817.61
8.1.20.0030.00517.68
8.1.10.0050.00217.52
8.1.00.0080.00017.50
8.0.300.0000.00819.09
8.0.290.0000.00717.05
8.0.280.0030.00318.44
8.0.270.0000.00817.37
8.0.260.0000.00618.40
8.0.250.0000.00917.03
8.0.240.0020.00516.98
8.0.230.0000.00717.09
8.0.220.0000.00716.94
8.0.210.0000.01016.96
8.0.200.0000.00616.93
8.0.190.0040.00416.93
8.0.180.0040.00417.04
8.0.170.0000.00816.89
8.0.160.0000.00716.90
8.0.150.0030.00316.94
8.0.140.0040.00416.81
8.0.130.0070.00013.37
8.0.120.0000.00816.98
8.0.110.0000.00716.89
8.0.100.0000.00716.84
8.0.90.0040.00416.71
8.0.80.0130.00416.95
8.0.70.0030.00316.86
8.0.60.0040.00417.01
8.0.50.0040.00416.84
8.0.30.0080.01417.22
8.0.20.0090.01417.40
8.0.10.0070.00017.00
8.0.00.0080.00916.71
7.4.330.0000.00515.00
7.4.320.0000.00816.65
7.4.300.0030.00316.50
7.4.290.0000.00716.61
7.4.280.0030.00316.62
7.4.270.0050.00316.50
7.4.260.0000.00716.58
7.4.250.0000.00816.57
7.4.240.0020.00616.51
7.4.230.0020.00516.67
7.4.220.0120.00616.52
7.4.210.0100.00716.62
7.4.200.0000.00716.63
7.4.190.0000.00716.66
7.4.160.0120.00616.41
7.4.150.0100.01017.40
7.4.140.0120.00817.86
7.4.130.0140.00316.60
7.4.120.0050.01216.58
7.4.110.0120.00616.65
7.4.100.0120.00916.39
7.4.90.0180.00616.57
7.4.80.0090.00919.39
7.4.70.0110.00816.46
7.4.60.0030.01316.60
7.4.50.0040.00416.66
7.4.40.0070.00722.77
7.4.30.0030.01316.41
7.4.10.0100.00714.87
7.4.00.0050.01114.99
7.3.330.0060.00013.37
7.3.320.0000.00513.18
7.3.310.0070.00016.40
7.3.300.0070.00016.31
7.3.290.0130.00016.38
7.3.280.0080.00716.36
7.3.270.0030.01417.40
7.3.260.0150.00416.69
7.3.250.0120.00616.40
7.3.240.0060.01116.43
7.3.230.0040.01816.39
7.3.210.0060.01216.30
7.3.200.0090.00919.39
7.3.190.0060.01516.51
7.3.180.0140.00316.53
7.3.170.0080.00816.38
7.3.160.0070.01116.44
7.3.130.0110.00514.84
7.3.120.0060.01114.73
7.3.110.0080.01014.76
7.3.100.0050.01014.93
7.3.90.0080.00614.68
7.3.80.0060.00814.88
7.3.70.0090.00414.83
7.3.60.0030.01014.90
7.3.50.0080.00414.88
7.3.40.0030.00814.80
7.3.30.0060.00714.77
7.3.20.0060.00416.72
7.3.10.0040.01016.53
7.3.00.0050.00816.71
7.2.330.0060.01016.79
7.2.320.0130.00416.43
7.2.310.0100.00716.70
7.2.300.0330.01916.46
7.2.290.0130.00316.42
7.2.260.0070.01115.03
7.2.250.0090.00815.08
7.2.240.0050.01215.16
7.2.230.0050.01515.22
7.2.220.0050.01415.15
7.2.210.0100.00715.05
7.2.200.0070.00715.04
7.2.190.0080.00914.95
7.2.180.0020.01015.23
7.2.170.0020.01115.14
7.2.160.0050.01014.84
7.2.150.0050.00916.85
7.2.140.0070.00716.76
7.2.130.0050.01016.94
7.2.120.0040.00916.92
7.2.110.0100.00416.71
7.2.100.0070.00716.85
7.2.90.0040.01216.87
7.2.80.0050.01016.89
7.2.70.0060.00816.94
7.2.60.0090.00316.81
7.2.50.0030.01016.89
7.2.40.0110.00316.95
7.2.30.0030.00917.09
7.2.20.0050.00716.92
7.2.10.0070.00516.94
7.2.00.0080.00617.76
7.1.330.0090.00715.76
7.1.320.0060.00915.69
7.1.310.0050.00915.72
7.1.300.0120.00115.57
7.1.290.0050.00515.63
7.1.280.0030.01115.79
7.1.270.0070.00615.77
7.1.260.0050.00515.63
7.1.250.0060.00715.59
7.1.240.0050.01015.62
7.1.230.0080.00715.72
7.1.220.0060.00915.84
7.1.210.0080.00515.63
7.1.200.0080.00715.50
7.1.190.0040.01015.67
7.1.180.0040.00915.62
7.1.170.0060.00415.45
7.1.160.0020.01015.68
7.1.150.0040.00915.63
7.1.140.0120.00215.69
7.1.130.0090.00315.64
7.1.120.0060.00415.76
7.1.110.0070.00915.81
7.1.100.0060.00916.46
7.1.90.0080.01015.71
7.1.80.0070.00715.68
7.1.70.0060.00616.13
7.1.60.0060.01216.83
7.1.50.0070.00716.07
7.1.40.0030.01015.78
7.1.30.0010.00915.50
7.1.20.0060.00815.76
7.1.10.0100.00615.62
7.1.00.0040.03017.98
7.0.330.0070.00415.49
7.0.320.0110.00315.31
7.0.310.0020.00915.23
7.0.300.0050.00715.31
7.0.290.0050.00515.29
7.0.280.0040.01115.48
7.0.270.0090.00415.21
7.0.260.0060.00815.40
7.0.250.0070.00815.32
7.0.240.0050.01415.22
7.0.230.0090.00315.27
7.0.220.0080.00615.24
7.0.210.0070.00515.60
7.0.200.0040.00915.83
7.0.190.0060.00915.46
7.0.180.0020.01115.36
7.0.170.0050.00815.45
7.0.160.0060.00515.29
7.0.150.0020.01215.18
7.0.140.0080.02817.67
7.0.130.0080.00615.40
7.0.120.0040.01115.29
7.0.110.0060.00515.24
7.0.100.0050.00815.38
7.0.90.0040.00715.44
7.0.80.0060.00615.35
7.0.70.0030.01315.42
7.0.60.0080.02516.97
7.0.50.0020.02216.26
7.0.40.0070.03015.77
7.0.30.0060.02715.71
7.0.20.0070.02615.59
7.0.10.0080.02615.71
7.0.00.0050.03515.71
5.6.400.0080.00314.26
5.6.390.0050.00614.38
5.6.380.0060.00514.18
5.6.370.0070.00814.38
5.6.360.0080.00514.43
5.6.350.0020.01214.14
5.6.340.0040.00914.45
5.6.330.0070.00514.47
5.6.320.0050.01014.22
5.6.310.0060.00914.36
5.6.300.0070.00714.39
5.6.290.0050.01014.38
5.6.280.0090.02516.55
5.6.270.0100.00314.53
5.6.260.0040.00914.28
5.6.250.0040.00914.30
5.6.240.0040.00814.28
5.6.230.0050.00814.48
5.6.220.0090.00414.29
5.6.210.0040.03216.28
5.6.200.0060.02015.70
5.6.190.0060.03616.41
5.6.180.0090.02516.27
5.6.170.0160.02516.37
5.6.160.0080.01916.41
5.6.150.0060.02215.47
5.6.140.0060.03115.50
5.6.130.0070.02215.55
5.6.120.0070.01816.69
5.6.110.0090.03216.47
5.6.100.0080.03316.54
5.6.90.0080.02816.50
5.6.80.0060.02516.23
5.6.70.0030.01114.09
5.6.60.0040.01014.19
5.6.50.0060.00714.18
5.6.40.0060.00714.26
5.6.30.0050.00914.14
5.6.20.0060.00914.04
5.6.10.0050.00814.09
5.6.00.0100.00514.18
5.5.380.0070.00714.14
5.5.370.0020.01114.35
5.5.360.0080.00614.27
5.5.350.0050.03816.25
5.5.340.0050.03115.56
5.5.330.0080.03016.38
5.5.320.0120.01916.42
5.5.310.0160.03216.21
5.5.300.0050.03215.38
5.5.290.0030.03315.66
5.5.280.0110.03016.38
5.5.270.0030.03616.32
5.5.260.0080.01816.37
5.5.250.0060.03816.21
5.5.240.0820.01716.26
5.5.230.0070.00714.23
5.5.220.0070.00314.26
5.5.210.0070.00514.28
5.5.200.0020.00914.18
5.5.190.0090.00514.37
5.5.180.0070.00914.19
5.5.170.0090.00414.31
5.5.160.0090.00514.05
5.5.150.0090.00514.31
5.5.140.0020.01314.13
5.5.130.0070.00614.27
5.5.120.0080.00614.25
5.5.110.0020.01114.21
5.5.100.0050.01014.10
5.5.90.0100.00414.14
5.5.80.0080.00514.13
5.5.70.0030.00914.04
5.5.60.0050.00914.36
5.5.50.0020.01214.09
5.5.40.0050.00614.19
5.5.30.0080.00314.14
5.5.20.0050.00914.36
5.5.10.0020.00814.30
5.5.00.0050.00714.08
5.4.450.0270.02314.72
5.4.440.0290.02514.63
5.4.430.0300.02314.73
5.4.420.0250.02014.54
5.4.410.0070.02114.61
5.4.400.0280.02014.53
5.4.390.0270.02414.63
5.4.380.0180.02414.36
5.4.370.0120.03014.32
5.4.360.0220.02214.47
5.4.350.0210.02714.31
5.4.340.0110.02514.53
5.4.330.0040.00512.22
5.4.320.0040.01912.33
5.4.310.0050.01612.37
5.4.300.0060.01612.31
5.4.290.0050.02712.32
5.4.280.0040.02312.20
5.4.270.0050.02312.27
5.4.260.0070.02612.17
5.4.250.0060.02312.29
5.4.240.0120.02912.37
5.4.230.0100.03412.16
5.4.220.0080.02712.34
5.4.210.0080.02712.27
5.4.200.0090.02912.29
5.4.190.0040.02312.34
5.4.180.0060.02412.34
5.4.170.0070.03712.26
5.4.160.0060.02212.19
5.4.150.0040.02112.24
5.4.140.0080.02712.07
5.4.130.0080.02112.21
5.4.120.0050.02412.19
5.4.110.0070.01912.19
5.4.100.0070.01812.21
5.4.90.0050.02112.23
5.4.80.0040.02912.13
5.4.70.0050.02312.10
5.4.60.0050.02412.09
5.4.50.0060.02512.17
5.4.40.0070.01312.19
5.4.30.0040.02112.13
5.4.20.0050.02412.17
5.4.10.0070.01712.08
5.4.00.0040.01911.97
5.3.290.0040.01712.22
5.3.280.0060.01712.21
5.3.270.0020.01912.20
5.3.260.0040.01912.27
5.3.250.0040.02012.26
5.3.240.0040.01712.17
5.3.230.0050.01612.15
5.3.220.0030.01712.22
5.3.210.0060.01812.20
5.3.200.0050.01712.20
5.3.190.0070.01812.22
5.3.180.0060.01712.26
5.3.170.0040.01712.18
5.3.160.0040.01712.28
5.3.150.0020.02012.26
5.3.140.0040.01812.24
5.3.130.0050.01912.15
5.3.120.0050.01912.24
5.3.110.0040.01812.13
5.3.100.0050.01712.06
5.3.90.0050.01611.99
5.3.80.0040.01812.02
5.3.70.0040.01612.02
5.3.60.0050.01612.04
5.3.50.0030.01812.02
5.3.40.0050.01612.04
5.3.30.0030.01611.96
5.3.20.0060.01611.87
5.3.10.0070.01811.82
5.3.00.0060.02011.84
5.2.170.0060.0699.23
5.2.160.0070.0409.22
5.2.150.0050.0429.23
5.2.140.0090.0399.22
5.2.130.0050.0389.18
5.2.120.0040.0299.18
5.2.110.0040.0309.19
5.2.100.0060.0279.19
5.2.90.0040.0309.19
5.2.80.0060.0299.18
5.2.70.0040.0319.18
5.2.60.0040.0319.14
5.2.50.0060.0289.10
5.2.40.0040.0309.08
5.2.30.0030.0329.05
5.2.20.0060.0289.04
5.2.10.0050.0288.95
5.2.00.0070.0288.82
5.1.60.0040.0278.09
5.1.50.0040.0328.09
5.1.40.0040.0308.08
5.1.30.0030.0298.42
5.1.20.0090.0238.44
5.1.10.0060.0258.17
5.1.00.0080.0228.17
5.0.50.0060.0196.65
5.0.40.0050.0186.51
5.0.30.0010.0346.32
5.0.20.0040.0216.29
5.0.10.0060.0186.27
5.0.00.0040.0336.27
4.4.90.0040.0154.78
4.4.80.0020.0164.76
4.4.70.0020.0184.75
4.4.60.0050.0134.75
4.4.50.0040.0154.77
4.4.40.0020.0264.71
4.4.30.0030.0164.76
4.4.20.0060.0134.84
4.4.10.0030.0154.85
4.4.00.0030.0254.75
4.3.110.0030.0154.66
4.3.100.0030.0184.66
4.3.90.0030.0154.64
4.3.80.0010.0304.58
4.3.70.0020.0154.63
4.3.60.0040.0144.63
4.3.50.0040.0144.63
4.3.40.0020.0254.54
4.3.30.0030.0163.30
4.3.20.0010.0183.28
4.3.10.0020.0163.24
4.3.00.0000.01710.54

preferences:
48.77 ms | 401 KiB | 5 Q