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->$callback = array($test->$callback, 'secret'); // 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.0130.01017.37
8.3.40.0060.00918.66
8.3.30.0060.00918.84
8.3.20.0080.00018.76
8.3.10.0030.00520.52
8.3.00.0030.00519.38
8.2.180.0070.01416.88
8.2.170.0150.00022.96
8.2.160.0030.01021.02
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00820.82
8.2.110.0030.00620.35
8.2.100.0080.00417.88
8.2.90.0040.00419.21
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00418.05
8.2.50.0060.00318.07
8.2.40.0090.00019.99
8.2.30.0030.00618.01
8.2.20.0040.00417.73
8.2.10.0070.00017.86
8.2.00.0000.00717.85
8.1.280.0130.00325.92
8.1.270.0030.00524.66
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0040.00422.01
8.1.230.0070.00417.45
8.1.220.0000.00817.79
8.1.210.0080.00018.77
8.1.200.0060.00317.48
8.1.190.0040.00417.53
8.1.180.0000.00918.10
8.1.170.0040.00418.84
8.1.160.0040.00419.00
8.1.150.0050.00318.71
8.1.140.0050.00317.50
8.1.130.0070.00017.76
8.1.120.0040.00417.38
8.1.110.0040.00417.46
8.1.100.0040.00417.49
8.1.90.0040.00417.50
8.1.80.0000.00717.45
8.1.70.0070.00017.39
8.1.60.0030.00617.65
8.1.50.0040.00417.49
8.1.40.0030.00517.40
8.1.30.0030.00617.66
8.1.20.0050.00317.59
8.1.10.0000.00817.57
8.1.00.0040.00417.37
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0040.00418.45
8.0.270.0000.00717.27
8.0.260.0030.00316.80
8.0.250.0040.00417.01
8.0.240.0000.00717.03
8.0.230.0030.00317.02
8.0.220.0000.00716.85
8.0.210.0050.00317.03
8.0.200.0000.00817.07
8.0.190.0050.00516.99
8.0.180.0050.00316.94
8.0.170.0000.00916.87
8.0.160.0050.00217.02
8.0.150.0040.00416.95
8.0.140.0040.00516.94
8.0.130.0000.00513.36
8.0.120.0040.00417.01
8.0.110.0080.00017.03
8.0.100.0040.00416.85
8.0.90.0000.00716.88
8.0.80.0140.00517.03
8.0.70.0000.00716.86
8.0.60.0000.00716.83
8.0.50.0040.00416.80
8.0.30.0100.00917.11
8.0.20.0130.00717.15
8.0.10.0030.00516.98
8.0.00.0070.01516.74
7.4.330.0020.00212.91
7.4.320.0030.00316.50
7.4.300.0030.00316.51
7.4.290.0000.00716.62
7.4.280.0030.00516.65
7.4.270.0000.00716.51
7.4.260.0000.00513.27
7.4.250.0060.00316.45
7.4.240.0070.00016.63
7.4.230.0000.00716.51
7.4.220.0000.00116.57
7.4.210.0070.01016.60
7.4.200.0000.00816.52
7.4.190.0030.00316.65
7.4.160.0040.01816.52
7.4.150.0140.00716.61
7.4.140.0060.01216.52
7.4.130.0070.01016.46
7.4.120.0120.00516.54
7.4.110.0100.00616.66
7.4.100.0120.00616.53
7.4.90.0070.01016.52
7.4.80.0080.00816.46
7.4.70.0120.00916.63
7.4.60.0150.00616.68
7.4.50.0080.00416.38
7.4.40.0120.00316.41
7.4.30.0080.00816.43
7.4.00.0080.00814.85
7.3.330.0070.00013.43
7.3.320.0000.00513.41
7.3.310.0000.00716.30
7.3.300.0030.00316.30
7.3.290.0040.01416.37
7.3.280.0080.00816.43
7.3.270.0080.00816.64
7.3.260.0060.01116.44
7.3.250.0080.01016.50
7.3.240.0130.00916.54
7.3.230.0030.01316.59
7.3.210.0040.01416.61
7.3.200.0120.00919.39
7.3.190.0110.01216.36
7.3.180.0000.01616.24
7.3.170.0090.00916.52
7.3.160.0130.00316.63
7.3.120.0030.01514.80
7.3.110.0080.00814.79
7.3.100.0040.01014.80
7.3.90.0050.01114.86
7.3.80.0070.00714.88
7.3.70.0070.00514.88
7.3.60.0080.00614.72
7.3.50.0070.00415.03
7.3.40.0050.00514.88
7.3.30.0050.01014.74
7.3.20.0040.00916.77
7.3.10.0050.00816.83
7.3.00.0080.00716.63
7.2.330.0120.00616.81
7.2.320.0200.00316.75
7.2.310.0060.01616.76
7.2.300.0110.01116.52
7.2.290.0080.00816.52
7.2.250.0050.01515.04
7.2.240.0090.01115.10
7.2.230.0070.00515.06
7.2.220.0050.00615.08
7.2.210.0070.00815.12
7.2.200.0030.00814.95
7.2.190.0070.00715.14
7.2.180.0030.00715.21
7.2.170.0070.00715.22
7.2.80.0040.01116.71
7.2.60.0030.01017.00
7.2.00.0060.00619.28
7.1.330.0050.01015.66
7.1.320.0050.01215.82
7.1.310.0090.00515.75
7.1.300.0030.01215.82
7.1.290.0050.00715.75
7.1.280.0020.00815.63
7.1.270.0050.00515.73
7.1.260.0050.00615.71
7.1.200.0030.00715.90
7.1.100.0030.00618.16
7.1.70.0050.00317.22
7.1.60.0130.01319.40
7.1.50.0130.01017.01
7.1.00.0000.07722.27
7.0.200.0470.00014.50
7.0.140.0030.07322.18
7.0.120.0070.07322.02
7.0.60.0070.08019.95
7.0.50.0130.04317.90
7.0.40.0400.07320.40
7.0.30.0230.06720.23
7.0.20.0300.07320.25
7.0.10.0330.07320.23
7.0.00.0230.05020.02
5.6.280.0000.07720.87
5.6.210.0070.08020.48
5.6.200.0070.07318.29
5.6.190.0300.08720.33
5.6.180.0270.08020.33
5.6.170.0330.07720.64
5.6.160.0270.08020.64
5.6.150.0300.08320.34
5.6.140.0330.04720.41
5.6.130.0400.07020.16
5.6.120.0330.07320.33
5.6.110.0200.04720.16
5.6.100.0200.04320.23
5.6.90.0170.04320.35
5.6.80.0270.03719.79
5.6.70.0200.04019.71
5.6.60.0230.03719.88
5.6.50.0230.03719.91
5.6.40.0200.04019.54
5.6.30.0200.05319.54
5.6.20.0230.04319.86
5.6.10.0200.04019.54
5.6.00.0230.07719.59
5.5.350.0300.04020.50
5.5.340.0130.07717.97
5.5.330.0330.06320.31
5.5.320.0370.06720.13
5.5.310.0370.06720.40
5.5.300.0300.07320.21
5.5.290.0230.06720.00
5.5.280.0230.04720.04
5.5.270.0200.04320.11
5.5.260.0300.04019.98
5.5.250.0130.04719.95
5.5.240.0200.04319.71
5.5.230.0130.04319.59
5.5.220.0200.03719.41
5.5.210.0270.05019.60
5.5.200.0200.04019.65
5.5.190.0200.04019.65
5.5.180.0170.04019.52
5.5.160.0230.04019.49
5.5.150.0200.04019.67
5.5.140.0170.04019.32
5.5.130.0230.04019.32
5.5.120.0370.03019.39
5.5.110.0200.03719.38
5.5.100.0270.04019.46
5.5.90.0200.04719.58
5.5.80.0270.07319.29
5.5.70.0170.04019.57
5.5.60.0200.03719.38
5.5.50.0200.03719.21
5.5.40.0200.03719.61
5.5.30.0170.04019.43
5.5.20.0130.04319.50
5.5.10.0200.04019.20
5.5.00.0200.03719.27
5.4.450.0330.05719.54
5.4.440.0400.06319.57
5.4.430.0230.03719.49
5.4.420.0200.04019.20
5.4.410.0170.04019.31
5.4.400.0200.03319.15
5.4.390.0170.04018.98
5.4.380.0270.03718.85
5.4.370.0300.06719.25
5.4.360.0200.03718.87
5.4.350.0130.04318.86
5.4.340.0300.03018.97
5.4.320.0230.03318.99
5.4.310.0170.04018.93
5.4.300.0170.04718.87
5.4.290.0200.03719.02
5.4.280.0270.07018.85
5.4.270.0170.03719.11
5.4.260.0270.03019.17
5.4.250.0230.06319.07
5.4.240.0200.04019.00
5.4.230.0200.04019.14
5.4.220.0270.03719.14
5.4.210.0170.04018.98
5.4.200.0230.04019.28
5.4.190.0170.03718.96
5.4.180.0170.03719.14
5.4.170.0170.04018.91
5.4.160.0270.02719.22
5.4.150.0130.04318.96
5.4.140.0200.03316.34
5.4.130.0200.03316.40
5.4.120.0170.03716.35
5.4.110.0170.04016.45
5.4.100.0130.04016.29
5.4.90.0170.03716.47
5.4.80.0130.03716.36
5.4.70.0270.06716.38
5.4.60.0230.06016.65
5.4.50.0170.03716.43
5.4.40.0270.02716.45
5.4.30.0200.03316.40
5.4.20.0370.05316.50
5.4.10.0270.05016.40
5.4.00.0270.03715.77
5.3.290.0230.04014.56
5.3.280.0200.03714.52
5.3.270.0170.03714.64
5.3.260.0230.03314.53
5.3.250.0230.03014.77
5.3.240.0170.04314.60
5.3.230.0200.03314.66
5.3.220.0170.03714.59
5.3.210.0170.04314.62
5.3.200.0200.03314.62
5.3.190.0230.07014.59
5.3.180.0100.04314.62
5.3.170.0270.03714.57
5.3.160.0230.03014.48
5.3.150.0200.04014.61
5.3.140.0170.03714.61
5.3.130.0170.04714.54
5.3.120.0330.07014.59
5.3.110.0270.08014.61
5.3.100.0200.04013.93
5.3.90.0230.04314.02
5.3.80.0270.04314.04
5.3.70.0270.03314.18
5.3.60.0200.03714.02
5.3.50.0230.07713.96
5.3.40.0230.07314.10
5.3.30.0330.06713.93
5.3.20.0270.06713.59
5.3.10.0270.07313.70
5.3.00.0470.04713.69
5.2.170.0370.05012.48
5.2.160.0230.06012.48
5.2.150.0230.04012.48
5.2.140.0230.05312.48
5.2.130.0330.05312.48
5.2.120.0270.04712.48
5.2.110.0270.04312.48
5.2.100.0230.06012.48
5.2.90.0270.04312.48
5.2.80.0200.04012.48
5.2.70.0300.04012.48
5.2.60.0370.04312.48
5.2.50.0270.06012.48
5.2.40.0230.03712.48
5.2.30.0370.04312.48
5.2.20.0230.05712.48
5.2.10.0200.04712.48
5.2.00.0200.03312.48
5.1.60.0270.04712.48
5.1.50.0270.04012.48
5.1.40.0230.05012.48
5.1.30.0170.05312.48
5.1.20.0230.04312.48
5.1.10.0230.04312.48
5.1.00.0170.04312.48
5.0.50.0070.05012.48
5.0.40.0130.04312.48
5.0.30.0130.05712.48
5.0.20.0100.04312.48
5.0.10.0200.02312.48
5.0.00.0070.03312.48
4.4.90.0070.03712.48
4.4.80.0100.02712.48
4.4.70.0100.02712.48
4.4.60.0100.02712.48
4.4.50.0100.03312.48
4.4.40.0100.05012.48
4.4.30.0130.02712.48
4.4.20.0100.02712.48
4.4.10.0100.01712.48
4.4.00.0070.02712.48
4.3.110.0170.02012.48
4.3.100.0070.02312.48
4.3.90.0100.02012.48
4.3.80.0100.05312.48
4.3.70.0100.02312.48
4.3.60.0130.03012.48
4.3.50.0100.03712.48
4.3.40.0070.04012.48
4.3.30.0070.02312.48
4.3.20.0100.02012.48
4.3.10.0070.03012.48
4.3.00.0070.02312.48

preferences:
39.79 ms | 401 KiB | 5 Q