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(1,2,3); // 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.0040.01218.68
8.3.50.0150.00721.14
8.3.40.0070.01418.93
8.3.30.0110.00420.17
8.3.20.0040.00420.16
8.3.10.0050.00321.80
8.3.00.0040.00422.39
8.2.180.0000.01916.75
8.2.170.0110.00322.96
8.2.160.0100.00320.43
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0100.01026.16
8.2.120.0000.01017.80
8.2.110.0060.00322.05
8.2.100.0060.00619.25
8.2.90.0070.00019.27
8.2.80.0030.00619.38
8.2.70.0080.00017.63
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0060.00318.22
8.2.30.0000.00917.95
8.2.20.0040.00417.72
8.2.10.0040.00417.80
8.2.00.0040.00417.75
8.1.280.0110.00425.92
8.1.270.0050.00324.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00523.64
8.1.230.0070.00418.94
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0110.00017.25
8.1.190.0050.00317.41
8.1.180.0030.00519.01
8.1.170.0060.00318.45
8.1.160.0070.00022.16
8.1.150.0040.00418.50
8.1.140.0040.00417.44
8.1.130.0030.00317.84
8.1.120.0030.00317.40
8.1.110.0040.00417.38
8.1.100.0000.00717.39
8.1.90.0070.00017.39
8.1.80.0040.00417.41
8.1.70.0030.00317.42
8.1.60.0000.00717.57
8.1.50.0030.00617.41
8.1.40.0040.00417.54
8.1.30.0040.00417.64
8.1.20.0000.00817.64
8.1.10.0000.00817.55
8.1.00.0070.00017.52
8.0.300.0000.00718.77
8.0.290.0000.00717.05
8.0.280.0040.00418.41
8.0.270.0000.00717.21
8.0.260.0070.00016.88
8.0.250.0070.00016.98
8.0.240.0050.00516.98
8.0.230.0070.00016.91
8.0.220.0080.00016.94
8.0.210.0040.00416.89
8.0.200.0000.00716.86
8.0.190.0060.00316.97
8.0.180.0030.00716.96
8.0.170.0040.00416.82
8.0.160.0070.00017.02
8.0.150.0000.00716.88
8.0.140.0050.00316.86
8.0.130.0000.00513.38
8.0.120.0050.00316.80
8.0.110.0070.00016.89
8.0.100.0050.00216.79
8.0.90.0000.00716.95
8.0.80.0060.01216.94
8.0.70.0030.00516.86
8.0.60.0000.00816.91
8.0.50.0000.00816.71
8.0.30.0140.00816.94
8.0.20.0140.00517.40
8.0.10.0040.00416.98
8.0.00.0130.00716.85
7.4.330.0050.00015.00
7.4.320.0000.00616.57
7.4.300.0030.00316.62
7.4.290.0040.00416.65
7.4.280.0040.00416.44
7.4.270.0030.00316.63
7.4.260.0040.00416.59
7.4.250.0070.00016.50
7.4.240.0030.00316.53
7.4.230.0070.00016.42
7.4.220.0160.00616.66
7.4.210.0080.00616.59
7.4.200.0070.00016.52
7.4.190.0030.00316.70
7.4.160.0110.00516.49
7.4.150.0100.00717.40
7.4.140.0080.01117.86
7.4.130.0090.00816.49
7.4.120.0080.01016.64
7.4.110.0060.01216.56
7.4.100.0070.01016.47
7.4.90.0090.00916.49
7.4.80.0040.01419.39
7.4.70.0050.01116.49
7.4.60.0100.01016.60
7.4.50.0000.00416.45
7.4.40.0040.01122.77
7.4.30.0070.01016.64
7.4.10.0110.00714.83
7.4.00.0070.01015.13
7.3.330.0020.00213.45
7.3.320.0030.00313.30
7.3.310.0030.00316.41
7.3.300.0070.00016.32
7.3.290.0130.00016.36
7.3.280.0080.00716.37
7.3.270.0070.01017.40
7.3.260.0150.00616.30
7.3.250.0130.00516.46
7.3.240.0090.00816.65
7.3.230.0090.00916.50
7.3.210.0150.00616.59
7.3.200.0120.00919.39
7.3.190.0120.01116.47
7.3.180.0080.00816.47
7.3.170.0040.01416.28
7.3.160.0060.01116.46
7.3.130.0030.01614.99
7.3.120.0090.00714.78
7.3.110.0090.00614.72
7.3.100.0000.01114.99
7.3.90.0030.01314.89
7.3.80.0000.00814.70
7.3.70.0090.00614.74
7.3.60.0060.00614.80
7.3.50.0060.00614.88
7.3.40.0030.00714.76
7.3.30.0060.00314.85
7.3.20.0000.01316.58
7.3.10.0060.00616.63
7.3.00.0030.01016.33
7.2.330.0100.01016.77
7.2.320.0140.00316.42
7.2.310.0070.01016.47
7.2.300.0070.01416.62
7.2.290.0030.01716.69
7.2.260.0100.00614.81
7.2.250.0030.01215.27
7.2.240.0070.00715.10
7.2.230.0090.00614.81
7.2.220.0040.01215.08
7.2.210.0030.01215.23
7.2.200.0060.00915.04
7.2.190.0040.01115.17
7.2.180.0070.00314.96
7.2.170.0060.01214.95
7.2.160.0040.00715.08
7.2.150.0060.00617.10
7.2.140.0070.00716.97
7.2.130.0040.00816.77
7.2.120.0090.00616.92
7.2.110.0060.01016.89
7.2.100.0060.00916.98
7.2.90.0040.01216.96
7.2.80.0040.01116.68
7.2.70.0110.00516.88
7.2.60.0110.00616.58
7.2.50.0000.01516.97
7.2.40.0060.00616.64
7.2.30.0070.01017.04
7.2.20.0100.01016.98
7.2.10.0040.01516.96
7.2.00.0070.00718.17
7.1.330.0120.00315.75
7.1.320.0000.01015.69
7.1.310.0090.00315.73
7.1.300.0000.01015.79
7.1.290.0040.00415.82
7.1.280.0030.01315.73
7.1.270.0030.01015.65
7.1.260.0030.00915.54
7.1.250.0000.01015.88
7.1.240.0110.00415.77
7.1.230.0080.00415.82
7.1.220.0030.00915.60
7.1.210.0050.00515.71
7.1.200.0050.00915.79
7.1.190.0000.01515.83
7.1.180.0100.00315.79
7.1.170.0030.00615.51
7.1.160.0040.00415.71
7.1.150.0070.00315.72
7.1.140.0030.01015.84
7.1.130.0100.00315.77
7.1.120.0040.01115.72
7.1.110.0070.00315.79
7.1.100.0050.00916.95
7.1.90.0060.00915.67
7.1.80.0070.00715.88
7.1.70.0080.00516.38
7.1.60.0080.01417.49
7.1.50.0110.00716.30
7.1.40.0070.00515.90
7.1.30.0070.00715.59
7.1.20.0060.00715.84
7.1.10.0060.01115.90
7.1.00.0030.02519.00
7.0.330.0060.00615.19
7.0.320.0130.00315.40
7.0.310.0030.00915.33
7.0.300.0040.00715.15
7.0.290.0070.00315.53
7.0.280.0000.01415.18
7.0.270.0000.01015.29
7.0.260.0000.01015.32
7.0.250.0040.00715.38
7.0.240.0030.01215.39
7.0.230.0000.01315.47
7.0.220.0070.00715.04
7.0.210.0080.00015.48
7.0.200.0040.00715.99
7.0.190.0060.00915.30
7.0.180.0070.00715.05
7.0.170.0030.01215.48
7.0.160.0030.01015.49
7.0.150.0090.00315.47
7.0.140.0020.04118.78
7.0.130.0000.01315.50
7.0.120.0000.01315.66
7.0.110.0060.00915.36
7.0.100.0110.00315.45
7.0.90.0100.00315.41
7.0.80.0030.01415.24
7.0.70.0070.00415.38
7.0.60.0050.04617.70
7.0.50.0080.03216.76
7.0.40.0100.02216.79
7.0.30.0320.03816.75
7.0.20.0230.03016.95
7.0.10.0030.05016.71
7.0.00.0070.04616.91
5.6.400.0090.00914.80
5.6.390.0050.00814.73
5.6.380.0050.01014.53
5.6.370.0080.00314.37
5.6.360.0070.00714.32
5.6.350.0070.00314.62
5.6.340.0030.01014.27
5.6.330.0040.01114.63
5.6.320.0060.00614.62
5.6.310.0030.00714.70
5.6.300.0000.00914.28
5.6.290.0110.00314.54
5.6.280.0020.04417.82
5.6.270.0060.00914.57
5.6.260.0040.01114.70
5.6.250.0070.00314.60
5.6.240.0130.00014.73
5.6.230.0040.01114.72
5.6.220.0000.01314.31
5.6.210.0060.03417.55
5.6.200.0080.02616.37
5.6.190.0050.03217.64
5.6.180.1880.02817.36
5.6.170.0120.03017.38
5.6.160.0030.03317.41
5.6.150.0050.04316.13
5.6.140.0070.02216.22
5.6.130.0050.03916.20
5.6.120.0070.02517.85
5.6.110.0130.03817.77
5.6.100.0070.04917.75
5.6.90.0110.03517.64
5.6.80.0080.02517.26
5.6.70.0200.04017.40
5.6.60.0030.01314.11
5.6.50.0080.00314.21
5.6.40.0000.01414.25
5.6.30.0030.00714.06
5.6.20.0040.01214.59
5.6.10.0050.00514.26
5.6.00.0000.00814.27
5.5.380.0060.00613.96
5.5.370.0030.01214.37
5.5.360.0040.01214.11
5.5.350.0170.04017.47
5.5.340.0020.04816.15
5.5.330.0070.02817.26
5.5.320.0270.03217.25
5.5.310.0180.03817.33
5.5.300.0070.04216.17
5.5.290.0070.02816.11
5.5.280.0100.04317.48
5.5.270.0140.03817.72
5.5.260.0110.04617.63
5.5.250.0050.04517.56
5.5.240.0180.03817.18
5.5.230.0030.01314.22
5.5.220.0030.01414.00
5.5.210.0000.01114.38
5.5.200.0110.00314.51
5.5.190.0090.00614.55
5.5.180.0030.00914.15
5.5.170.0070.00714.37
5.5.160.0000.01214.07
5.5.150.0120.00314.41
5.5.140.0130.00314.39
5.5.130.0090.00614.32
5.5.120.0070.00714.36
5.5.110.0130.00014.29
5.5.100.0070.00714.19
5.5.90.0040.01214.36
5.5.80.0120.00314.18
5.5.70.0060.00314.37
5.5.60.0100.00614.37
5.5.50.0090.00614.14
5.5.40.0100.00714.14
5.5.30.0080.00614.44
5.5.20.0100.00314.12
5.5.10.0060.00914.14
5.5.00.0030.00914.29
5.4.450.0380.02614.95
5.4.440.0140.03215.08
5.4.430.0120.03715.27
5.4.420.0160.03215.24
5.4.410.0130.02915.16
5.4.400.0270.02814.87
5.4.390.0220.03514.92
5.4.380.0220.02714.98
5.4.370.0070.03014.74
5.4.360.0130.02514.70
5.4.350.0070.02911.63
5.4.340.0100.02211.59
5.4.330.0030.00910.91
5.4.320.0060.02111.75
5.4.310.0060.02311.84
5.4.300.0050.02911.71
5.4.290.0050.02211.77
5.4.280.0030.02411.67
5.4.270.0050.02111.75
5.4.260.0020.02511.65
5.4.250.0030.03214.85
5.4.240.0070.02815.08
5.4.230.0030.03114.82
5.4.220.0100.03015.01
5.4.210.0030.03115.01
5.4.200.0030.03114.99
5.4.190.0100.02514.84
5.4.180.0050.03114.96
5.4.170.0080.02715.02
5.4.160.0150.02514.80
5.4.150.0120.03615.07
5.4.140.0020.03213.70
5.4.130.0050.02713.75
5.4.120.0050.03013.56
5.4.110.0070.02713.78
5.4.100.0050.03013.82
5.4.90.0030.03013.67
5.4.80.0100.02713.84
5.4.70.0030.03113.79
5.4.60.0070.02613.85
5.4.50.0050.03013.70
5.4.40.0060.03013.57
5.4.30.0100.02513.65
5.4.20.0080.02613.80
5.4.10.0080.02813.67
5.4.00.0060.02613.48
5.3.290.0100.02211.72
5.3.280.0090.02812.46
5.3.270.0080.03012.65
5.3.260.0060.03212.67
5.3.250.0070.02812.53
5.3.240.0080.02812.57
5.3.230.0100.02812.53
5.3.220.0140.02312.54
5.3.210.0070.03212.53
5.3.200.0080.03012.60
5.3.190.0100.02612.63
5.3.180.0070.02912.70
5.3.170.0140.02412.49
5.3.160.0080.02812.71
5.3.150.0060.04012.65
5.3.140.0100.02312.54
5.3.130.0090.03012.46
5.3.120.0090.02812.63
5.3.110.0050.03312.59
5.3.100.0080.02812.25
5.3.90.0050.02912.29
5.3.80.0090.02712.24
5.3.70.0070.03012.28
5.3.60.0090.02812.20
5.3.50.0020.03312.30
5.3.40.0120.02612.20
5.3.30.0100.02412.25
5.3.20.0070.03812.15
5.3.10.0140.02512.10
5.3.00.0110.02912.03
5.2.170.0070.03711.24
5.2.160.0100.03311.31
5.2.150.0030.04311.22
5.2.140.0070.04011.23
5.2.130.0170.03011.08
5.2.120.0070.03711.07
5.2.110.0070.03711.07
5.2.100.0100.04711.09
5.2.90.0030.04711.29
5.2.80.0200.02711.07
5.2.70.0000.04311.18
5.2.60.0070.05011.04
5.2.50.0100.03711.25
5.2.40.0070.03710.99
5.2.30.0100.05011.16
5.2.20.0100.05010.79
5.2.10.0030.05710.95
5.2.00.0030.04010.80
5.1.60.0100.02710.20
5.1.50.0000.04010.08
5.1.40.0030.0379.90
5.1.30.0000.03710.40
5.1.20.0070.03310.45
5.1.10.0030.04310.14
5.1.00.0100.03310.14
5.0.50.0030.0278.75
5.0.40.0070.0238.39
5.0.30.0100.0338.23
5.0.20.0070.0238.35
5.0.10.0070.0278.23
5.0.00.0100.0338.26
4.4.90.0030.0206.30
4.4.80.0070.0206.30
4.4.70.0100.0236.30
4.4.60.0070.0276.30
4.4.50.0070.0236.30
4.4.40.0030.0336.30
4.4.30.0030.0206.28
4.4.20.0000.0236.28
4.4.10.0030.0206.27
4.4.00.0000.0336.19
4.3.110.0030.0206.16
4.3.100.0130.0106.14
4.3.90.0070.0276.14
4.3.80.0030.0306.14
4.3.70.0030.0206.14
4.3.60.0000.0206.14
4.3.50.0000.0236.14
4.3.40.0000.0336.14
4.3.30.0000.0236.14
4.3.20.0030.0206.14
4.3.10.0000.0206.14
4.3.00.0000.0237.21

preferences:
49.09 ms | 401 KiB | 5 Q