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($array[Testsecret]); } } $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.0070.00716.88
8.3.50.0100.00521.93
8.3.40.0190.00018.82
8.3.30.0070.00719.13
8.3.20.0080.00020.33
8.3.10.0070.00023.48
8.3.00.0000.00919.25
8.2.180.0110.01118.66
8.2.170.0090.00622.96
8.2.160.0120.00920.41
8.2.150.0100.01024.18
8.2.140.0140.00024.66
8.2.130.0050.00326.16
8.2.120.0070.00022.25
8.2.110.0050.00521.01
8.2.100.0060.00617.72
8.2.90.0030.00618.34
8.2.80.0080.00018.22
8.2.70.0000.00917.75
8.2.60.0050.00319.79
8.2.50.0040.00418.07
8.2.40.0050.00320.07
8.2.30.0110.00018.06
8.2.20.0050.00217.81
8.2.10.0040.00418.06
8.2.00.0050.00317.73
8.1.280.0000.01425.92
8.1.270.0030.00622.14
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0040.00721.95
8.1.230.0100.00322.73
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0000.00817.38
8.1.190.0050.00317.53
8.1.180.0030.00718.10
8.1.170.0050.00318.54
8.1.160.0070.00022.01
8.1.150.0070.00318.68
8.1.140.0000.00717.32
8.1.130.0030.00317.70
8.1.120.0000.00717.33
8.1.110.0000.00917.41
8.1.100.0050.00317.43
8.1.90.0040.00417.43
8.1.80.0030.00317.34
8.1.70.0000.00717.41
8.1.60.0040.00417.49
8.1.50.0040.00417.49
8.1.40.0040.00417.54
8.1.30.0080.00017.52
8.1.20.0040.00417.70
8.1.10.0040.00417.57
8.1.00.0030.00517.42
8.0.300.0040.00419.88
8.0.290.0070.00016.75
8.0.280.0070.00018.37
8.0.270.0000.00717.25
8.0.260.0040.00417.29
8.0.250.0050.00216.93
8.0.240.0000.00817.04
8.0.230.0030.00317.07
8.0.220.0030.00316.95
8.0.210.0000.00916.85
8.0.200.0060.00016.90
8.0.190.0040.00416.97
8.0.180.0040.00417.00
8.0.170.0080.00016.91
8.0.160.0040.00416.92
8.0.150.0000.00816.86
8.0.140.0000.00716.80
8.0.130.0070.00013.47
8.0.120.0000.00716.98
8.0.110.0040.00416.93
8.0.100.0000.00716.84
8.0.90.0000.00716.74
8.0.80.0100.01116.88
8.0.70.0040.00416.88
8.0.60.0070.00016.99
8.0.50.0050.00316.91
8.0.30.0140.00517.19
8.0.20.0110.00817.40
8.0.10.0000.00716.95
8.0.00.0060.01116.84
7.4.330.0050.00015.00
7.4.320.0000.00716.43
7.4.300.0060.00016.65
7.4.290.0030.00316.47
7.4.280.0000.00716.49
7.4.270.0040.00416.45
7.4.260.0070.00016.48
7.4.250.0030.00316.37
7.4.240.0020.00516.52
7.4.230.0000.00716.70
7.4.220.0130.01316.59
7.4.210.0040.01216.57
7.4.200.0000.00816.67
7.4.190.0000.00716.65
7.4.160.0060.01316.47
7.4.150.0070.01017.40
7.4.140.0080.01017.86
7.4.130.0110.00616.55
7.4.120.0100.00816.43
7.4.110.0140.01016.62
7.4.100.0090.01216.54
7.4.90.0090.01416.63
7.4.80.0090.01119.39
7.4.70.0040.01416.58
7.4.60.0080.00816.48
7.4.50.0040.00416.65
7.4.40.0030.00722.77
7.4.30.0070.01016.44
7.4.10.0070.01114.97
7.4.00.0100.00714.91
7.3.330.0030.00313.44
7.3.320.0000.00513.40
7.3.310.0000.00716.27
7.3.300.0040.00416.35
7.3.290.0060.00616.33
7.3.280.0090.00716.34
7.3.270.0070.01117.40
7.3.260.0170.01016.43
7.3.250.0120.00716.38
7.3.240.0060.00916.50
7.3.230.0070.01016.41
7.3.210.0120.00916.45
7.3.200.0070.01119.39
7.3.190.0100.00716.36
7.3.180.0000.02116.59
7.3.170.0060.01316.44
7.3.160.0090.01216.52
7.3.130.0090.00914.70
7.3.120.0080.00914.81
7.3.110.0070.01114.75
7.3.100.0080.00414.82
7.3.90.0050.00914.76
7.3.80.0060.00714.73
7.3.70.0060.00914.81
7.3.60.0070.00814.71
7.3.50.0020.00914.67
7.3.40.0050.00614.90
7.3.30.0050.00714.81
7.3.20.0060.01016.57
7.3.10.0090.00516.61
7.3.00.0060.00816.58
7.2.330.0130.00416.80
7.2.320.0140.00416.88
7.2.310.0110.00616.40
7.2.300.0090.01516.75
7.2.290.0080.00816.57
7.2.260.0060.01315.25
7.2.250.0060.01115.08
7.2.240.0080.01015.05
7.2.230.0050.00914.97
7.2.220.0040.00815.21
7.2.210.0040.01115.14
7.2.200.0060.00515.01
7.2.190.0050.01014.94
7.2.180.0070.00614.99
7.2.170.0050.01215.08
7.2.160.0030.00715.05
7.2.150.0100.00316.69
7.2.140.0110.00716.84
7.2.130.0070.00716.71
7.2.120.0100.00516.75
7.2.110.0060.00816.68
7.2.100.0060.01016.70
7.2.90.0070.00816.88
7.2.80.0060.00916.85
7.2.70.0040.01016.78
7.2.60.0070.00816.77
7.2.50.0090.00616.92
7.2.40.0040.01016.92
7.2.30.0080.00817.00
7.2.20.0070.00516.91
7.2.10.0060.00916.76
7.2.00.0070.00517.55
7.1.330.0060.00815.60
7.1.320.0050.00615.82
7.1.310.0070.00715.98
7.1.300.0080.00615.83
7.1.290.0070.00715.97
7.1.280.0060.00815.83
7.1.270.0030.00915.78
7.1.260.0050.00815.68
7.1.250.0070.00615.54
7.1.240.0110.00315.63
7.1.230.0070.00815.71
7.1.220.0020.01115.62
7.1.210.0060.00815.68
7.1.200.0080.00615.59
7.1.190.0090.00315.80
7.1.180.0050.01215.64
7.1.170.0050.01115.83
7.1.160.0060.00715.69
7.1.150.0070.00615.76
7.1.140.0070.00815.82
7.1.130.0070.00515.71
7.1.120.0110.00515.63
7.1.110.0050.00615.76
7.1.100.0060.00615.67
7.1.90.0050.01115.72
7.1.80.0050.00715.87
7.1.70.0060.00716.22
7.1.60.0070.00816.33
7.1.50.0110.00316.23
7.1.40.0110.00315.69
7.1.30.0110.00615.83
7.1.20.0120.00315.60
7.1.10.0050.00815.64
7.1.00.0060.03017.88
7.0.330.0050.01015.15
7.0.320.0040.01215.04
7.0.310.0060.00415.20
7.0.300.0050.00815.28
7.0.290.0080.00615.31
7.0.280.0110.00415.37
7.0.270.0080.00615.29
7.0.260.0100.00515.10
7.0.250.0070.00715.33
7.0.240.0050.00815.28
7.0.230.0070.00515.16
7.0.220.0090.00715.41
7.0.210.0060.00515.38
7.0.200.0090.00915.72
7.0.190.0110.00515.35
7.0.180.0100.00415.23
7.0.170.0110.00415.45
7.0.160.0070.01015.30
7.0.150.0110.00315.33
7.0.140.0040.03517.46
7.0.130.0140.00415.17
7.0.120.0080.00615.37
7.0.110.0040.01215.16
7.0.100.0070.00815.34
7.0.90.0060.00915.17
7.0.80.0050.00915.18
7.0.70.0050.01115.37
7.0.60.0050.03416.88
7.0.50.0080.03016.23
7.0.40.0080.03015.69
7.0.30.0130.01415.68
7.0.20.0100.03115.65
7.0.10.0060.02915.62
7.0.00.0030.02015.52
5.6.400.0080.00414.35
5.6.390.0000.01414.05
5.6.380.0070.00714.35
5.6.370.0090.00614.12
5.6.360.0040.01114.13
5.6.350.0060.00814.47
5.6.340.0060.00914.26
5.6.330.0020.01214.31
5.6.320.0040.00914.16
5.6.310.0060.01014.60
5.6.300.0040.01014.43
5.6.290.0060.01014.35
5.6.280.0040.03316.49
5.6.270.0130.00814.29
5.6.260.0030.01114.19
5.6.250.0110.00614.26
5.6.240.0090.00814.58
5.6.230.0050.00714.33
5.6.220.0080.00514.13
5.6.210.0060.01916.39
5.6.200.0020.02315.61
5.6.190.0060.02016.43
5.6.180.0100.02916.44
5.6.170.0180.02716.22
5.6.160.0070.02216.37
5.6.150.0060.02915.66
5.6.140.0070.02215.59
5.6.130.0050.03415.58
5.6.120.0100.02916.63
5.6.110.0030.03216.54
5.6.100.0060.03316.42
5.6.90.0040.03316.42
5.6.80.0070.02816.20
5.6.70.1560.01716.39
5.6.60.0060.00614.25
5.6.50.0030.00914.17
5.6.40.0080.00614.20
5.6.30.0060.00614.00
5.6.20.0080.00514.17
5.6.10.0020.01014.31
5.6.00.0050.00814.13
5.5.380.0050.00612.75
5.5.370.0050.00612.88
5.5.360.0060.00712.93
5.5.350.0120.02515.29
5.5.340.0000.02314.58
5.5.330.0060.03015.40
5.5.320.0140.01915.28
5.5.310.0130.02715.40
5.5.300.0030.03214.40
5.5.290.0080.01914.50
5.5.280.0040.01615.49
5.5.270.0040.02215.40
5.5.260.0110.02715.47
5.5.250.0130.02815.20
5.5.240.0090.03115.30
5.5.230.0030.00812.84
5.5.220.0050.00712.63
5.5.210.0080.00312.77
5.5.200.0090.00312.83
5.5.190.0020.00812.80
5.5.180.0030.00912.83
5.5.170.0040.00712.58
5.5.160.0050.00312.61
5.5.150.0040.00812.66
5.5.140.0080.00312.65
5.5.130.0050.00912.76
5.5.120.0060.00612.69
5.5.110.0020.00812.74
5.5.100.0050.00512.70
5.5.90.0000.00912.65
5.5.80.0050.00712.85
5.5.70.0040.00612.74
5.5.60.0050.00612.88
5.5.50.0040.00612.82
5.5.40.0070.00412.80
5.5.30.0030.00912.86
5.5.20.0030.00912.65
5.5.10.0060.00512.68
5.5.00.0040.00612.76
5.4.450.0270.03314.38
5.4.440.0350.02414.51
5.4.430.0220.02314.39
5.4.420.0060.02314.38
5.4.410.0270.01914.47
5.4.400.0190.02114.27
5.4.390.0350.02014.37
5.4.380.0170.01714.18
5.4.370.0060.02514.27
5.4.360.0130.01914.24
5.4.350.0160.01814.25
5.4.340.0110.02214.25
5.4.330.0030.00511.98
5.4.320.0050.01812.16
5.4.310.0050.01712.15
5.4.300.0080.01612.16
5.4.290.0020.01912.15
5.4.280.0050.01512.12
5.4.270.0040.01712.12
5.4.260.0040.01712.12
5.4.250.0040.01712.11
5.4.240.0030.01512.12
5.4.230.0050.01612.18
5.4.220.0070.01412.11
5.4.210.0050.01512.11
5.4.200.0030.02012.11
5.4.190.0040.01812.11
5.4.180.0040.02112.11
5.4.170.0070.01512.12
5.4.160.0020.01812.11
5.4.150.0050.01612.11
5.4.140.0050.01612.01
5.4.130.0020.02012.00
5.4.120.0030.01911.99
5.4.110.0070.01611.99
5.4.100.0060.01511.99
5.4.90.0040.01811.99
5.4.80.0040.01711.99
5.4.70.0080.01611.99
5.4.60.0050.01611.99
5.4.50.0060.01411.99
5.4.40.0040.01611.98
5.4.30.0080.01411.98
5.4.20.0040.01811.98
5.4.10.0050.02111.98
5.4.00.0040.01911.81
5.3.290.0040.01712.25
5.3.280.0070.01812.22
5.3.270.0080.01512.23
5.3.260.0040.02112.23
5.3.250.0050.02012.23
5.3.240.0100.01312.23
5.3.230.0060.02012.22
5.3.220.0050.02012.22
5.3.210.0040.01812.21
5.3.200.0040.01812.22
5.3.190.0030.01912.21
5.3.180.0060.01512.21
5.3.170.0050.01712.21
5.3.160.0060.01912.21
5.3.150.0030.02012.21
5.3.140.0040.01612.21
5.3.130.0030.01612.21
5.3.120.0050.01712.21
5.3.110.0050.01712.21
5.3.100.0020.01812.03
5.3.90.0040.01512.02
5.3.80.0080.01612.02
5.3.70.0040.01912.02
5.3.60.0040.01612.02
5.3.50.0040.01712.00
5.3.40.0020.01812.00
5.3.30.0050.01511.98
5.3.20.0030.01711.91
5.3.10.0080.01411.90
5.3.00.0040.01711.90
5.2.170.0070.01510.20
5.2.160.0030.01810.20
5.2.150.0050.02110.20
5.2.140.0060.02110.20
5.2.130.0060.02110.18
5.2.120.0060.02310.18
5.2.110.0080.01810.19
5.2.100.0080.01510.18
5.2.90.0040.01910.18
5.2.80.0040.01910.18
5.2.70.0020.01910.18
5.2.60.0020.01910.16
5.2.50.0020.02010.14
5.2.40.0040.01610.13
5.2.30.0020.02010.12
5.2.20.0030.01710.11
5.2.10.0060.01610.06
5.2.00.0040.01810.00
5.1.60.0040.0159.64
5.1.50.0050.0159.63
5.1.40.0060.0159.63
5.1.30.0060.0159.80
5.1.20.0020.0189.81
5.1.10.0020.0199.67
5.1.00.0050.0169.67
5.0.50.0020.0178.91
5.0.40.0030.0118.85
5.0.30.0030.0198.75
5.0.20.0030.0128.73
5.0.10.0050.0108.72
5.0.00.0050.0148.72
4.4.90.0030.0097.98
4.4.80.0020.0107.96
4.4.70.0020.0107.97
4.4.60.0030.0087.96
4.4.50.0040.0097.97
4.4.40.0040.0147.94
4.4.30.0060.0077.97
4.4.20.0030.0098.01
4.4.10.0030.0118.01
4.4.00.0010.0157.97
4.3.110.0030.0097.92
4.3.100.0020.0107.92
4.3.90.0050.0067.90
4.3.80.0010.0147.88
4.3.70.0030.0097.90
4.3.60.0010.0117.90
4.3.50.0030.0127.90
4.3.40.0010.0157.86
4.3.30.0030.0107.24
4.3.20.0020.0107.23
4.3.10.0050.0077.21
4.3.00.0110.00810.86

preferences:
50.51 ms | 401 KiB | 5 Q