3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Intercept { protected $class = null; protected $callback = null; public function __construct($class, $callback = null) { $this->class = new $class(); $this->callback = $callback; } protected function run_callback() { ${$this->callback}(); } public function __get($name) { $this->run_callback(); return $this->class->$name; } public function __set($name, $value) { $this->run_callback(); return $this->class->$name = $value; } public function __isset($name) { $this->run_callback(); return isset($this->class->$name); } public function __unset($name) { $this->run_callback(); unset($this->class->$name); } public function __call($method, $args) { $this->run_callback(); return call_user_func_array(array($this->class, $method), $args); } public function __toString() { $this->run_callback(); return $this->class; } public function __invoke() { $this->run_callback(); return $this->class(); } } class test { public function hello() { return 'world'; } } $closure = function() { echo 123; }; $test=new Intercept('test', $closure); echo $test->hello();

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.40.0090.00618.97
8.3.30.0040.01119.21
8.3.20.0040.00420.28
8.3.10.0030.00523.52
8.3.00.0040.00420.57
8.2.170.0180.00022.96
8.2.160.0070.00722.17
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.36
8.2.110.0060.00322.01
8.2.100.0060.00617.72
8.2.90.0000.00919.23
8.2.80.0000.00818.16
8.2.70.0090.00017.50
8.2.60.0030.00517.92
8.2.50.0030.00618.07
8.2.40.0000.00818.28
8.2.30.0080.00018.09
8.2.20.0000.00817.80
8.2.10.0060.00317.75
8.2.00.0050.00319.50
8.1.270.0030.00623.97
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0070.00423.62
8.1.230.0040.00719.21
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0030.00617.48
8.1.190.0050.00317.52
8.1.180.0040.00418.10
8.1.170.0000.00818.50
8.1.160.0070.00022.07
8.1.150.0030.00618.57
8.1.140.0050.00217.53
8.1.130.0040.00417.75
8.1.120.0000.00717.52
8.1.110.0070.00017.48
8.1.100.0000.00717.40
8.1.90.0030.00517.55
8.1.80.0040.00417.48
8.1.70.0030.00517.43
8.1.60.0040.00417.46
8.1.50.0000.00917.55
8.1.40.0040.00417.48
8.1.30.0040.00417.67
8.1.20.0000.00717.60
8.1.10.0030.00517.63
8.1.00.0030.00617.41
8.0.300.0070.00018.77
8.0.290.0000.00716.93
8.0.280.0070.00018.46
8.0.270.0080.00017.27
8.0.260.0070.00316.84
8.0.250.0050.00217.09
8.0.240.0030.00516.94
8.0.230.0070.00017.05
8.0.220.0000.00816.91
8.0.210.0000.00716.86
8.0.200.0000.00717.03
8.0.190.0040.00416.99
8.0.180.0070.00017.03
8.0.170.0030.00517.04
8.0.160.0070.00016.95
8.0.150.0000.00816.92
8.0.140.0000.00716.81
8.0.130.0000.00713.33
8.0.120.0040.00416.93
8.0.110.0050.00216.86
8.0.100.0000.00816.75
8.0.90.0000.00817.04
8.0.80.0130.00316.91
8.0.70.0040.00416.93
8.0.60.0050.00317.04
8.0.50.0020.00517.04
8.0.30.0100.01017.06
8.0.20.0140.00517.40
8.0.10.0070.00016.89
8.0.00.0110.00616.96
7.4.330.0060.00015.02
7.4.320.0030.00316.52
7.4.300.0030.00316.58
7.4.290.0030.00316.57
7.4.280.0050.00316.43
7.4.270.0040.00416.66
7.4.260.0070.00016.50
7.4.250.0000.00716.61
7.4.240.0020.00516.53
7.4.230.0070.00016.73
7.4.220.0070.01016.63
7.4.210.0060.01116.54
7.4.200.0030.00316.69
7.4.190.0050.00216.75
7.4.160.0120.00316.48
7.4.150.0100.00717.40
7.4.140.0130.02317.86
7.4.130.0090.00916.64
7.4.120.0110.00616.41
7.4.110.0100.01416.38
7.4.100.0070.01016.57
7.4.90.0120.00916.57
7.4.80.0040.01916.41
7.4.70.0070.01416.57
7.4.60.0130.00316.45
7.4.50.0080.00016.51
7.4.40.0070.01022.77
7.4.30.0120.00416.52
7.4.00.0040.01215.10
7.3.330.0000.00513.25
7.3.320.0000.00613.30
7.3.310.0000.00716.46
7.3.300.0020.00516.44
7.3.290.0090.00516.47
7.3.280.0090.00816.44
7.3.270.0110.01117.40
7.3.260.0160.01016.46
7.3.250.0100.00716.54
7.3.240.0060.01216.52
7.3.230.0030.01316.61
7.3.210.0080.00816.64
7.3.200.0140.00319.39
7.3.190.0130.00316.43
7.3.180.0080.00816.56
7.3.170.0030.01216.44
7.3.160.0110.01116.35
7.3.120.0070.01014.97
7.3.110.0100.00814.93
7.3.100.0060.00814.78
7.3.90.0110.00514.64
7.3.80.0100.00515.01
7.3.70.0050.01214.87
7.3.60.0040.00915.01
7.3.50.0080.00814.81
7.3.40.0030.00914.96
7.3.30.0050.00714.78
7.3.20.0080.00916.67
7.3.10.0080.01016.68
7.3.00.0130.00216.74
7.2.330.0130.00316.87
7.2.320.0140.00316.69
7.2.310.0140.00416.71
7.2.300.0070.01016.48
7.2.290.0160.00016.46
7.2.250.0030.01215.19
7.2.240.0070.01014.84
7.2.230.0070.01015.14
7.2.220.0050.01015.03
7.2.210.0050.01115.03
7.2.200.0050.00915.03
7.2.190.0050.00915.11
7.2.180.0080.00815.04
7.2.170.0050.01214.96
7.2.60.0070.00716.68
7.2.00.0000.01519.13
7.1.330.0040.00915.78
7.1.320.0010.01315.79
7.1.310.0020.01415.72
7.1.300.0070.00715.75
7.1.290.0070.00515.78
7.1.280.0120.00315.71
7.1.270.0060.00815.81
7.1.260.0050.00715.77
7.1.200.0030.00615.94
7.1.70.0050.00517.26
7.1.60.0070.00417.27
7.1.50.0260.01034.92
7.1.00.0030.07722.36
7.0.200.0000.00916.87
7.0.140.0030.07022.01
7.0.100.0100.07719.90
7.0.90.0000.08319.96
7.0.80.0030.08320.04
7.0.70.0270.08020.00
7.0.60.0200.05720.02
7.0.50.0300.08020.38
7.0.40.0070.09020.18
7.0.30.0100.04720.11
7.0.20.0170.07020.04
7.0.10.0030.09020.10
7.0.00.0130.04020.04
5.6.280.0100.06721.08
5.6.250.0070.04020.54
5.6.240.0030.07320.55
5.6.230.0100.08320.73
5.6.220.0030.07720.75
5.6.210.0070.04720.68
5.6.200.0100.08021.04
5.6.190.0070.04721.12
5.6.180.0130.04021.09
5.6.170.0070.08721.10
5.6.160.0030.04720.92
5.6.150.0030.07721.07
5.6.140.0070.09020.96
5.6.130.0030.09021.04
5.6.120.0170.07320.99
5.6.110.0130.08321.08
5.6.100.0130.05021.02
5.6.90.0030.05321.04
5.6.80.0100.04720.45
5.6.70.0070.08320.47
5.6.60.0030.04720.52
5.6.50.0130.05320.36
5.6.40.0000.07720.25
5.6.30.0130.07020.44
5.6.20.0370.02020.39
5.6.10.0070.03720.38
5.6.00.0030.08020.53
5.5.380.0100.05020.38
5.5.370.0100.04720.45
5.5.360.0070.04720.52
5.5.350.0100.08020.43
5.5.340.0100.03720.91
5.5.330.0130.07320.91
5.5.320.0100.06720.90
5.5.310.0200.07020.89
5.5.300.0070.04020.94
5.5.290.0070.05720.78
5.5.280.0070.04720.75
5.5.270.0130.06020.93
5.5.260.0030.09020.92
5.5.250.0170.06720.73
5.5.240.0130.07320.28
5.5.230.0070.07020.32
5.5.220.0070.05320.28
5.5.210.0170.06020.31
5.5.200.0100.07720.17
5.5.190.0000.08020.14
5.5.180.0130.07020.25
5.5.160.0030.05020.25
5.5.150.0030.06320.25
5.5.140.0100.07320.28
5.5.130.0030.04020.00
5.5.120.0000.04320.19
5.5.110.0070.08320.22
5.5.100.0170.04320.00
5.5.90.0130.07319.99
5.5.80.0070.07320.16
5.5.70.0000.07020.11
5.5.60.0100.07320.13
5.5.50.0030.07320.02
5.5.40.0130.06720.07
5.5.30.0030.08019.94
5.5.20.0070.07320.13
5.5.10.0030.08020.10
5.5.00.0070.08020.07
5.4.450.0000.05019.49
5.4.440.0000.05019.54
5.4.430.0030.06719.48
5.4.420.0070.07319.35
5.4.410.0130.07319.30
5.4.400.0100.07319.14
5.4.390.0030.07018.87
5.4.380.0030.08019.23
5.4.370.0070.07018.85
5.4.360.0170.07019.12
5.4.350.0030.07719.03
5.4.340.0100.08019.13
5.4.320.0070.08019.13
5.4.310.0070.07019.05
5.4.300.0100.07319.09
5.4.290.0100.07718.95
5.4.280.0100.06719.13
5.4.270.0100.04319.12
5.4.260.0000.06719.16
5.4.250.0030.03719.12
5.4.240.0130.07019.15
5.4.230.0100.07318.84
5.4.220.0070.07719.12
5.4.210.0130.06319.03
5.4.200.0100.06719.11
5.4.190.0070.05018.93
5.4.180.0200.03318.94
5.4.170.0100.07319.12
5.4.160.0070.04318.89
5.4.150.0100.04319.07
5.4.140.0030.06316.48
5.4.130.0000.04716.45
5.4.120.0030.07316.38
5.4.110.0100.07016.45
5.4.100.0100.06716.55
5.4.90.0100.07016.52
5.4.80.0130.03716.31
5.4.70.0130.06316.55
5.4.60.0070.06316.47
5.4.50.0100.08016.41
5.4.40.0070.05316.51
5.4.30.0070.07316.45
5.4.20.0170.06316.46
5.4.10.0030.07316.44
5.4.00.0000.06015.89
5.3.290.0000.05014.71
5.3.280.0030.06314.61
5.3.270.0070.07014.59
5.3.260.0070.03714.65
5.3.250.0070.07714.71
5.3.240.0000.04714.55
5.3.230.0030.07714.59
5.3.220.0070.06014.68
5.3.210.0100.04014.56
5.3.200.0100.05314.65
5.3.190.0070.04314.55
5.3.180.0130.03014.57
5.3.170.0100.07714.67
5.3.160.0070.08014.63
5.3.150.0070.05314.67
5.3.140.0030.07014.50
5.3.130.0070.07314.58
5.3.120.0070.06714.71
5.3.110.0030.05014.53
5.3.100.0100.04013.98
5.3.90.0030.07013.96
5.3.80.0030.07314.10
5.3.70.0070.04314.14
5.3.60.0030.06314.00
5.3.50.0100.06713.98
5.3.40.0070.06713.97
5.3.30.0170.05713.97
5.3.20.0030.05013.73
5.3.10.0030.04713.58
5.3.00.0100.06013.71
5.2.170.0070.06711.09
5.2.160.0030.06311.05
5.2.150.0130.03011.15
5.2.140.0070.05311.26
5.2.130.0100.03011.05
5.2.120.0030.03311.17
5.2.110.0030.05311.12
5.2.100.0030.03711.05
5.2.90.0070.05311.18
5.2.80.0100.04711.21
5.2.70.0070.04011.23
5.2.60.0000.03711.00
5.2.50.0000.03711.19
5.2.40.0100.03010.93
5.2.30.0000.03711.13
5.2.20.0070.02311.04
5.2.10.0000.03310.78
5.2.00.0070.02310.75
5.1.60.0000.03010.00
5.1.50.0030.02310.11
5.1.40.0030.02710.10
5.1.30.0030.02310.36
5.1.20.0070.02010.50
5.1.10.0070.02010.13
5.1.00.0070.02010.20
5.0.50.0000.0208.56
5.0.40.0000.0208.32
5.0.30.0030.0338.34
5.0.20.0000.0178.26
5.0.10.0000.0238.18
5.0.00.0030.0278.26
4.4.90.0070.0138.15
4.4.80.0000.0178.15
4.4.70.0000.0178.15
4.4.60.0030.0138.15
4.4.50.0030.0138.15
4.4.40.0000.0238.15
4.4.30.0000.0138.15
4.4.20.0000.0178.15
4.4.10.0070.0108.15
4.4.00.0000.0208.15
4.3.110.0000.0178.15
4.3.100.0030.0108.15
4.3.90.0000.0208.15
4.3.80.0030.0508.15
4.3.70.0030.0308.15
4.3.60.0000.0178.15
4.3.50.0030.0108.15
4.3.40.0070.0178.15
4.3.30.0030.0138.15
4.3.20.0000.0138.15
4.3.10.0000.0138.15
4.3.00.0000.0178.15

preferences:
42.22 ms | 400 KiB | 5 Q