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 class A implements ArrayAccess { public function __call($name, $args){ return function(){ echo "HELLO WORLD"; }; } public function offsetSet($offset, $value) {} public function offsetExists($offset) { return true; } public function offsetUnset($offset) {} public function offsetGet($offset) { var_dump($offset);die; } } $test->foo = new A; // 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.70.0080.00816.58
8.3.60.0090.01218.68
8.3.50.0120.00521.15
8.3.40.0000.01518.96
8.3.30.0130.00620.39
8.3.20.0040.00420.20
8.3.10.0040.00421.96
8.3.00.0040.00422.43
8.2.180.0150.00617.00
8.2.170.0040.01122.96
8.2.160.0110.00720.38
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00726.16
8.2.120.0040.00419.66
8.2.110.0060.00322.24
8.2.100.0060.00619.16
8.2.90.0000.00818.96
8.2.80.0080.00019.32
8.2.70.0030.00617.75
8.2.60.0080.00417.93
8.2.50.0090.00018.07
8.2.40.0000.00818.09
8.2.30.0030.00518.02
8.2.20.0020.00517.69
8.2.10.0030.00617.89
8.2.00.0060.00317.77
8.1.280.0100.01025.92
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.97
8.1.230.0040.00719.02
8.1.220.0040.00717.74
8.1.210.0030.00618.77
8.1.200.0040.00417.35
8.1.190.0040.00417.53
8.1.180.0000.00720.19
8.1.170.0060.00318.51
8.1.160.0000.00822.07
8.1.150.0030.00618.63
8.1.140.0000.00717.46
8.1.130.0100.00017.84
8.1.120.0030.00517.47
8.1.110.0020.00517.46
8.1.100.0000.00917.39
8.1.90.0040.00417.52
8.1.80.0040.00417.38
8.1.70.0030.00517.43
8.1.60.0000.00817.55
8.1.50.0000.00817.52
8.1.40.0060.00317.45
8.1.30.0040.00417.53
8.1.20.0040.00417.60
8.1.10.0050.00217.60
8.1.00.0040.00817.55
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0040.00418.41
8.0.270.0000.00717.29
8.0.260.0000.00716.94
8.0.250.0050.00216.93
8.0.240.0030.00617.06
8.0.230.0030.00317.06
8.0.220.0070.00017.03
8.0.210.0070.00016.86
8.0.200.0030.00316.94
8.0.190.0030.00517.04
8.0.180.0050.00316.99
8.0.170.0030.00617.01
8.0.160.0000.00716.92
8.0.150.0080.00016.86
8.0.140.0050.00316.84
8.0.130.0030.00313.42
8.0.120.0000.01016.98
8.0.110.0000.00716.96
8.0.100.0000.00717.00
8.0.90.0050.00316.92
8.0.80.0000.01516.98
8.0.70.0000.00716.91
8.0.60.0030.00516.91
8.0.50.0040.00417.03
8.0.30.0090.01117.06
8.0.20.0160.00617.40
8.0.10.0050.00516.96
8.0.00.0110.00816.86
7.4.330.0050.00015.00
7.4.320.0000.00616.60
7.4.300.0030.00316.53
7.4.290.0000.00616.60
7.4.280.0070.00016.52
7.4.270.0030.00316.59
7.4.260.0000.00716.50
7.4.250.0000.00716.57
7.4.240.0020.00516.47
7.4.230.0030.00316.35
7.4.220.0110.00716.46
7.4.210.0100.01016.56
7.4.200.0040.00416.41
7.4.190.0040.00416.46
7.4.160.0100.00616.48
7.4.150.0110.01117.40
7.4.140.0090.00917.86
7.4.130.0040.01316.45
7.4.120.0100.00616.55
7.4.110.0140.00316.52
7.4.100.0130.00616.59
7.4.90.0090.01216.55
7.4.80.0120.00819.39
7.4.70.0140.00516.46
7.4.60.0060.01716.71
7.4.50.0040.00416.41
7.4.40.0070.00422.77
7.4.30.0100.00716.45
7.4.10.0060.01315.07
7.4.00.0090.01015.10
7.3.330.0050.00013.42
7.3.320.0060.00013.46
7.3.310.0050.00316.38
7.3.300.0070.00016.41
7.3.290.0070.00716.33
7.3.280.0070.00916.36
7.3.270.0110.00517.40
7.3.260.0120.01216.38
7.3.250.0100.00816.44
7.3.240.0100.01016.54
7.3.230.0130.00316.39
7.3.210.0070.01016.41
7.3.200.0030.01319.39
7.3.190.0120.00916.40
7.3.180.0000.01716.36
7.3.170.0100.00716.59
7.3.160.0150.00916.61
7.3.130.0100.01014.71
7.3.120.0090.00514.96
7.3.110.0040.01414.81
7.3.100.0110.00715.01
7.3.90.0110.00314.62
7.3.80.0030.01014.91
7.3.70.0120.00314.85
7.3.60.0060.00614.72
7.3.50.0030.01114.93
7.3.40.0040.01014.95
7.3.30.0120.00015.08
7.3.20.0100.00316.70
7.3.10.0100.00616.72
7.3.00.0050.00816.45
7.2.330.0150.00816.67
7.2.320.0060.01316.75
7.2.310.0060.01716.82
7.2.300.0100.00716.77
7.2.290.0060.00916.55
7.2.260.0060.01215.15
7.2.250.0120.00715.21
7.2.240.0030.01315.29
7.2.230.0070.00415.23
7.2.220.0110.00715.04
7.2.210.0070.00315.05
7.2.200.0000.01215.00
7.2.190.0060.00614.72
7.2.180.0000.01015.10
7.2.170.0030.00615.05
7.2.160.0050.00514.89
7.2.150.0030.00617.11
7.2.140.0040.01117.10
7.2.130.0080.00616.99
7.2.120.0030.01017.01
7.2.110.0040.01016.86
7.2.100.0110.00516.60
7.2.90.0070.00716.77
7.2.80.0090.00616.72
7.2.70.0080.00816.83
7.2.60.0080.00916.72
7.2.50.0090.01016.74
7.2.40.0060.01016.64
7.2.30.0070.01016.85
7.2.20.0090.00716.58
7.2.10.0070.00916.52
7.2.00.0050.00916.89
7.1.330.0000.01315.58
7.1.320.0000.01615.87
7.1.310.0130.00315.74
7.1.300.0100.00315.76
7.1.290.0100.00015.88
7.1.280.0110.00015.75
7.1.270.0000.01415.82
7.1.260.0030.00615.84
7.1.250.0060.00715.76
7.1.240.0020.01015.75
7.1.230.0070.00515.77
7.1.220.0080.00415.80
7.1.210.0030.00915.79
7.1.200.0040.00915.56
7.1.190.0100.00115.66
7.1.180.0070.00615.70
7.1.170.0020.00815.60
7.1.160.0050.00715.78
7.1.150.0070.00715.61
7.1.140.0050.00615.60
7.1.130.0050.00815.50
7.1.120.0070.00815.81
7.1.110.0080.00315.79
7.1.100.0070.00615.64
7.1.90.0090.00415.54
7.1.80.0030.00715.65
7.1.70.0060.00816.13
7.1.60.0050.01116.84
7.1.50.0020.01116.09
7.1.40.0070.00615.66
7.1.30.0080.00715.72
7.1.20.0130.00015.82
7.1.10.0100.00415.72
7.1.00.0050.01617.95
7.0.330.0030.00815.30
7.0.320.0050.00715.08
7.0.310.0090.00415.24
7.0.300.0030.00615.19
7.0.290.0060.00815.36
7.0.280.0090.00715.13
7.0.270.0000.01115.22
7.0.260.0070.00515.19
7.0.250.0020.00815.06
7.0.240.0050.01015.22
7.0.230.0030.01015.37
7.0.220.0070.00615.37
7.0.210.0040.00715.26
7.0.200.0110.00515.09
7.0.190.0070.00515.30
7.0.180.0040.01015.20
7.0.170.0050.01015.40
7.0.160.0090.00515.23
7.0.150.0020.01315.12
7.0.140.0050.03017.50
7.0.130.0070.00715.40
7.0.120.0050.00815.31
7.0.110.0100.00415.25
7.0.100.0070.00715.10
7.0.90.0030.01115.07
7.0.80.0070.00315.35
7.0.70.0080.00815.27
7.0.60.0060.03216.76
7.0.50.0080.02816.24
7.0.40.0050.02815.65
7.0.30.0110.03415.50
7.0.20.0150.02715.45
7.0.10.0120.03015.60
7.0.00.0080.03115.61
5.6.400.0040.00814.62
5.6.390.0070.00414.29
5.6.380.0100.00614.44
5.6.370.0030.00814.47
5.6.360.0050.00714.55
5.6.350.0100.00614.39
5.6.340.0020.00914.42
5.6.330.0090.00514.30
5.6.320.0050.00714.19
5.6.310.0080.00514.61
5.6.300.0030.01214.45
5.6.290.0090.00614.51
5.6.280.0070.02716.59
5.6.270.0030.01014.35
5.6.260.0030.00914.37
5.6.250.0060.00614.29
5.6.240.0100.00414.46
5.6.230.0050.01014.50
5.6.220.0060.00614.66
5.6.210.0080.03016.59
5.6.200.0060.03015.65
5.6.190.0110.02016.38
5.6.180.0130.02016.54
5.6.170.0170.02916.56
5.6.160.0110.02816.44
5.6.150.0060.02015.80
5.6.140.0010.02815.76
5.6.130.0060.01815.54
5.6.120.0040.02116.67
5.6.110.0120.02916.59
5.6.100.0050.03216.69
5.6.90.0010.03816.63
5.6.80.0070.01816.30
5.6.70.0120.03216.31
5.6.60.0070.00414.32
5.6.50.0080.00614.17
5.6.40.0060.00714.43
5.6.30.0040.01114.11
5.6.20.0100.00714.24
5.6.10.0070.00614.19
5.6.00.0050.00814.35
5.5.380.0070.00612.95
5.5.370.0050.00712.91
5.5.360.0080.00312.82
5.5.350.0080.02515.30
5.5.340.0050.01414.54
5.5.330.0030.02015.33
5.5.320.0110.03115.32
5.5.310.0120.01715.18
5.5.300.0040.01514.51
5.5.290.0040.02414.49
5.5.280.0100.02215.38
5.5.270.0030.02915.57
5.5.260.0080.02515.39
5.5.250.0060.02715.32
5.5.240.0040.03115.24
5.5.230.0090.00512.63
5.5.220.0070.00712.51
5.5.210.0060.00412.63
5.5.200.0030.00812.47
5.5.190.0090.00412.52
5.5.180.0050.00512.75
5.5.170.0080.00612.78
5.5.160.0030.00712.70
5.5.150.0020.00812.55
5.5.140.0020.01212.52
5.5.130.0070.00412.51
5.5.120.0050.00712.78
5.5.110.0060.00512.70
5.5.100.0040.00612.83
5.5.90.0050.00412.61
5.5.80.0030.00912.46
5.5.70.0070.00412.49
5.5.60.0070.00812.47
5.5.50.0090.00512.74
5.5.40.0050.00612.64
5.5.30.0050.00812.71
5.5.20.0050.00612.75
5.5.10.0060.00712.27
5.5.00.0070.00512.62
5.4.450.0170.02513.74
5.4.440.0120.03013.76
5.4.430.0100.02413.84
5.4.420.0120.02113.97
5.4.410.0100.03013.83
5.4.400.0150.02713.65
5.4.390.0090.02013.78
5.4.380.0160.02313.80
5.4.370.0120.02713.76
5.4.360.0160.02513.65
5.4.350.0160.02313.72
5.4.340.0100.02313.64
5.4.330.0040.00411.01
5.4.320.0140.02813.72
5.4.310.0120.02013.69
5.4.300.0110.02813.66
5.4.290.0100.03013.61
5.4.280.0170.02013.67
5.4.270.0170.01513.88
5.4.260.0180.02413.84
5.4.250.0090.02013.79
5.4.240.0110.03113.70
5.4.230.0120.02913.82
5.4.220.0200.02113.77
5.4.210.0170.02513.79
5.4.200.0180.02313.82
5.4.190.0160.02013.74
5.4.180.0130.02713.49
5.4.170.0120.02713.70
5.4.160.0110.03013.65
5.4.150.0080.01913.79
5.4.140.0120.02712.82
5.4.130.0150.02212.80
5.4.120.0120.02512.93
5.4.110.0110.02512.92
5.4.100.0210.01712.79
5.4.90.0100.02712.96
5.4.80.0110.02812.79
5.4.70.0120.01412.87
5.4.60.0110.02512.88
5.4.50.0120.02912.76
5.4.40.0100.02412.80
5.4.30.0090.01512.93
5.4.20.0080.02612.88
5.4.10.0130.02712.82
5.4.00.0130.02812.69
5.3.290.0120.02012.05
5.3.280.0070.02011.94
5.3.270.0080.02312.00
5.3.260.0080.01712.04
5.3.250.0060.02011.89
5.3.240.0120.02211.92
5.3.230.0090.02011.92
5.3.220.0090.02511.80
5.3.210.0100.02111.82
5.3.200.0110.01611.70
5.3.190.0070.01811.73
5.3.180.0080.02111.97
5.3.170.0080.01611.93
5.3.160.0090.02511.78
5.3.150.0110.01711.92
5.3.140.0050.02311.93
5.3.130.0110.01411.93
5.3.120.0100.02311.81
5.3.110.0090.02011.77
5.3.100.0080.02111.65
5.3.90.0090.01311.62
5.3.80.0060.01811.57
5.3.70.0130.02311.63
5.3.60.0070.02611.68
5.3.50.0090.01911.65
5.3.40.0080.01911.68
5.3.30.0150.02311.65
5.3.20.0080.01711.57
5.3.10.0090.01611.29
5.3.00.0110.01211.43
5.2.170.0150.01510.67
5.2.160.0130.03110.75
5.2.150.0160.01810.70
5.2.140.0130.03210.72
5.2.130.0080.01710.63
5.2.120.0110.03010.64
5.2.110.0070.02310.63
5.2.100.0100.03310.62
5.2.90.0100.03610.71
5.2.80.0030.02110.71
5.2.70.0050.02210.63
5.2.60.0090.02010.70
5.2.50.0100.01710.59
5.2.40.0120.01910.62
5.2.30.0060.02310.57
5.2.20.0140.02710.58
5.2.10.0130.02310.51
5.2.00.0080.03210.43
5.1.60.0100.02510.07
5.1.50.0100.02510.08
5.1.40.0070.02010.05
5.1.30.0070.03010.33
5.1.20.0090.03010.34
5.1.10.0120.01710.27
5.1.00.0130.02010.11
5.0.50.0030.0159.40
5.0.40.0130.0139.29
5.0.30.0050.0259.31
5.0.20.0030.0159.34
5.0.10.0000.0149.25
5.0.00.0030.0179.28
4.4.90.0030.0098.93
4.4.80.0070.0178.93
4.4.70.0060.0088.93
4.4.60.0060.0168.93
4.4.50.0050.0108.93
4.4.40.0090.0128.93
4.4.30.0090.0168.93
4.4.20.0030.0118.93
4.4.10.0060.0078.93
4.4.00.0080.0258.93
4.3.110.0050.0128.93
4.3.100.0100.0138.93
4.3.90.0050.0108.93
4.3.80.0050.0278.93
4.3.70.0060.0168.93
4.3.60.0050.0108.93
4.3.50.0070.0188.93
4.3.40.0050.0178.93
4.3.30.0040.0208.93
4.3.20.0030.0168.93
4.3.10.0020.0228.93
4.3.00.0040.0148.93

preferences:
57.25 ms | 401 KiB | 5 Q