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 print_r($v); // 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.01118.55
8.3.50.0060.01221.91
8.3.40.0140.00718.62
8.3.30.0000.01420.13
8.3.20.0080.00020.34
8.3.10.0080.00022.09
8.3.00.0050.00322.51
8.2.180.0110.00718.43
8.2.170.0070.00722.96
8.2.160.0090.00620.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.01026.16
8.2.120.0050.00517.88
8.2.110.0030.00722.12
8.2.100.0090.00319.36
8.2.90.0050.00319.13
8.2.80.0040.00419.32
8.2.70.0000.00817.50
8.2.60.0000.00917.93
8.2.50.0030.00618.07
8.2.40.0030.00718.09
8.2.30.0000.00718.03
8.2.20.0040.00417.73
8.2.10.0050.00317.58
8.2.00.0040.00417.70
8.1.280.0030.01725.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00623.71
8.1.230.0040.00719.09
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0080.00517.35
8.1.190.0040.00417.51
8.1.180.0000.00919.01
8.1.170.0030.00618.50
8.1.160.0000.00722.07
8.1.150.0030.00518.50
8.1.140.0040.00417.34
8.1.130.0070.00017.80
8.1.120.0000.00717.41
8.1.110.0040.00417.40
8.1.100.0070.00017.41
8.1.90.0040.00417.43
8.1.80.0000.00717.45
8.1.70.0070.00017.44
8.1.60.0030.00617.58
8.1.50.0080.00017.61
8.1.40.0040.00417.43
8.1.30.0040.00417.61
8.1.20.0030.00617.67
8.1.10.0040.00417.58
8.1.00.0030.00617.54
8.0.300.0030.00418.77
8.0.290.0040.00417.16
8.0.280.0030.00318.39
8.0.270.0030.00317.20
8.0.260.0050.00316.82
8.0.250.0030.00316.84
8.0.240.0000.00716.88
8.0.230.0030.00316.98
8.0.220.0000.00716.92
8.0.210.0000.00716.92
8.0.200.0000.00816.96
8.0.190.0030.00616.89
8.0.180.0030.00616.93
8.0.170.0040.00416.97
8.0.160.0000.00716.91
8.0.150.0070.00016.71
8.0.140.0030.00316.90
8.0.130.0000.00613.30
8.0.120.0030.00516.79
8.0.110.0070.00016.87
8.0.100.0020.00516.90
8.0.90.0000.00716.78
8.0.80.0120.00916.92
8.0.70.0050.00316.97
8.0.60.0050.00216.87
8.0.50.0040.00416.90
8.0.30.0120.00717.16
8.0.20.0070.01217.40
8.0.10.0000.00816.90
8.0.00.0070.01016.89
7.4.330.0020.00215.00
7.4.320.0030.00316.37
7.4.300.0060.00016.52
7.4.290.0030.00616.64
7.4.280.0000.00816.41
7.4.270.0030.00316.47
7.4.260.0040.00416.48
7.4.250.0050.00216.39
7.4.240.0030.00416.52
7.4.230.0030.00316.62
7.4.220.0090.00616.59
7.4.210.0070.00916.56
7.4.200.0070.00016.59
7.4.190.0070.00016.70
7.4.160.0170.00016.39
7.4.150.0150.00317.40
7.4.140.0100.00817.86
7.4.130.0100.00716.59
7.4.120.0080.01116.60
7.4.110.0070.01816.37
7.4.100.0130.00616.52
7.4.90.0090.00916.57
7.4.80.0100.00719.39
7.4.70.0090.00916.46
7.4.60.0100.00716.47
7.4.50.0040.00416.64
7.4.40.0080.00822.77
7.4.30.0050.01016.59
7.4.00.0040.01114.69
7.3.330.0000.00613.16
7.3.320.0000.00513.32
7.3.310.0030.00316.43
7.3.300.0070.00016.24
7.3.290.0000.01516.37
7.3.280.0070.01116.38
7.3.270.0000.01717.40
7.3.260.0150.00316.38
7.3.250.0090.01116.56
7.3.240.0070.01016.48
7.3.230.0070.01116.59
7.3.210.0070.01016.58
7.3.200.0130.00319.39
7.3.190.0090.00916.35
7.3.180.0110.00616.28
7.3.170.0120.00916.65
7.3.160.0080.00816.26
7.3.120.0030.01315.04
7.3.10.0000.01216.52
7.3.00.0060.00616.07
7.2.330.0100.01016.77
7.2.320.0110.00616.71
7.2.310.0080.00816.34
7.2.300.0090.01216.79
7.2.290.0130.00416.42
7.2.130.0080.00016.17
7.2.120.0110.01116.44
7.2.110.0030.00716.52
7.2.100.0070.00716.36
7.2.90.0040.00816.34
7.2.80.0050.00516.36
7.2.70.0050.00516.34
7.2.60.0110.00716.50
7.2.50.0070.00316.74
7.2.40.0000.01316.35
7.2.30.0090.00616.45
7.2.20.0100.00315.93
7.2.10.0070.01116.79
7.2.00.0060.00618.23
7.1.250.0070.00415.50
7.1.100.0030.00918.27
7.1.70.0040.00717.16
7.1.60.0100.01719.43
7.1.50.0030.01716.88
7.1.00.0000.03722.43
7.0.200.0030.00316.45
7.0.140.0030.07321.95
7.0.60.0100.07320.04
7.0.50.0100.07317.85
7.0.40.0000.04720.20
7.0.30.0470.08020.06
7.0.20.0200.04320.19
7.0.10.0130.05020.09
7.0.00.0130.07720.12
5.6.280.0000.07321.15
5.6.210.0070.03720.63
5.6.200.0000.04718.12
5.6.190.0070.08320.53
5.6.180.3400.03320.66
5.6.170.0300.07320.44
5.6.160.0070.07720.54
5.6.150.0070.08018.25
5.6.140.0030.05018.24
5.6.130.0100.08018.16
5.6.120.0070.04320.98
5.6.110.0030.07721.09
5.6.100.0000.06321.13
5.6.90.0130.08021.13
5.6.80.0070.08320.53
5.6.70.0330.07020.43
5.5.350.0300.07720.39
5.5.340.0100.06318.05
5.5.330.0100.04320.27
5.5.320.0330.05720.42
5.5.310.0300.07720.24
5.5.300.0100.08018.03
5.5.290.0070.08017.94
5.5.280.0130.05320.85
5.5.270.0170.04320.80
5.5.260.0070.08320.76
5.5.250.0030.04720.58
5.5.240.0270.07720.37
5.4.450.0700.05319.28
5.4.440.0170.05319.16
5.4.430.0170.05319.46
5.4.420.0200.05319.69
5.4.410.0270.07019.57
5.4.400.0530.06318.51
5.4.390.0400.04718.80
5.4.380.0270.06018.74
5.4.370.0270.04318.79
5.4.360.0170.05018.79
5.4.350.0080.04112.02
5.4.340.0080.03812.02
5.4.320.0070.03712.50
5.4.310.0050.03812.50
5.4.300.0030.04312.50
5.4.290.0050.03812.50
5.4.280.0030.03712.40
5.4.270.0040.03812.40
5.4.260.0040.03812.40
5.4.250.0030.06718.78
5.4.240.0100.05018.98
5.4.230.0030.05318.75
5.4.220.0130.04719.00
5.4.210.0100.05018.72
5.4.200.0070.05018.92
5.4.190.0100.05718.63
5.4.180.0100.04718.93
5.4.170.0030.05718.87
5.4.160.0130.07018.62
5.4.150.0070.05318.77
5.4.140.0130.05016.42
5.4.130.0100.04716.43
5.4.120.0070.05016.33
5.4.110.0030.05316.49
5.4.100.0130.05716.61
5.4.90.0130.04016.34
5.4.80.0100.04316.43
5.4.70.0100.04316.38
5.4.60.0100.04716.41
5.4.50.0130.06016.54
5.4.40.0130.05716.38
5.4.30.0100.04316.45
5.4.20.0030.05716.36
5.4.10.0130.05016.56
5.4.00.0130.06715.80
5.3.290.0030.04112.80
5.3.280.0200.04314.66
5.3.270.0100.05314.70
5.3.260.0000.06014.61
5.3.250.0070.05014.75
5.3.240.0030.05314.70
5.3.230.0070.05014.68
5.3.220.0070.05314.57
5.3.210.0130.07314.55
5.3.200.0100.05714.63
5.3.190.0070.05014.64
5.3.180.0070.05014.75
5.3.170.0070.05014.64
5.3.160.0070.05314.56
5.3.150.0200.04014.56
5.3.140.0030.05314.64
5.3.130.0070.06714.71
5.3.120.0030.05714.77
5.3.110.0170.06714.54
5.3.100.0100.04714.11
5.3.90.0030.05314.11
5.3.80.0130.04314.18
5.3.70.0130.04314.11
5.3.60.0070.04714.24
5.3.50.0030.05014.03
5.3.40.0030.06013.86
5.3.30.0070.05313.99
5.3.20.0030.05013.70
5.3.10.0100.04313.72
5.3.00.0130.04313.63
5.2.170.0070.06311.31
5.2.160.0100.04011.37
5.2.150.0070.04011.06
5.2.140.0070.04711.25
5.2.130.0100.03711.07
5.2.120.0130.05311.32
5.2.110.0070.03711.20
5.2.100.0100.03711.11
5.2.90.0200.04711.20
5.2.80.0200.05011.10
5.2.70.0130.06011.19
5.2.60.0070.03711.04
5.2.50.0070.04011.13
5.2.40.0070.03710.91
5.2.30.0030.04311.20
5.2.20.0070.04010.96
5.2.10.0030.05710.87
5.2.00.0100.04010.90
5.1.60.0030.03310.06
5.1.50.0070.03310.21
5.1.40.0030.03310.02
5.1.30.0070.05310.16
5.1.20.0070.03310.52
5.1.10.0030.03310.04
5.1.00.0100.03010.31
5.0.50.0070.0278.52
5.0.40.0030.0338.37
5.0.30.0070.0408.22
5.0.20.0070.0338.29
5.0.10.0000.0407.97
5.0.00.0030.0408.23
4.4.90.0100.0177.34
4.4.80.0030.0237.34
4.4.70.0000.0237.34
4.4.60.0000.0237.34
4.4.50.0070.0177.34
4.4.40.0030.0337.34
4.4.30.0030.0207.34
4.4.20.0030.0207.34
4.4.10.0000.0237.34
4.4.00.0070.0307.34
4.3.110.0070.0207.34
4.3.100.0070.0177.34
4.3.90.0100.0137.34
4.3.80.0000.0337.34
4.3.70.0000.0237.34
4.3.60.0100.0107.34
4.3.50.0000.0237.34
4.3.40.0000.0337.34
4.3.30.0000.0237.34
4.3.20.0000.0237.34
4.3.10.0000.0237.34
4.3.00.0170.0207.21

preferences:
39.83 ms | 401 KiB | 5 Q