3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Challenge 1: Modify 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 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 $test = (new Test)->__set('secret', 'yeah bro!'); // 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.0090.00616.75
8.3.50.0200.00317.54
8.3.40.0140.00418.84
8.3.30.0150.00018.84
8.3.20.0030.00518.77
8.3.10.0040.00420.71
8.3.00.0040.00419.26
8.2.180.0060.01616.63
8.2.170.0120.00622.96
8.2.160.0070.00720.32
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.60
8.2.110.0060.00320.90
8.2.100.0040.00718.03
8.2.90.0070.00419.38
8.2.80.0040.00419.32
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0050.00318.34
8.2.30.0000.00717.93
8.2.20.0080.00017.64
8.2.10.0040.00417.75
8.2.00.0030.00717.81
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0070.00322.59
8.1.230.0080.00321.03
8.1.220.0000.00917.74
8.1.210.0040.00418.89
8.1.200.0070.00317.47
8.1.190.0030.00617.39
8.1.180.0000.00818.10
8.1.170.0000.00818.90
8.1.160.0050.00218.75
8.1.150.0040.00418.50
8.1.140.0040.00417.38
8.1.130.0000.00717.89
8.1.120.0040.00417.35
8.1.110.0000.00817.39
8.1.100.0030.00317.32
8.1.90.0050.00317.41
8.1.80.0000.00717.45
8.1.70.0080.00017.40
8.1.60.0030.00517.55
8.1.50.0060.00317.40
8.1.40.0040.00417.55
8.1.30.0050.00317.55
8.1.20.0000.00717.57
8.1.10.0060.00317.52
8.1.00.0080.00017.49
8.0.300.0040.00419.91
8.0.290.0050.00216.63
8.0.280.0050.00318.40
8.0.270.0000.00817.26
8.0.260.0000.00816.79
8.0.250.0080.00016.89
8.0.240.0000.00816.86
8.0.230.0070.00016.96
8.0.220.0030.00316.91
8.0.210.0000.00716.97
8.0.200.0070.00016.90
8.0.190.0040.00416.98
8.0.180.0000.00816.95
8.0.170.0040.00416.82
8.0.160.0050.00316.96
8.0.150.0080.00016.98
8.0.140.0050.00316.87
8.0.130.0030.00313.38
8.0.120.0040.00416.86
8.0.110.0000.00916.90
8.0.100.0080.00016.79
8.0.90.0000.00716.78
8.0.80.0070.01416.84
8.0.70.0000.00716.71
8.0.60.0000.00816.91
8.0.50.0040.00416.95
8.0.30.0090.01117.00
8.0.20.0130.00816.97
8.0.10.0040.00417.09
8.0.00.0110.01116.60
7.4.330.0000.00512.87
7.4.320.0020.00516.45
7.4.300.0030.00316.42
7.4.290.0070.00016.60
7.4.280.0040.00416.53
7.4.270.0030.00516.56
7.4.260.0060.00013.30
7.4.250.0030.00616.45
7.4.240.0000.00716.45
7.4.230.0030.00316.26
7.4.220.0140.00616.63
7.4.210.0080.00816.56
7.4.200.0050.00216.54
7.4.190.0070.00016.77
7.4.160.0080.00816.53
7.4.150.0130.00716.47
7.4.140.0100.00816.51
7.4.130.0090.01016.54
7.4.120.0090.00816.50
7.4.110.0060.01016.72
7.4.100.0070.01016.58
7.4.90.0200.00316.51
7.4.80.0170.00716.36
7.4.70.0070.01116.53
7.4.60.0040.01216.46
7.4.50.0040.00416.20
7.4.40.0040.01116.33
7.4.30.0060.01016.53
7.4.00.0070.01014.64
7.3.330.0000.00613.44
7.3.320.0000.00613.38
7.3.310.0070.00016.48
7.3.300.0000.00716.43
7.3.290.0050.01016.36
7.3.280.0030.01116.30
7.3.270.0180.00716.41
7.3.260.0110.00816.51
7.3.250.0090.00916.41
7.3.240.0160.00016.58
7.3.230.0080.00816.42
7.3.210.0100.00716.38
7.3.200.0040.01519.39
7.3.190.0100.01016.44
7.3.180.0040.01216.36
7.3.170.0050.01216.47
7.3.160.0030.01416.40
7.3.120.0110.00414.53
7.2.330.0030.01416.28
7.2.320.0110.00616.40
7.2.310.0070.01316.56
7.2.300.0130.00316.72
7.2.290.0070.01016.51
7.2.60.0040.01116.80
7.2.00.0030.01019.23
7.1.200.0090.00315.64
7.1.100.0080.00318.18
7.1.70.0000.00717.27
7.1.60.0110.01419.40
7.1.50.0060.01616.94
7.1.00.0000.04322.36
7.0.200.0500.00314.61
7.0.140.0000.07722.12
7.0.120.0030.04022.01
7.0.60.0100.08019.96
7.0.50.0070.08017.89
7.0.40.0070.08017.86
7.0.30.0070.06717.86
7.0.20.0130.08017.86
7.0.10.0100.07017.83
7.0.00.0000.06317.68
5.6.210.0070.07320.71
5.6.200.0070.04018.22
5.6.190.0170.07318.21
5.6.180.0070.05718.29
5.6.170.0030.08318.17
5.6.160.0100.07718.19
5.6.150.0070.07718.29
5.6.140.0070.08018.18
5.6.130.0100.08018.28
5.6.120.0030.08718.18
5.6.110.0170.06718.22
5.6.100.0070.05018.18
5.6.90.0030.04018.25
5.6.80.0030.05717.56
5.6.70.0100.04717.54
5.6.60.0170.07017.48
5.6.50.0030.08017.67
5.6.40.0030.05717.50
5.6.30.0100.07317.54
5.6.20.0030.08017.51
5.6.10.0070.05717.51
5.6.00.0100.03717.52
5.5.350.0000.03720.44
5.5.340.0100.07717.97
5.5.330.0030.07717.95
5.5.320.0070.07717.95
5.5.310.0000.05717.91
5.5.300.0100.05318.03
5.5.290.0100.04317.96
5.5.280.0030.07717.96
5.5.270.0070.06317.98
5.5.260.0070.08018.07
5.5.250.0030.04717.82
5.5.240.0070.07017.43
5.5.230.0130.03017.36
5.5.220.0030.08317.46
5.5.210.0100.07317.41
5.5.200.0070.06717.31
5.5.190.0070.06017.34
5.5.180.0030.06717.34
5.5.160.0070.03317.34
5.5.150.0070.04717.37
5.5.140.0070.04717.33
5.5.130.0200.05017.34
5.5.120.0070.05717.43
5.5.110.0100.07017.29
5.5.100.0030.05017.29
5.5.90.0070.07717.33
5.5.80.0070.08017.31
5.5.70.0030.05317.32
5.5.60.0030.05317.25
5.5.50.0030.07017.21
5.5.40.0070.06317.22
5.5.30.0100.07717.22
5.5.20.0030.04717.18
5.5.10.0070.07017.18
5.5.00.0070.07317.20
5.4.450.0070.06319.34
5.4.440.0070.06719.40
5.4.430.0100.07719.46
5.4.420.0100.07719.30
5.4.410.0100.03319.32
5.4.400.0030.05719.06
5.4.390.0030.04019.08
5.4.380.0070.03319.05
5.4.370.0100.07019.13
5.4.360.0030.06319.00
5.4.350.0000.06719.13
5.4.340.0030.04319.09
5.4.320.0070.03719.02
5.4.310.0170.06719.10
5.4.300.0100.06319.05
5.4.290.0100.07719.15
5.4.280.0100.06319.05
5.4.270.0030.06019.13
5.4.260.0070.06719.11
5.4.250.0000.08019.09
5.4.240.0070.06018.98
5.4.230.0030.08019.12
5.4.220.0070.07719.02
5.4.210.0070.07319.09
5.4.200.0070.06718.89
5.4.190.0100.06019.09
5.4.180.0030.07719.11
5.4.170.0070.06019.13
5.4.160.0030.08019.07
5.4.150.0100.07318.94
5.4.140.0070.06016.41
5.4.130.0000.07716.34
5.4.120.0070.04716.38
5.4.110.0130.07316.39
5.4.100.0070.07316.45
5.4.90.0100.05716.55
5.4.80.0130.03716.43
5.4.70.0070.07316.36
5.4.60.0100.05316.32
5.4.50.0130.06716.55
5.4.40.0100.07016.38
5.4.30.0030.06016.45
5.4.20.0070.05716.27
5.4.10.0070.07716.35
5.4.00.0030.07015.98
5.3.290.0030.07314.67
5.3.280.0100.05314.56
5.3.270.0030.06014.57
5.3.260.0100.07714.71
5.3.250.0070.07714.63
5.3.240.0030.06714.60
5.3.230.0030.06314.62
5.3.220.0100.05714.54
5.3.210.0070.07714.52
5.3.200.0070.07014.53
5.3.190.0070.08014.42
5.3.180.0030.04014.56
5.3.170.0130.04314.61
5.3.160.0070.06714.60
5.3.150.0100.07714.67
5.3.140.0100.06714.63
5.3.130.0100.03314.76
5.3.120.0070.08014.51
5.3.110.0200.06714.40
5.3.100.0000.08013.99
5.3.90.0030.08013.89
5.3.80.0100.06714.12
5.3.70.0030.08014.06
5.3.60.0130.07014.06
5.3.50.0070.04014.16
5.3.40.0070.06713.97
5.3.30.0000.05713.82
5.3.20.0070.05013.69
5.3.10.0000.06013.50
5.3.00.0070.07013.69
5.2.170.0130.05311.04
5.2.160.0100.05011.15
5.2.150.0000.06711.22
5.2.140.0100.03711.14
5.2.130.0000.06711.15
5.2.120.0030.06010.95
5.2.110.0070.06011.16
5.2.100.0070.06011.14
5.2.90.0000.06711.31
5.2.80.0000.03311.13
5.2.70.0130.05011.16
5.2.60.0070.06311.13
5.2.50.0000.07011.07
5.2.40.0030.06011.04
5.2.30.0030.06711.05
5.2.20.0030.06011.17
5.2.10.0100.05311.07
5.2.00.0070.05710.80
5.1.60.0100.05310.00
5.1.50.0070.04710.09
5.1.40.0070.05010.02
5.1.30.0030.05710.38
5.1.20.0100.05310.39
5.1.10.0000.04310.29
5.1.00.0070.02310.08
5.0.50.0000.0508.39
5.0.40.0070.0308.41
5.0.30.0100.0508.31
5.0.20.0100.0408.27
5.0.10.0070.0408.38
5.0.00.0100.0508.27
4.4.90.0030.0378.27
4.4.80.0070.0338.27
4.4.70.0030.0408.27
4.4.60.0070.0308.27
4.4.50.0070.0278.27
4.4.40.0030.0578.27
4.4.30.0030.0378.27
4.4.20.0000.0308.27
4.4.10.0030.0378.27
4.4.00.0070.0508.27
4.3.110.0030.0338.27
4.3.100.0030.0378.27
4.3.90.0030.0308.27
4.3.80.0030.0408.27
4.3.70.0030.0378.27
4.3.60.0000.0378.27
4.3.50.0130.0208.27
4.3.40.0030.0508.27
4.3.30.0000.0338.27
4.3.20.0030.0308.27
4.3.10.0000.0178.27
4.3.00.0000.0338.27

preferences:
45.71 ms | 401 KiB | 5 Q