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) { print_r($this->callback);exit; $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->callback = 'mycallback'; // 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.0060.01218.43
8.3.50.0080.00821.27
8.3.40.0040.01118.97
8.3.30.0070.00720.39
8.3.20.0040.00420.33
8.3.10.0040.00422.09
8.3.00.0080.00022.50
8.2.180.0060.01016.38
8.2.170.0090.00918.89
8.2.160.0000.01422.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0100.01026.16
8.2.120.0000.01019.64
8.2.110.0220.00020.52
8.2.100.0040.00817.91
8.2.90.0000.00819.14
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0000.00817.80
8.2.50.0030.00618.07
8.2.40.0040.00417.91
8.2.30.0040.00418.06
8.2.20.0080.00017.73
8.2.10.0040.00417.64
8.2.00.0080.00017.56
8.1.280.0070.01425.92
8.1.270.0050.00224.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00822.24
8.1.230.0040.00817.42
8.1.220.0060.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0040.00417.51
8.1.180.0030.00519.01
8.1.170.0000.00918.45
8.1.160.0040.00422.14
8.1.150.0040.00418.49
8.1.140.0040.00417.45
8.1.130.0000.00717.86
8.1.120.0030.00317.43
8.1.110.0030.00517.28
8.1.100.0000.00717.30
8.1.90.0070.00017.42
8.1.80.0040.00417.31
8.1.70.0060.00017.41
8.1.60.0060.00317.57
8.1.50.0070.00017.52
8.1.40.0040.00417.46
8.1.30.0000.00717.65
8.1.20.0030.00617.49
8.1.10.0070.00017.51
8.1.00.0070.00017.39
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0020.00518.36
8.0.270.0000.00717.13
8.0.260.0060.00016.70
8.0.250.0030.00317.00
8.0.240.0030.00516.98
8.0.230.0030.00316.84
8.0.220.0040.00416.87
8.0.210.0070.00016.80
8.0.200.0000.00716.79
8.0.190.0090.00016.94
8.0.180.0070.00016.97
8.0.170.0070.00016.97
8.0.160.0030.00316.91
8.0.150.0030.00616.85
8.0.140.0000.00816.76
8.0.130.0000.00513.28
8.0.120.0070.00016.76
8.0.110.0040.00416.89
8.0.100.0070.00016.85
8.0.90.0000.00816.90
8.0.80.0070.00716.93
8.0.70.0000.00716.86
8.0.60.0070.00016.73
8.0.50.0000.00716.91
8.0.30.0060.01217.09
8.0.20.0100.01117.40
8.0.10.0040.00417.08
8.0.00.0090.01116.58
7.4.330.0020.00215.00
7.4.320.0030.00316.45
7.4.300.0000.00616.52
7.4.290.0030.00616.53
7.4.280.0080.00016.46
7.4.270.0000.00716.61
7.4.260.0000.00716.60
7.4.250.0070.00016.36
7.4.240.0020.00516.56
7.4.230.0030.00316.32
7.4.220.0030.02016.64
7.4.210.0060.00816.59
7.4.200.0040.00416.39
7.4.190.0000.00716.47
7.4.160.0090.00616.49
7.4.150.0130.00517.40
7.4.140.0130.00517.86
7.4.130.0090.01116.62
7.4.120.0060.01016.50
7.4.110.0080.00816.64
7.4.100.0130.00916.39
7.4.90.0110.00616.46
7.4.80.0070.01119.39
7.4.70.0120.00416.53
7.4.60.0110.00816.42
7.4.50.0030.00516.33
7.4.40.0070.00722.77
7.4.30.0090.01216.25
7.4.00.0060.00915.01
7.3.330.0060.00013.43
7.3.320.0050.00013.31
7.3.310.0030.00316.46
7.3.300.0000.00716.21
7.3.290.0140.00016.35
7.3.280.0060.01016.33
7.3.270.0110.00717.40
7.3.260.0070.01016.57
7.3.250.0060.01116.28
7.3.240.0130.00316.56
7.3.230.0120.00616.39
7.3.210.0070.01116.35
7.3.200.0130.01019.39
7.3.190.0070.01416.29
7.3.180.0110.00716.39
7.3.170.0120.00316.44
7.3.160.0120.00316.44
7.3.120.0030.01314.66
7.3.10.0140.01116.30
7.3.00.0120.00816.70
7.2.330.0080.01216.69
7.2.320.0070.01016.78
7.2.310.0070.01016.41
7.2.300.0110.00716.45
7.2.290.0060.01616.75
7.2.130.0160.00616.77
7.2.120.0070.01116.54
7.2.110.0070.00716.82
7.2.100.0090.00916.77
7.2.90.0060.01116.47
7.2.80.0060.01416.79
7.2.70.0170.00716.90
7.2.60.0040.01816.68
7.2.50.0150.00816.88
7.2.40.0200.00816.71
7.2.30.0160.01216.35
7.2.20.0180.00416.70
7.2.10.0100.01416.92
7.2.00.0070.00818.05
7.1.250.0140.01115.71
7.1.200.0030.00715.60
7.1.100.0000.01118.01
7.1.70.0000.00917.10
7.1.60.0110.01419.43
7.1.50.0100.00716.81
7.1.00.0070.06722.45
7.0.200.0000.00816.77
7.0.140.0030.07321.95
7.0.60.0070.05719.95
7.0.50.0130.07717.87
7.0.40.0070.08319.98
7.0.30.0200.04720.15
7.0.20.0270.07720.26
7.0.10.0170.04020.19
7.0.00.0100.07720.26
5.6.280.0030.07320.82
5.6.210.0000.04320.71
5.6.200.0130.07718.22
5.6.190.0000.09020.32
5.6.180.0300.03720.63
5.6.170.0300.07720.55
5.6.160.0130.08020.68
5.6.150.0070.07318.18
5.6.140.0100.03018.18
5.6.130.0000.04318.14
5.6.120.0100.08021.07
5.6.110.0100.08020.98
5.6.100.0030.06321.00
5.6.90.0030.05721.00
5.6.80.0130.07320.51
5.6.70.0230.07320.29
5.5.350.0130.07720.50
5.5.340.0030.06717.97
5.5.330.0030.08720.44
5.5.320.0170.05020.34
5.5.310.0230.06020.29
5.5.300.0070.05318.09
5.5.290.0070.08718.06
5.5.280.0000.06020.87
5.5.270.0170.07320.82
5.5.260.0070.08320.84
5.5.250.0130.03720.66
5.5.240.0000.06720.14
5.4.450.1570.03719.52
5.4.440.1530.03319.41
5.4.430.0000.09019.56
5.4.420.0000.04319.20
5.4.410.0070.05319.04
5.4.400.0030.04319.09
5.4.390.0130.03019.20
5.4.380.0000.04019.22
5.4.370.1470.04719.08
5.4.360.0200.03718.87
5.4.350.0000.04319.06
5.4.340.0200.04319.15
5.4.320.1600.03719.09
5.4.310.1530.04019.25
5.4.300.0000.04018.98
5.4.290.0070.06719.16
5.4.280.0170.03719.31
5.4.270.0030.07719.00
5.4.260.0070.06718.99
5.4.250.0000.04718.98
5.4.240.0900.04019.09
5.4.230.1630.04019.08
5.4.220.0100.03719.12
5.4.210.0070.04318.98
5.4.200.0470.04719.16
5.4.190.0000.04019.23
5.4.180.0100.04019.21
5.4.170.0630.07019.21
5.4.160.0100.03318.82
5.4.150.0070.03319.13
5.4.140.0700.05016.51
5.4.130.0030.04016.66
5.4.120.0030.05016.32
5.4.110.0200.06316.25
5.4.100.0170.05716.45
5.4.90.0200.04316.37
5.4.80.0130.03716.23
5.4.70.0230.06316.18
5.4.60.0200.03316.52
5.4.50.0100.05016.51
5.4.40.0170.03316.55
5.4.30.0170.03316.25
5.4.20.0130.03716.55
5.4.10.0200.05016.16
5.4.00.0200.03015.95
5.3.290.0030.03714.57
5.3.280.0130.04014.82
5.3.270.0170.03714.58
5.3.260.0170.05014.59
5.3.250.0100.07714.58
5.3.240.0030.07714.68
5.3.230.0170.05314.83
5.3.220.1570.04314.54
5.3.210.1730.03714.65
5.3.200.0100.03714.48
5.3.190.0000.04314.58
5.3.180.0870.05714.47
5.3.170.1800.04714.47
5.3.160.1530.03714.62
5.3.150.0030.04314.54
5.3.140.0030.03714.54
5.3.130.0000.04014.57
5.3.120.1330.04014.53
5.3.110.0030.04314.46
5.3.100.0030.03714.05
5.3.90.0000.03714.08
5.3.80.0000.04013.92
5.3.70.0070.07313.95
5.3.60.0070.03313.91
5.3.50.0070.04713.93
5.3.40.0100.03713.96
5.3.30.0030.05013.82
5.3.20.1130.03013.71
5.3.10.0000.07013.57
5.3.00.0000.04313.56
5.2.170.0170.06311.27
5.2.160.1400.03011.13
5.2.150.0070.02711.30
5.2.140.0000.03711.23
5.2.130.1100.03311.02
5.2.120.0070.06011.04
5.2.110.0070.04311.01
5.2.100.0100.02311.18
5.2.90.0770.02011.01
5.2.80.0000.03711.35
5.2.70.0000.04011.23
5.2.60.0000.04011.03
5.2.50.1200.04011.10
5.2.40.0000.03311.21
5.2.30.0000.03010.88
5.2.20.0000.06310.87
5.2.10.0130.03710.78
5.2.00.0000.04310.69
5.1.60.0070.02310.07
5.1.50.0000.03710.07
5.1.40.0070.0539.88
5.1.30.1030.02710.46
5.1.20.0030.03010.26
5.1.10.0000.06010.06
5.1.00.0030.03010.05
5.0.50.0000.0208.46
5.0.40.0200.0208.50
5.0.30.0000.0438.13
5.0.20.0030.0178.43
5.0.10.0030.0238.16
5.0.00.0000.0308.15
4.4.90.0000.0177.86
4.4.80.0030.0237.86
4.4.70.0570.0137.86
4.4.60.0530.0177.86
4.4.50.0570.0207.86
4.4.40.0530.0237.86
4.4.30.0500.0177.86
4.4.20.0570.0137.86
4.4.10.0600.0207.86
4.4.00.0030.0277.86
4.3.110.0000.0377.86
4.3.100.0030.0137.86
4.3.90.0000.0307.86
4.3.80.0000.0237.86
4.3.70.0030.0137.86
4.3.60.0000.0207.86
4.3.50.0200.0337.86
4.3.40.0000.0477.86
4.3.30.0030.0137.86
4.3.20.0070.0107.86
4.3.10.0000.0177.86
4.3.00.0000.0177.86

preferences:
43.22 ms | 401 KiB | 5 Q