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 var_dump($v);die; var_dump($v());die; $value = $v(); // and a callback! $this->{$key} = $value; } } $test = new Test; // start editing here class A implements ArrayAccess { private $callCount = 0; public function __call($name, $args){ echo "WOOO";die; } public function offsetSet($offset, $value) {} public function offsetExists($offset) { return true; } public function offsetUnset($offset) {} public function offsetGet($offset) { $this->callCount++; if ($this->callCount == 1){ $r = $this; } else { $r = "FOO"; } return $r; } } $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.60.0110.01118.43
8.3.50.0190.00921.27
8.3.40.0080.00818.96
8.3.30.0070.00720.21
8.3.20.0040.00420.34
8.3.10.0040.00421.95
8.3.00.0030.00522.39
8.2.180.0070.00718.54
8.2.170.0000.01522.96
8.2.160.0030.01220.46
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0070.00019.66
8.2.110.0000.00919.29
8.2.100.0070.00417.91
8.2.90.0040.00419.30
8.2.80.0000.00817.97
8.2.70.0050.00517.63
8.2.60.0030.00618.03
8.2.50.0060.00318.07
8.2.40.0030.00518.22
8.2.30.0040.00418.15
8.2.20.0050.00317.66
8.2.10.0040.00417.82
8.2.00.0000.00817.81
8.1.280.0110.00725.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00022.73
8.1.230.0110.00017.58
8.1.220.0060.00317.77
8.1.210.0060.00318.77
8.1.200.0030.00717.38
8.1.190.0000.00917.22
8.1.180.0080.00020.20
8.1.170.0000.00818.64
8.1.160.0000.00722.16
8.1.150.0080.00018.68
8.1.140.0050.00317.48
8.1.130.0000.00917.81
8.1.120.0000.00817.48
8.1.110.0000.00717.47
8.1.100.0020.00517.49
8.1.90.0040.00417.41
8.1.80.0080.00017.49
8.1.70.0030.00317.36
8.1.60.0040.00417.61
8.1.50.0000.00717.45
8.1.40.0000.00917.50
8.1.30.0000.00817.65
8.1.20.0040.00417.65
8.1.10.0050.00217.58
8.1.00.0070.00317.49
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.46
8.0.270.0040.00417.29
8.0.260.0000.00716.95
8.0.250.0000.00717.03
8.0.240.0030.00817.06
8.0.230.0030.00317.08
8.0.220.0030.00316.95
8.0.210.0030.00316.98
8.0.200.0030.00316.91
8.0.190.0060.00316.99
8.0.180.0000.00717.01
8.0.170.0050.00316.90
8.0.160.0050.00217.01
8.0.150.0000.00716.82
8.0.140.0070.00016.90
8.0.130.0000.00613.49
8.0.120.0060.00316.91
8.0.110.0080.00016.87
8.0.100.0000.00717.01
8.0.90.0040.00416.76
8.0.80.0090.00617.02
8.0.70.0040.00416.99
8.0.60.0000.00716.88
8.0.50.0000.00716.93
8.0.30.0050.01317.13
8.0.20.0120.00717.40
8.0.10.0030.00516.97
8.0.00.0110.00916.77
7.4.330.0000.00615.00
7.4.320.0060.00016.66
7.4.300.0030.00316.58
7.4.290.0000.00816.63
7.4.280.0000.00816.52
7.4.270.0040.00416.63
7.4.260.0030.00316.65
7.4.250.0000.00816.59
7.4.240.0020.00516.65
7.4.230.0000.00716.42
7.4.220.0030.01416.65
7.4.210.0070.00816.59
7.4.200.0040.00416.72
7.4.190.0070.00016.73
7.4.160.0060.01216.70
7.4.150.0200.00417.40
7.4.140.0080.01017.86
7.4.130.0060.01116.45
7.4.120.0020.01516.60
7.4.110.0140.00316.46
7.4.100.0140.00316.68
7.4.90.0060.01116.62
7.4.80.0100.00619.39
7.4.70.0150.00316.72
7.4.60.0080.00816.48
7.4.50.0060.00316.35
7.4.40.0070.01022.77
7.4.30.0060.01616.43
7.4.00.0070.01015.27
7.3.330.0050.00013.52
7.3.320.0030.00313.24
7.3.310.0000.00716.33
7.3.300.0000.00716.38
7.3.290.0060.01116.45
7.3.280.0110.00616.35
7.3.270.0150.00917.40
7.3.260.0140.00316.37
7.3.250.0120.00916.35
7.3.240.0090.00916.49
7.3.230.0070.01016.47
7.3.210.0170.00016.48
7.3.200.0110.00419.39
7.3.190.0110.00616.42
7.3.180.0090.00616.49
7.3.170.0140.00316.50
7.3.160.0050.01116.51
7.3.120.0060.00614.94
7.2.330.0130.00516.81
7.2.320.0090.00916.79
7.2.310.0100.01016.66
7.2.300.0110.00516.76
7.2.290.0120.00416.77
7.2.60.0070.00717.02
7.2.00.0040.01119.24
7.1.200.0000.00715.56
7.1.100.0040.00817.92
7.1.70.0030.00617.00
7.1.60.0030.02219.21
7.1.50.0000.02116.89
7.1.00.0000.03722.34
7.0.200.0230.01014.54
7.0.140.0030.07022.07
7.0.60.0070.08719.86
7.0.50.0000.08317.89
7.0.40.0070.08020.26
7.0.30.0370.03720.23
7.0.20.0430.06720.09
7.0.10.0030.05720.19
7.0.00.0130.07720.15
5.6.280.0030.07320.93
5.6.210.0030.08020.73
5.6.200.0070.06018.15
5.6.190.0030.05320.33
5.6.180.0330.06720.66
5.6.170.0230.08320.45
5.6.160.0070.04320.48
5.6.150.0100.07718.22
5.6.140.0030.04018.13
5.6.130.0030.05718.15
5.6.120.0030.04020.97
5.6.110.0170.08720.99
5.6.100.0070.08721.00
5.6.90.0200.04721.11
5.6.80.0030.07320.40
5.5.350.0270.08020.46
5.5.340.0000.07318.07
5.5.330.0170.07720.58
5.5.320.0030.04720.28
5.5.310.0330.07020.23
5.5.300.0070.07318.01
5.5.290.0000.04317.97
5.5.280.0070.08720.86
5.5.270.0170.05320.90
5.5.260.0100.06720.80
5.5.250.0100.07020.62
5.5.240.0100.06720.20
5.4.450.3400.04019.17
5.4.440.3100.03719.32
5.4.430.3970.03719.48
5.4.420.3370.04019.63
5.4.410.3470.03319.41
5.4.400.3000.03719.05
5.4.390.3270.04019.16
5.4.380.3330.04019.04
5.4.370.3370.04019.14
5.4.360.3430.03719.31
5.4.350.3070.03719.14
5.4.340.3130.03719.25
5.4.320.3300.04319.22
5.4.310.3370.03719.18
5.4.300.3130.03318.95
5.4.290.3270.03719.09
5.4.280.3230.03718.94
5.4.270.3430.03719.09
5.4.260.3470.03319.30
5.4.250.0630.04718.82
5.4.240.0070.07318.83
5.4.230.0070.07019.16
5.4.220.0300.06719.08
5.4.210.3570.03019.07
5.4.200.3470.03718.99
5.4.190.3570.03019.12
5.4.180.3800.03318.83
5.4.170.3870.03719.15
5.4.160.3500.03319.11
5.4.150.3700.05019.22
5.4.140.3400.04016.48
5.4.130.3430.03316.33
5.4.120.2930.03716.35
5.4.110.3530.04316.24
5.4.100.3670.02716.40
5.4.90.3630.04316.46
5.4.80.3400.04016.44
5.4.70.3400.03716.50
5.4.60.3170.03716.44
5.4.50.3200.03316.33
5.4.40.3300.03316.38
5.4.30.3370.03316.37
5.4.20.3300.04016.55
5.4.10.3470.03316.43
5.4.00.3130.03015.82
5.3.290.3370.04314.74
5.3.280.3470.03714.70
5.3.270.3500.04314.55
5.3.260.3400.04014.62
5.3.250.3200.03314.61
5.3.240.3130.03314.71
5.3.230.3230.04014.54
5.3.220.3200.02714.48
5.3.210.3400.04014.63
5.3.200.3270.03014.55
5.3.190.3170.03314.80
5.3.180.3630.03714.63
5.3.170.3100.04714.72
5.3.160.3370.04014.58
5.3.150.3300.04314.48
5.3.140.3370.03314.68
5.3.130.3500.04014.48
5.3.120.2930.03714.55
5.3.110.3130.03014.71
5.3.100.3100.03313.98
5.3.90.3100.04714.14
5.3.80.3570.04014.09
5.3.70.3200.03714.12
5.3.60.3570.04013.95
5.3.50.3200.03713.87
5.3.40.3300.04014.19
5.3.30.3270.04714.07
5.3.20.3170.02713.64
5.3.10.3200.03013.60
5.3.00.3400.03713.66
5.2.170.2600.03011.48
5.2.160.2330.02711.48
5.2.150.2730.02711.48
5.2.140.2470.04011.48
5.2.130.2570.03011.48
5.2.120.2530.02711.48
5.2.110.2530.02711.48
5.2.100.2530.03011.48
5.2.90.2700.02711.48
5.2.80.2600.02711.48
5.2.70.2370.02711.48
5.2.60.2770.03311.48
5.2.50.2800.03311.48
5.2.40.2300.03011.48
5.2.30.2330.03311.48
5.2.20.2430.02711.48
5.2.10.2330.02711.48
5.2.00.2370.02311.48
5.1.60.2330.03011.48
5.1.50.2330.02011.48
5.1.40.2100.02311.48
5.1.30.2400.03011.48
5.1.20.2370.02711.48
5.1.10.2100.02311.48
5.1.00.2070.02011.48
5.0.50.1330.02711.48
5.0.40.1270.02711.48
5.0.30.1170.03311.48
5.0.20.1100.02311.48
5.0.10.1070.02011.48
5.0.00.1230.03711.48
4.4.90.1100.01011.48
4.4.80.1230.01711.48
4.4.70.1230.02311.48
4.4.60.1200.01711.48
4.4.50.1070.01311.48
4.4.40.1300.03011.48
4.4.30.1270.02011.48
4.4.20.1170.02011.48
4.4.10.1270.02011.48
4.4.00.1000.02711.48
4.3.110.1230.01311.48
4.3.100.1300.02011.48
4.3.90.1070.01711.48
4.3.80.1270.02711.48
4.3.70.1070.01711.48
4.3.60.1230.01711.48
4.3.50.1300.01311.48
4.3.40.1130.02711.48
4.3.30.0530.01711.48
4.3.20.0600.01711.48
4.3.10.0630.02011.48
4.3.00.0470.01711.48

preferences:
46.02 ms | 401 KiB | 5 Q