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) { print_r($test->__get()); } } $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.01116.63
8.3.50.0130.00521.95
8.3.40.0070.01018.88
8.3.30.0140.00719.04
8.3.20.0080.00020.26
8.3.10.0000.01523.51
8.3.00.0080.00019.38
8.2.180.0120.00318.30
8.2.170.0090.00622.96
8.2.160.0090.00620.38
8.2.150.0070.00024.18
8.2.140.0030.00524.66
8.2.130.0150.00426.16
8.2.120.0060.00922.25
8.2.110.0090.00022.21
8.2.100.0040.00817.72
8.2.90.0030.00617.91
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0050.00319.66
8.2.50.0000.00818.07
8.2.40.0030.00619.94
8.2.30.0070.00318.02
8.2.20.0070.00017.68
8.2.10.0000.00819.72
8.2.00.0000.01017.59
8.1.280.0160.00325.92
8.1.270.0080.00021.73
8.1.260.0040.00426.35
8.1.250.0100.00728.09
8.1.240.0070.00322.54
8.1.230.0110.00020.78
8.1.220.0040.00417.74
8.1.210.0000.00818.90
8.1.200.0030.00617.48
8.1.190.0040.00417.39
8.1.180.0090.00018.10
8.1.170.0040.00420.37
8.1.160.0040.00421.95
8.1.150.0040.00718.54
8.1.140.0040.00417.30
8.1.130.0030.00317.70
8.1.120.0040.00417.41
8.1.110.0100.00017.38
8.1.100.0040.00417.25
8.1.90.0050.00317.38
8.1.80.0000.00717.41
8.1.70.0040.00417.36
8.1.60.0000.00917.45
8.1.50.0030.00517.56
8.1.40.0060.00317.47
8.1.30.0050.00317.64
8.1.20.0000.00817.70
8.1.10.0080.00017.45
8.1.00.0040.00417.50
8.0.300.0040.00419.91
8.0.290.0050.00217.18
8.0.280.0030.00318.30
8.0.270.0080.00017.16
8.0.260.0000.00617.21
8.0.250.0030.00316.96
8.0.240.0070.00016.87
8.0.230.0000.00716.82
8.0.220.0000.00716.87
8.0.210.0060.00316.92
8.0.200.0030.00316.95
8.0.190.0000.00916.93
8.0.180.0040.00416.92
8.0.170.0060.00316.99
8.0.160.0070.00016.85
8.0.150.0040.00416.71
8.0.140.0000.00716.89
8.0.130.0030.00313.39
8.0.120.0050.00316.86
8.0.110.0040.00416.87
8.0.100.0050.00217.01
8.0.90.0000.00716.87
8.0.80.0150.00016.90
8.0.70.0050.00316.93
8.0.60.0040.00416.72
8.0.50.0040.00416.93
8.0.30.0140.00716.95
8.0.20.0120.00817.40
8.0.10.0030.00317.04
8.0.00.0120.00516.76
7.4.330.0050.00015.00
7.4.320.0030.00316.41
7.4.300.0050.00216.42
7.4.290.0030.00316.50
7.4.280.0030.00316.39
7.4.270.0060.00316.50
7.4.260.0000.00816.51
7.4.250.0000.00716.37
7.4.240.0000.00716.60
7.4.230.0040.00416.54
7.4.220.0070.01516.50
7.4.210.0060.00916.61
7.4.200.0000.00816.61
7.4.190.0070.00016.74
7.4.160.0070.01016.59
7.4.150.0070.01417.40
7.4.140.0110.00817.86
7.4.130.0070.01216.61
7.4.120.0110.00516.55
7.4.110.0100.01416.59
7.4.100.0070.01116.64
7.4.90.0260.02316.49
7.4.80.0110.00819.39
7.4.70.0060.00916.46
7.4.60.0060.01216.54
7.4.50.0060.00316.67
7.4.40.0090.00322.77
7.4.30.0130.00316.46
7.4.10.0030.01415.21
7.4.00.0070.00814.96
7.3.330.0000.00513.19
7.3.320.0000.00513.35
7.3.310.0050.00316.32
7.3.300.0040.00416.32
7.3.290.0110.00416.41
7.3.280.0060.00916.39
7.3.270.0070.01117.40
7.3.260.0080.01216.57
7.3.250.0090.01116.52
7.3.240.0090.00816.43
7.3.230.0030.01316.39
7.3.210.0150.00916.44
7.3.200.0110.00716.33
7.3.190.0090.01216.32
7.3.180.0040.01216.43
7.3.170.0060.00916.32
7.3.160.0070.01016.60
7.3.130.0110.00714.79
7.3.120.0050.00814.96
7.3.110.0000.01514.83
7.3.100.0030.01314.68
7.3.90.0090.00614.69
7.3.80.0080.00414.85
7.3.70.0070.00714.79
7.3.60.0030.01214.59
7.3.50.0110.00014.77
7.3.40.0060.01014.86
7.3.30.0030.01414.85
7.3.20.0090.00916.57
7.3.10.0070.00616.37
7.3.00.0020.01416.54
7.2.330.0030.01316.55
7.2.320.0060.01216.61
7.2.310.0070.01016.60
7.2.300.0050.02016.63
7.2.290.0030.01416.41
7.2.260.0120.00614.57
7.2.250.0100.00715.00
7.2.240.0070.00714.81
7.2.230.0120.00314.89
7.2.220.0060.00914.96
7.2.210.0090.00314.79
7.2.200.0090.00614.82
7.2.190.0040.01114.98
7.2.180.0050.00514.68
7.2.170.0100.00015.07
7.2.160.0070.01015.00
7.2.150.0130.00616.69
7.2.140.0030.01516.86
7.2.130.0110.00316.90
7.2.120.0040.01316.79
7.2.110.0070.01116.74
7.2.100.0060.00716.91
7.2.90.0030.01016.92
7.2.80.0080.00516.72
7.2.70.0030.01116.90
7.2.60.0020.01116.89
7.2.50.0050.00616.84
7.2.40.0030.01016.90
7.2.30.0060.00616.76
7.2.20.0060.00716.89
7.2.10.0050.00916.88
7.2.00.0000.01117.62
7.1.330.0000.01615.84
7.1.320.0090.00415.82
7.1.310.0090.00615.88
7.1.300.0060.00315.84
7.1.290.0030.01015.55
7.1.280.0080.00815.47
7.1.270.0040.01115.70
7.1.260.0090.00915.73
7.1.250.0120.00215.53
7.1.240.0050.00715.50
7.1.230.0040.00715.55
7.1.220.0070.00815.61
7.1.210.0060.00615.81
7.1.200.0040.00815.70
7.1.190.0050.00715.67
7.1.180.0030.00815.50
7.1.170.0040.01015.76
7.1.160.0030.01015.51
7.1.150.0070.00415.62
7.1.140.0000.01215.75
7.1.130.0050.00715.73
7.1.120.0060.00615.74
7.1.110.0050.00915.65
7.1.100.0030.00716.45
7.1.90.0040.00915.79
7.1.80.0020.01115.59
7.1.70.0040.00716.06
7.1.60.0060.01116.82
7.1.50.0050.01115.92
7.1.40.0030.01015.50
7.1.30.0060.00415.59
7.1.20.0060.00815.69
7.1.10.0050.01015.58
7.1.00.0050.03017.97
7.0.330.0130.00215.40
7.0.320.0060.00515.38
7.0.310.0070.00215.38
7.0.300.0050.00315.39
7.0.290.0030.00815.15
7.0.280.0080.00215.28
7.0.270.0030.00615.41
7.0.260.0070.00515.17
7.0.250.0030.01215.28
7.0.240.0030.01015.25
7.0.230.0060.00515.39
7.0.220.0040.00915.32
7.0.210.0060.00815.26
7.0.200.0050.00615.78
7.0.190.0000.01215.30
7.0.180.0060.00715.28
7.0.170.0060.00615.40
7.0.160.0030.00915.48
7.0.150.0030.00815.12
7.0.140.0050.03017.54
7.0.130.0080.00515.33
7.0.120.0080.00415.22
7.0.110.0070.00515.46
7.0.100.0030.00915.25
7.0.90.0080.00515.41
7.0.80.0030.01215.37
7.0.70.0090.00715.33
7.0.60.0060.01816.86
7.0.50.0030.02316.25
7.0.40.0050.02415.62
7.0.30.0160.02415.66
7.0.20.0100.02515.62
7.0.10.0080.03015.72
7.0.00.0020.02115.67
5.6.400.0000.01714.21
5.6.390.0070.01114.12
5.6.380.0040.00914.31
5.6.370.0030.00814.43
5.6.360.0050.00514.27
5.6.350.0080.00514.22
5.6.340.0030.00714.30
5.6.330.0070.00514.32
5.6.320.0020.01114.30
5.6.310.0060.00714.38
5.6.300.0030.00814.33
5.6.290.0050.00814.27
5.6.280.0090.03216.57
5.6.270.0060.00614.12
5.6.260.0030.01314.23
5.6.250.0020.01414.53
5.6.240.0120.00314.22
5.6.230.0080.00914.20
5.6.220.0060.00514.39
5.6.210.0020.02516.36
5.6.200.0060.02715.53
5.6.190.0070.02816.35
5.6.180.0110.01616.29
5.6.170.0090.02216.36
5.6.160.0090.02916.53
5.6.150.0070.03215.51
5.6.140.0100.02015.64
5.6.130.0060.02515.51
5.6.120.0070.02116.59
5.6.110.0090.01716.60
5.6.100.0050.02216.57
5.6.90.0070.02916.51
5.6.80.0030.02116.32
5.6.70.1440.02216.34
5.6.60.0080.00414.20
5.6.50.0070.00614.08
5.6.40.0060.00614.09
5.6.30.0100.00214.23
5.6.20.0060.00714.29
5.6.10.0050.01014.25
5.6.00.0060.00914.13
5.5.380.0020.00912.79
5.5.370.0040.00712.59
5.5.360.0050.00812.61
5.5.350.0080.01815.22
5.5.340.0080.02914.39
5.5.330.0060.01915.22
5.5.320.0170.02415.31
5.5.310.0150.02615.26
5.5.300.0050.03314.39
5.5.290.0070.02614.47
5.5.280.0040.02915.31
5.5.270.0100.03015.40
5.5.260.0080.03115.19
5.5.250.0080.02615.21
5.5.240.0060.02315.18
5.5.230.0050.00512.43
5.5.220.0070.00512.50
5.5.210.0040.00712.76
5.5.200.0070.00312.44
5.5.190.0050.00512.53
5.5.180.0050.00312.41
5.5.170.0090.00312.44
5.5.160.0060.00612.79
5.5.150.0070.00612.49
5.5.140.0060.00812.33
5.5.130.0060.00712.55
5.5.120.0040.00712.58
5.5.110.0030.01012.73
5.5.100.0050.00812.73
5.5.90.0060.00412.72
5.5.80.0030.00812.69
5.5.70.0030.01012.69
5.5.60.0090.00212.54
5.5.50.0050.00712.67
5.5.40.0080.00612.31
5.5.30.0070.00412.39
5.5.20.0030.01112.82
5.5.10.0040.00912.55
5.5.00.0040.00712.42
5.4.450.0210.02514.13
5.4.440.0250.02314.21
5.4.430.0250.02314.07
5.4.420.0080.02013.99
5.4.410.0220.02314.08
5.4.400.0230.02113.89
5.4.390.0030.02313.86
5.4.380.0180.02913.75
5.4.370.0140.03213.81
5.4.360.0160.02813.74
5.4.350.0110.02413.76
5.4.340.0110.02713.83
5.4.330.0060.00511.48
5.4.320.0050.01711.69
5.4.310.0050.01811.69
5.4.300.0050.01711.77
5.4.290.0050.01511.72
5.4.280.0050.01511.73
5.4.270.0040.01611.73
5.4.260.0080.02011.77
5.4.250.0050.01911.72
5.4.240.0060.01411.68
5.4.230.0050.01611.71
5.4.220.0050.01611.60
5.4.210.0050.01811.70
5.4.200.0040.01511.80
5.4.190.0060.01411.68
5.4.180.0050.01811.75
5.4.170.0070.01411.60
5.4.160.0040.01811.73
5.4.150.0030.01711.62
5.4.140.0060.01611.57
5.4.130.0050.01411.65
5.4.120.0050.01411.62
5.4.110.0030.01811.57
5.4.100.0050.01411.54
5.4.90.0020.02011.67
5.4.80.0020.01911.52
5.4.70.0080.01611.63
5.4.60.0020.01911.59
5.4.50.0050.01711.51
5.4.40.0030.02111.60
5.4.30.0020.01711.65
5.4.20.0040.01611.59
5.4.10.0070.01111.60
5.4.00.0050.01911.38
5.3.290.0070.01711.72
5.3.280.0040.02211.70
5.3.270.0040.02411.65
5.3.260.0060.02211.71
5.3.250.0070.01511.65
5.3.240.0050.01511.59
5.3.230.0060.01511.70
5.3.220.0060.01511.62
5.3.210.0050.01811.59
5.3.200.0020.01811.63
5.3.190.0060.01411.71
5.3.180.0070.01911.63
5.3.170.0010.02611.71
5.3.160.0050.02211.73
5.3.150.0040.02211.71
5.3.140.0050.02011.63
5.3.130.0060.01711.70
5.3.120.0060.01911.72
5.3.110.0060.01611.71
5.3.100.0030.01611.46
5.3.90.0060.01511.56
5.3.80.0060.01411.47
5.3.70.0040.01611.49
5.3.60.0020.02411.48
5.3.50.0070.02211.47
5.3.40.0050.01811.38
5.3.30.0050.01811.46
5.3.20.0080.01211.33
5.3.10.0050.01511.28
5.3.00.0020.02111.29
5.2.170.0050.0169.38
5.2.160.0040.0179.25
5.2.150.0040.0189.40
5.2.140.0060.0179.39
5.2.130.0020.0239.30
5.2.120.0030.0189.36
5.2.110.0040.0159.23
5.2.100.0040.0169.23
5.2.90.0010.0179.28
5.2.80.0020.0179.31
5.2.70.0030.0179.31
5.2.60.0060.0169.26
5.2.50.0010.0209.27
5.2.40.0020.0179.29
5.2.30.0020.0189.13
5.2.20.0040.0179.26
5.2.10.0060.0159.06
5.2.00.0060.0159.04
5.1.60.0030.0138.56
5.1.50.0040.0148.55
5.1.40.0020.0168.55
5.1.30.0020.0178.72
5.1.20.0020.0168.73
5.1.10.0020.0168.60
5.1.00.0020.0178.59
5.0.50.0020.0117.84
5.0.40.0000.0157.77
5.0.30.0020.0187.67
5.0.20.0020.0147.66
5.0.10.0050.0157.65
5.0.00.0060.0157.64
4.4.90.0020.0116.90
4.4.80.0040.0086.88
4.4.70.0020.0096.89
4.4.60.0010.0116.89
4.4.50.0020.0096.89
4.4.40.0020.0146.86
4.4.30.0030.0076.89
4.4.20.0010.0106.93
4.4.10.0020.0096.94
4.4.00.0030.0166.89
4.3.110.0020.0096.85
4.3.100.0040.0086.84
4.3.90.0020.0106.82
4.3.80.0020.0146.80
4.3.70.0020.0106.82
4.3.60.0010.0116.82
4.3.50.0030.0106.82
4.3.40.0030.0146.78
4.3.30.0010.0146.16
4.3.20.0020.0106.15
4.3.10.0020.0106.13
4.3.00.0150.0069.78

preferences:
45.64 ms | 401 KiB | 5 Q