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; foreach($araay as $k => $v) { print_r($k); } } } $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.70.0060.01218.68
8.3.60.0080.01116.62
8.3.50.0110.00421.95
8.3.40.0150.00319.02
8.3.30.0110.00319.07
8.3.20.0090.00620.20
8.3.10.0140.00423.48
8.3.00.0040.00419.25
8.2.180.0140.00316.50
8.2.170.0120.00322.96
8.2.160.0100.00320.57
8.2.150.0120.00624.18
8.2.140.0040.01324.66
8.2.130.0190.00026.16
8.2.120.0170.00022.24
8.2.110.0060.00322.30
8.2.100.0040.00818.03
8.2.90.0050.00319.04
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0050.00319.95
8.2.30.0060.00318.13
8.2.20.0000.00717.63
8.2.10.0030.00619.75
8.2.00.0070.00317.75
8.1.280.0110.00425.92
8.1.270.0060.00622.05
8.1.260.0040.00426.35
8.1.250.0100.00728.09
8.1.240.0240.00824.02
8.1.230.0090.00319.15
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00717.38
8.1.190.0050.00317.30
8.1.180.0070.00319.13
8.1.170.0060.00318.58
8.1.160.0070.00022.00
8.1.150.0070.00318.66
8.1.140.0000.00817.46
8.1.130.0040.00417.79
8.1.120.0000.00717.30
8.1.110.0030.00617.44
8.1.100.0000.00717.52
8.1.90.0000.00817.45
8.1.80.0030.00317.50
8.1.70.0080.00017.41
8.1.60.0000.00717.62
8.1.50.0050.00317.52
8.1.40.0060.00317.53
8.1.30.0000.00817.64
8.1.20.0030.00517.64
8.1.10.0070.00017.52
8.1.00.0040.00417.53
8.0.300.0000.00718.77
8.0.290.0070.00017.15
8.0.280.0000.00718.45
8.0.270.0030.00317.14
8.0.260.0080.00017.32
8.0.250.0000.00717.04
8.0.240.0050.00317.00
8.0.230.0000.00716.93
8.0.220.0030.00316.93
8.0.210.0000.01016.88
8.0.200.0030.00316.98
8.0.190.0000.00716.92
8.0.180.0020.00516.91
8.0.170.0050.00317.04
8.0.160.0040.00416.94
8.0.150.0070.00016.87
8.0.140.0000.00816.82
8.0.130.0000.00913.36
8.0.120.0070.00016.88
8.0.110.0000.00716.88
8.0.100.0070.00016.98
8.0.90.0050.00216.84
8.0.80.0060.00916.95
8.0.70.0000.00816.77
8.0.60.0050.00316.99
8.0.50.0040.00416.84
8.0.30.0090.01217.03
8.0.20.0100.00817.40
8.0.10.0000.00716.94
8.0.00.0110.00616.91
7.4.330.0020.00215.00
7.4.320.0030.00316.60
7.4.300.0030.00316.60
7.4.290.0040.00416.55
7.4.280.0030.00316.64
7.4.270.0080.00016.60
7.4.260.0000.00816.47
7.4.250.0070.00016.44
7.4.240.0030.00316.51
7.4.230.0050.00216.44
7.4.220.0130.00616.53
7.4.210.0070.01016.62
7.4.200.0070.00016.63
7.4.190.0050.00216.78
7.4.160.0160.00416.71
7.4.150.0120.00617.40
7.4.140.0140.00317.86
7.4.130.0150.00316.44
7.4.120.0070.01016.56
7.4.110.0160.00616.52
7.4.100.0070.01116.45
7.4.90.0290.04216.57
7.4.80.0160.00619.39
7.4.70.0040.01716.36
7.4.60.0000.01816.48
7.4.50.0000.00716.57
7.4.40.0030.01022.77
7.4.30.0090.00916.67
7.4.00.0040.01414.82
7.3.330.0060.00013.36
7.3.320.0030.00313.36
7.3.310.0030.00316.33
7.3.300.0000.00716.32
7.3.290.0030.01016.31
7.3.280.0090.00816.36
7.3.270.0070.01017.40
7.3.260.0140.01016.61
7.3.250.0120.00816.66
7.3.240.0140.00316.37
7.3.230.0030.01416.39
7.3.210.0070.01016.38
7.3.200.0110.00416.66
7.3.190.0070.01416.45
7.3.180.0060.01016.46
7.3.170.0040.01116.33
7.3.160.0060.00916.46
7.3.120.0110.00414.78
7.3.110.0070.00814.93
7.3.100.0060.00814.97
7.3.90.0070.00915.07
7.3.80.0050.00614.93
7.3.70.0060.00914.66
7.3.60.0030.01314.82
7.3.50.0050.00714.75
7.3.40.0070.00514.78
7.3.30.0070.00714.90
7.3.20.0060.00816.81
7.3.10.0040.01016.63
7.3.00.0130.00316.55
7.2.330.0140.00716.71
7.2.320.0100.01016.64
7.2.310.0040.01416.81
7.2.300.0140.00416.67
7.2.290.0060.01016.50
7.2.240.0080.00715.19
7.2.230.0080.00815.14
7.2.220.0030.01214.87
7.2.210.0050.01115.20
7.2.200.0070.01015.01
7.2.190.0050.00915.04
7.2.180.0050.01115.07
7.2.170.0070.00714.76
7.2.160.0070.00715.04
7.2.150.0040.01217.13
7.2.140.0030.01116.95
7.2.130.0080.00616.79
7.2.120.0040.00916.89
7.2.110.0090.00716.79
7.2.100.0060.01016.57
7.2.90.0060.00816.82
7.2.80.0060.00816.80
7.2.70.0070.00916.81
7.2.60.0050.00916.79
7.2.50.0060.00916.82
7.2.40.0070.00716.78
7.2.30.0080.00716.74
7.2.20.0080.00716.84
7.2.10.0080.00716.83
7.2.00.0060.00817.28
7.1.330.0060.00815.80
7.1.320.0040.00815.91
7.1.310.0070.00715.71
7.1.300.0090.00615.66
7.1.290.0070.00715.74
7.1.280.0100.00315.65
7.1.270.0040.00915.79
7.1.260.0070.01015.69
7.1.250.0060.00815.70
7.1.240.0000.01615.75
7.1.230.0070.00715.58
7.1.220.0100.00015.78
7.1.210.0100.00315.42
7.1.200.0050.00515.69
7.1.190.0040.01115.78
7.1.180.0040.01215.78
7.1.170.0030.00615.56
7.1.160.0030.00815.56
7.1.150.0040.00415.61
7.1.140.0000.01215.75
7.1.130.0000.01715.79
7.1.120.0030.01315.72
7.1.110.0030.00915.79
7.1.100.0070.01016.90
7.1.90.0000.00915.87
7.1.80.0060.00615.64
7.1.70.0040.00516.39
7.1.60.0080.01117.54
7.1.50.0060.00416.37
7.1.40.0000.01515.60
7.1.30.0140.00015.79
7.1.20.0070.00715.84
7.1.10.0100.00715.51
7.1.00.0020.04518.98
7.0.330.0000.01615.08
7.0.320.0000.01515.23
7.0.310.0100.00015.53
7.0.300.0030.00615.32
7.0.290.0090.00615.26
7.0.280.0080.00515.16
7.0.270.0030.00715.03
7.0.260.0060.00915.21
7.0.250.0070.01015.14
7.0.240.0110.00615.54
7.0.230.0040.01115.50
7.0.220.0040.00814.99
7.0.210.0060.00615.46
7.0.200.0020.01016.00
7.0.190.0060.00715.41
7.0.180.0060.00615.12
7.0.170.0040.00415.57
7.0.160.0070.00715.18
7.0.150.0070.00415.23
7.0.140.0050.03818.76
7.0.130.0040.00815.59
7.0.120.0050.00515.27
7.0.110.0040.01115.45
7.0.100.0120.00315.05
7.0.90.0040.01115.38
7.0.80.0060.00615.21
7.0.70.0000.01515.38
7.0.60.0100.03617.69
7.0.50.0050.02616.47
7.0.40.0110.04316.71
7.0.30.0300.03016.79
7.0.20.0120.02416.90
7.0.10.0070.04316.60
7.0.00.0060.04816.83
5.6.380.0070.00713.82
5.6.370.0030.00914.27
5.6.360.0040.01214.36
5.6.350.0030.01014.44
5.6.340.0060.00914.40
5.6.330.0050.00514.35
5.6.320.0040.01214.34
5.6.310.0000.01114.44
5.6.300.0080.00614.10
5.6.290.0000.01314.04
5.6.280.0060.04017.63
5.6.270.0000.01514.07
5.6.260.0150.00014.18
5.6.250.0110.00414.57
5.6.240.0000.01514.20
5.6.230.0070.00714.46
5.6.220.0070.00714.34
5.6.210.0030.03217.41
5.6.200.0050.03216.19
5.6.190.0050.04817.32
5.6.180.0170.02917.44
5.6.170.0240.03517.31
5.6.160.0030.02217.33
5.6.150.0030.02716.27
5.6.140.0050.04016.13
5.6.130.0030.03316.38
5.6.120.0070.04617.49
5.6.110.0060.03917.39
5.6.100.0070.02517.52
5.6.90.0090.04317.67
5.6.80.0100.03317.29
5.6.70.0090.00614.26
5.6.60.0080.00814.21
5.6.50.0000.01414.38
5.6.40.0070.00714.11
5.6.30.0110.00313.93
5.6.20.0090.00614.11
5.6.10.0000.01313.91
5.6.00.0070.01013.99
5.5.380.0090.00311.04
5.5.370.0040.00411.37
5.5.360.0120.00011.17
5.5.350.0080.03915.86
5.5.340.0070.02814.56
5.5.330.0070.03016.02
5.5.320.0130.02515.57
5.5.310.0150.02015.80
5.5.300.0070.03814.49
5.5.290.0050.02914.43
5.5.280.0070.02316.10
5.5.270.0100.04316.04
5.5.260.0180.03516.03
5.5.250.0120.03715.87
5.5.240.0120.03915.64
5.5.230.0070.00711.14
5.5.220.0030.00311.24
5.5.210.0040.00711.21
5.5.200.0000.00610.95
5.5.190.0030.00311.14
5.5.180.0000.01110.97
5.5.170.0070.00711.06
5.5.160.0000.01310.67
5.5.150.0030.00310.91
5.5.140.0040.00711.21
5.5.130.0030.00310.79
5.5.120.0070.00311.23
5.5.110.0070.00010.92
5.5.100.0040.00710.98
5.5.90.0000.01111.20
5.5.80.0030.00711.17
5.5.70.0000.00910.70
5.5.60.0070.00310.97
5.5.50.0040.00411.24
5.5.40.0060.00610.95
5.5.30.0060.00611.17
5.5.20.0070.00011.14
5.5.10.0070.00411.24
5.5.00.0000.00811.29
5.4.450.0120.03215.37
5.4.440.0050.03315.24
5.4.430.0130.02515.18
5.4.420.0140.02815.36
5.4.410.0090.03415.20
5.4.400.0060.03415.14
5.4.390.0420.03415.12
5.4.380.0250.02814.82
5.4.370.0170.03014.76
5.4.360.0160.03314.74
5.4.350.0210.03014.91
5.4.340.0120.03114.85
5.4.330.0030.00611.02
5.4.320.0060.02111.87
5.4.310.0040.02411.67
5.4.300.0040.02111.69
5.4.290.0050.02111.73
5.4.280.0070.01711.64
5.4.270.0080.02011.73
5.4.260.0050.02411.53
5.4.250.0070.02111.59
5.4.240.0070.02511.47
5.4.230.0040.02211.63
5.4.220.0060.01711.72
5.4.210.0040.02211.72
5.4.200.0060.02011.71
5.4.190.0030.02311.66
5.4.180.0060.02011.61
5.4.170.0050.02211.55
5.4.160.0020.02211.72
5.4.150.0070.01911.55
5.4.140.0060.02111.58
5.4.130.0040.02211.60
5.4.120.0060.02111.69
5.4.110.0050.02111.69
5.4.100.0050.02611.53
5.4.90.0070.02511.59
5.4.80.0040.02411.61
5.4.70.0060.02311.48
5.4.60.0060.02711.45
5.4.50.0060.02711.62
5.4.40.0040.02311.41
5.4.30.0020.02811.56
5.4.20.0030.02711.54
5.4.10.0050.02411.55
5.4.00.0050.02211.35
5.3.290.0070.02011.76
5.3.280.0040.03011.66
5.3.270.0020.02711.65
5.3.260.0020.03411.68
5.3.250.0050.02711.67
5.3.240.0070.02611.62
5.3.230.0040.02911.52
5.3.220.0060.02711.61
5.3.210.0050.02911.59
5.3.200.0040.02611.61
5.3.190.0050.03111.65
5.3.180.0040.03111.68
5.3.170.0070.02111.56
5.3.160.0040.02711.66
5.3.150.0040.02311.69
5.3.140.0050.02211.66
5.3.130.0040.03111.64
5.3.120.0080.02011.62
5.3.110.0070.01911.55
5.3.100.0040.02511.31
5.3.90.0070.02111.28
5.3.80.0020.02611.31
5.3.70.0090.02811.21
5.3.60.0060.02511.23
5.3.50.0040.03511.20
5.3.40.0060.02011.16
5.3.30.0060.02011.31
5.3.20.0060.01911.06
5.3.10.0030.02611.08
5.3.00.0040.02011.12
5.2.170.0030.0169.49
5.2.160.0050.0199.49
5.2.150.0020.0199.44
5.2.140.0070.0189.39
5.2.130.0020.0189.26
5.2.120.0040.0179.29
5.2.110.0020.0219.32
5.2.100.0070.0169.35
5.2.90.0060.0189.38
5.2.80.0040.0179.33
5.2.70.0030.0189.28
5.2.60.0040.0179.31
5.2.50.0080.0159.32
5.2.40.0050.0169.31
5.2.30.0060.0169.25
5.2.20.0060.0229.13
5.2.10.0020.0209.12
5.2.00.0040.0199.02
5.1.60.0040.0208.32
5.1.50.0040.0168.31
5.1.40.0050.0168.22
5.1.30.0020.0178.59
5.1.20.0070.0158.52
5.1.10.0020.0188.33
5.1.00.0050.0168.35
5.0.50.0030.0137.36
5.0.40.0060.0097.29
5.0.30.0030.0197.20
5.0.20.0020.0127.18
5.0.10.0050.0097.17
5.0.00.0020.0197.17
4.4.90.0010.0116.43
4.4.80.0020.0106.41
4.4.70.0010.0116.41
4.4.60.0020.0096.41
4.4.50.0010.0126.42
4.4.40.0020.0146.39
4.4.30.0020.0116.42
4.4.20.0020.0106.46
4.4.10.0050.0076.46
4.4.00.0010.0166.42
4.3.110.0020.0096.37
4.3.100.0030.0096.37
4.3.90.0030.0116.35
4.3.80.0050.0126.33
4.3.70.0010.0096.35
4.3.60.0020.0126.35
4.3.50.0000.0116.35
4.3.40.0040.0126.30
4.3.30.0020.0085.68
4.3.20.0020.0105.67
4.3.10.0020.0105.65
4.3.00.0050.00710.77

preferences:
62.25 ms | 401 KiB | 5 Q