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($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.0070.01118.43
8.3.50.0170.00221.27
8.3.40.0090.00618.79
8.3.30.0070.00720.17
8.3.20.0060.00320.38
8.3.10.0030.00522.05
8.3.00.0090.00022.36
8.2.180.0110.00416.63
8.2.170.0100.01022.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0110.00726.16
8.2.120.0060.00319.42
8.2.110.0030.00621.05
8.2.100.0090.00317.91
8.2.90.0080.00019.23
8.2.80.0000.00817.97
8.2.70.0000.00817.50
8.2.60.0000.00817.89
8.2.50.0040.00418.10
8.2.40.0000.00820.60
8.2.30.0040.00419.06
8.2.20.0030.00517.66
8.2.10.0040.00417.66
8.2.00.0040.00417.56
8.1.280.0150.00625.92
8.1.270.0080.00024.66
8.1.260.0000.00926.35
8.1.250.0000.00828.09
8.1.240.0060.00321.25
8.1.230.0120.00020.32
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.25
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0090.00018.43
8.1.160.0040.00418.88
8.1.150.0040.00420.09
8.1.140.0000.00717.30
8.1.130.0000.00717.83
8.1.120.0040.00417.34
8.1.110.0050.00317.38
8.1.100.0000.00717.39
8.1.90.0030.00317.44
8.1.80.0050.00217.38
8.1.70.0000.00717.29
8.1.60.0050.00317.62
8.1.50.0030.00517.52
8.1.40.0030.00517.44
8.1.30.0030.00617.53
8.1.20.0080.00017.68
8.1.10.0040.00417.57
8.1.00.0000.00717.47
8.0.300.0070.00018.77
8.0.290.0070.00016.63
8.0.280.0000.00718.39
8.0.270.0020.00517.09
8.0.260.0080.00016.74
8.0.250.0030.00316.95
8.0.240.0040.00416.84
8.0.230.0080.00016.82
8.0.220.0040.00316.90
8.0.210.0030.00316.81
8.0.200.0030.00316.91
8.0.190.0030.00616.85
8.0.180.0040.00416.90
8.0.170.0040.00416.81
8.0.160.0040.00416.79
8.0.150.0030.00516.82
8.0.140.0000.00816.86
8.0.130.0000.00613.28
8.0.120.0040.00416.80
8.0.110.0000.00716.75
8.0.100.0050.00316.93
8.0.90.0030.00516.78
8.0.80.0130.00416.94
8.0.70.0040.00416.91
8.0.60.0080.00016.77
8.0.50.0050.00216.91
8.0.30.0160.00516.99
8.0.20.0080.01017.40
8.0.10.0040.00417.02
8.0.00.0070.01216.71
7.4.330.0060.00015.02
7.4.320.0030.00316.54
7.4.300.0000.00716.59
7.4.290.0040.00416.47
7.4.280.0030.00316.46
7.4.270.0040.00416.48
7.4.260.0030.00316.51
7.4.250.0000.00716.48
7.4.240.0060.00216.52
7.4.230.0030.00316.48
7.4.220.0080.00816.54
7.4.210.0070.00716.57
7.4.200.0000.00716.70
7.4.190.0070.00016.52
7.4.160.0060.01016.56
7.4.150.0030.01317.40
7.4.140.0030.01417.86
7.4.130.0050.01116.54
7.4.120.0080.00816.49
7.4.110.0090.00916.55
7.4.100.0100.01016.39
7.4.90.0170.00316.39
7.4.80.0160.01019.39
7.4.70.0080.00716.34
7.4.60.0110.00616.30
7.4.50.0020.00216.28
7.4.40.0040.01122.77
7.4.30.0070.01116.61
7.4.00.0060.00915.15
7.3.330.0000.00513.28
7.3.320.0060.00013.36
7.3.310.0000.00716.38
7.3.300.0070.00016.27
7.3.290.0120.00816.47
7.3.280.0050.01016.31
7.3.270.0130.00317.40
7.3.260.0090.00916.55
7.3.250.0070.01216.40
7.3.240.0140.01016.34
7.3.230.0070.01016.39
7.3.210.0080.00916.40
7.3.200.0110.00619.39
7.3.190.0000.02516.35
7.3.180.0130.00716.36
7.3.170.0130.00316.48
7.3.160.0080.00916.57
7.3.120.0040.01215.01
7.2.330.0120.01216.54
7.2.320.0090.00916.71
7.2.310.0110.00716.74
7.2.300.0080.00816.47
7.2.290.0070.01516.51
7.2.110.0110.00516.41
7.2.00.0060.00619.44
7.1.100.0030.00718.18
7.1.70.0000.00716.96
7.1.60.0110.01419.43
7.1.50.0070.01716.72
7.1.00.0130.04722.31
7.0.200.0040.00416.52
7.0.140.0130.06322.09
7.0.60.0030.06319.86
7.0.50.0070.07017.84
7.0.40.0030.04320.13
7.0.30.0500.05720.06
7.0.20.0200.04320.06
7.0.10.0100.06320.06
7.0.00.0070.05720.15
5.6.280.0000.07720.93
5.6.210.0130.06020.55
5.6.200.0030.08318.15
5.6.190.0070.07020.64
5.6.180.4200.04320.41
5.6.170.0300.06320.48
5.6.160.0000.08720.39
5.6.150.0030.04318.15
5.6.140.0030.08318.28
5.6.130.0070.07318.16
5.6.120.0300.04321.13
5.6.110.0030.09021.12
5.6.100.0030.09320.98
5.6.90.0100.08021.11
5.6.80.0100.07320.38
5.6.70.0270.06320.38
5.5.350.0330.07320.41
5.5.340.0000.06018.09
5.5.330.0100.07020.17
5.5.320.0330.07320.30
5.5.310.0300.05020.30
5.5.300.0070.06317.97
5.5.290.0030.04317.95
5.5.280.0030.08320.77
5.5.270.0000.05720.97
5.5.260.0070.08020.84
5.5.250.0070.08020.59
5.5.240.0270.06020.36
5.4.450.0800.07319.61
5.4.440.0170.06019.69
5.4.430.0270.04719.57
5.4.420.0370.05719.30
5.4.410.0100.06019.57
5.4.400.0300.05318.87
5.4.390.0230.05718.54
5.4.380.0430.03718.50
5.4.370.0230.04318.75
5.4.360.0100.05318.63
5.4.350.0060.03912.02
5.4.340.0090.04412.02
5.4.320.0100.04212.50
5.4.310.0080.05212.50
5.4.300.0100.04612.50
5.4.290.0080.03512.50
5.4.280.0070.03712.39
5.4.270.0050.03612.39
5.4.260.0040.04312.40
5.4.250.0130.05018.88
5.4.240.0130.05319.07
5.4.230.0130.05718.94
5.4.220.0200.05718.77
5.4.210.0200.04718.79
5.4.200.0070.05018.89
5.4.190.0100.05018.76
5.4.180.0070.05318.87
5.4.170.0100.05018.77
5.4.160.0130.05018.93
5.4.150.0130.04718.91
5.4.140.0070.05316.38
5.4.130.0030.05316.39
5.4.120.0130.04716.35
5.4.110.0030.05316.47
5.4.100.0130.04716.31
5.4.90.0170.05016.30
5.4.80.0100.04716.54
5.4.70.0070.06316.58
5.4.60.0170.04016.57
5.4.50.0230.03316.36
5.4.40.0100.04716.65
5.4.30.0070.05716.30
5.4.20.0100.04716.36
5.4.10.0070.05016.43
5.4.00.0030.06315.87
5.3.290.0060.03812.80
5.3.280.0100.05014.76
5.3.270.0070.05014.75
5.3.260.0100.05014.60
5.3.250.0270.04714.71
5.3.240.0030.05714.52
5.3.230.0070.05314.50
5.3.220.0070.05314.56
5.3.210.0170.04314.66
5.3.200.0100.05014.54
5.3.190.0130.04714.65
5.3.180.0030.05314.66
5.3.170.0100.04714.54
5.3.160.0030.06314.74
5.3.150.0130.07014.63
5.3.140.0100.05014.70
5.3.130.0170.05714.62
5.3.120.0130.04314.46
5.3.110.0030.05714.75
5.3.100.0070.05314.04
5.3.90.0130.04014.16
5.3.80.0100.04714.10
5.3.70.0000.05314.01
5.3.60.0000.05314.22
5.3.50.0100.04314.17
5.3.40.0000.05313.86
5.3.30.0100.05313.90
5.3.20.0200.04013.89
5.3.10.0100.04713.67
5.3.00.0170.04013.86
5.2.170.0000.04311.16
5.2.160.0030.04011.22
5.2.150.0030.04011.15
5.2.140.0070.04011.31
5.2.130.0030.04011.01
5.2.120.0070.03711.19
5.2.110.0030.04011.32
5.2.100.0070.04011.17
5.2.90.0070.03711.17
5.2.80.0070.04011.28
5.2.70.0000.04311.31
5.2.60.0070.03711.14
5.2.50.0100.03311.11
5.2.40.0030.04011.11
5.2.30.0030.05711.15
5.2.20.0000.04311.02
5.2.10.0100.03310.94
5.2.00.0100.03310.71
5.1.60.0070.0479.98
5.1.50.0000.0539.99
5.1.40.0100.02710.05
5.1.30.0000.05310.40
5.1.20.0070.03310.57
5.1.10.0030.03310.22
5.1.00.0030.0379.99
5.0.50.0030.0278.64
5.0.40.0000.0278.43
5.0.30.0000.0438.19
5.0.20.0070.0208.35
5.0.10.0070.0238.42
5.0.00.0000.0438.36
4.4.90.0070.0177.35
4.4.80.0000.0237.35
4.4.70.0000.0307.35
4.4.60.0000.0237.35
4.4.50.0000.0207.35
4.4.40.0000.0477.35
4.4.30.0030.0207.35
4.4.20.0030.0207.35
4.4.10.0000.0337.35
4.4.00.0030.0307.35
4.3.110.0000.0277.35
4.3.100.0030.0207.35
4.3.90.0070.0137.35
4.3.80.0000.0337.35
4.3.70.0000.0207.35
4.3.60.0070.0177.35
4.3.50.0000.0277.35
4.3.40.0000.0337.35
4.3.30.0030.0207.35
4.3.20.0030.0207.35
4.3.10.0070.0237.35
4.3.00.0170.0177.21

preferences:
42.19 ms | 401 KiB | 5 Q