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() { call_user_func( array( $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.60.0070.01418.55
8.3.50.0100.00917.49
8.3.40.0070.00718.79
8.3.30.0140.00418.80
8.3.20.0050.00318.90
8.3.10.0030.00520.56
8.3.00.0040.00417.75
8.2.180.0110.01117.00
8.2.170.0100.01022.96
8.2.160.0070.01322.09
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.08
8.2.110.0000.01821.12
8.2.100.0060.00617.84
8.2.90.0090.00019.52
8.2.80.0000.00719.33
8.2.70.0000.00917.50
8.2.60.0040.00417.80
8.2.50.0050.00318.07
8.2.40.0030.00520.07
8.2.30.0080.00018.07
8.2.20.0040.00417.74
8.2.10.0040.00417.70
8.2.00.0090.00017.88
8.1.280.0030.01225.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0110.01122.42
8.1.230.0090.00620.97
8.1.220.0040.00417.74
8.1.210.0040.00418.97
8.1.200.0100.00017.35
8.1.190.0000.00817.53
8.1.180.0050.00318.10
8.1.170.0040.00418.90
8.1.160.0060.00318.83
8.1.150.0040.00418.57
8.1.140.0050.00317.46
8.1.130.0000.00717.85
8.1.120.0040.00417.49
8.1.110.0030.00517.39
8.1.100.0000.00717.48
8.1.90.0040.00417.46
8.1.80.0070.00017.49
8.1.70.0070.00017.49
8.1.60.0000.00817.60
8.1.50.0080.00017.50
8.1.40.0030.00617.60
8.1.30.0040.00417.64
8.1.20.0080.00017.57
8.1.10.0000.00717.64
8.1.00.0040.00417.56
8.0.300.0000.00719.96
8.0.290.0030.00616.75
8.0.280.0070.00318.47
8.0.270.0070.00017.28
8.0.260.0030.00318.53
8.0.250.0040.00416.88
8.0.240.0060.00317.02
8.0.230.0070.00017.08
8.0.220.0040.00417.01
8.0.210.0030.00317.00
8.0.200.0000.00717.04
8.0.190.0000.00717.09
8.0.180.0070.00017.06
8.0.170.0000.00816.98
8.0.160.0000.00716.99
8.0.150.0000.00816.98
8.0.140.0090.00316.93
8.0.130.0030.00313.40
8.0.120.0040.00416.91
8.0.110.0030.00716.80
8.0.100.0000.00817.05
8.0.90.0070.00017.10
8.0.80.0100.00616.98
8.0.70.0040.00416.82
8.0.60.0050.00217.02
8.0.50.0000.00717.05
8.0.30.0130.00717.16
8.0.20.0100.00817.26
8.0.10.0000.00816.90
8.0.00.0130.00816.83
7.4.330.0050.00014.88
7.4.320.0030.00316.63
7.4.300.0050.00216.57
7.4.290.0030.00316.67
7.4.280.0030.00516.63
7.4.270.0030.00616.63
7.4.260.0000.00513.19
7.4.250.0000.00716.46
7.4.240.0030.00316.67
7.4.230.0000.00916.72
7.4.220.0070.01016.72
7.4.210.0080.00616.63
7.4.200.0000.00716.43
7.4.190.0070.00016.71
7.4.160.0100.00716.38
7.4.150.0110.01417.07
7.4.140.0110.00817.23
7.4.130.0100.00716.67
7.4.120.0100.00716.55
7.4.110.0020.01516.50
7.4.100.0100.01016.33
7.4.90.0030.01316.46
7.4.80.0150.00618.80
7.4.70.0120.00916.46
7.4.60.0040.01316.52
7.4.50.0000.00916.36
7.4.40.0060.01122.26
7.4.30.0040.01216.53
7.4.00.0030.01314.80
7.3.330.0030.00313.46
7.3.320.0030.00313.38
7.3.310.0000.00716.42
7.3.300.0000.00716.32
7.3.290.0100.01016.40
7.3.280.0040.01216.44
7.3.270.0120.01217.07
7.3.260.0110.00618.24
7.3.250.0110.00916.38
7.3.240.0060.01216.43
7.3.230.0140.00416.59
7.3.210.0130.01016.38
7.3.200.0110.01119.39
7.3.190.0120.01216.55
7.3.180.0090.00716.70
7.3.170.0150.00016.51
7.3.160.0160.00016.58
7.3.120.0100.00314.72
7.2.330.0120.01316.52
7.2.320.0160.00716.66
7.2.310.0110.00716.56
7.2.300.0060.01116.51
7.2.290.0090.00916.77
7.2.00.0060.00619.24
7.1.200.0070.00715.81
7.1.100.0030.01418.07
7.1.70.0070.00717.30
7.1.60.0110.01519.40
7.1.50.0070.01017.13
7.1.00.0070.06022.30
7.0.200.0060.00316.63
7.0.140.0030.05022.04
7.0.120.0030.03022.02
7.0.60.0030.05319.94
7.0.50.0030.06317.74
7.0.40.0070.04320.24
7.0.30.0330.05320.23
7.0.20.0400.07020.32
7.0.10.0370.05020.07
7.0.00.0100.07320.20
5.6.280.0000.08021.00
5.6.210.0100.04320.71
5.6.200.0030.06718.15
5.6.190.0230.03720.68
5.6.180.0300.07720.50
5.6.170.0270.07320.71
5.6.160.0070.07320.55
5.6.150.0130.07018.21
5.6.140.0070.04718.28
5.6.130.0030.04318.23
5.6.120.0000.04320.98
5.6.110.0170.07721.01
5.6.100.0100.06321.05
5.6.90.0100.08721.00
5.6.80.0170.06020.41
5.6.70.0230.08020.55
5.5.350.0170.08020.35
5.5.340.0130.04317.95
5.5.330.0000.06020.32
5.5.320.0200.08020.32
5.5.310.0300.06020.50
5.5.300.0000.04317.97
5.5.290.0030.07017.95
5.5.280.0100.08020.98
5.5.270.0130.04720.88
5.5.260.0030.07720.78
5.5.250.0030.07020.48
5.5.240.0070.07720.17
5.4.450.0030.05319.18
5.4.440.0070.05319.20
5.4.430.0030.06319.32
5.4.420.0100.06019.33
5.4.410.0070.03719.40
5.4.400.0030.06719.15
5.4.390.0070.03719.12
5.4.380.0100.05019.12
5.4.370.0030.08018.85
5.4.360.0030.07719.15
5.4.350.0070.05718.85
5.4.340.0130.07019.14
5.4.320.0030.08319.20
5.4.310.0100.07318.87
5.4.300.0130.06319.12
5.4.290.0070.03718.87
5.4.280.0030.04019.24
5.4.270.0070.07018.84
5.4.260.0030.04018.87
5.4.250.0030.05319.15
5.4.240.0070.07319.14
5.4.230.0030.06018.91
5.4.220.0070.04719.23
5.4.210.0070.05718.84
5.4.200.0000.08019.14
5.4.190.0070.05319.13
5.4.180.0030.08018.91
5.4.170.0030.08019.23
5.4.160.0100.06718.83
5.4.150.0030.06719.13
5.4.140.0070.07716.36
5.4.130.0070.04316.42
5.4.120.0130.06716.46
5.4.110.0170.06716.36
5.4.100.0030.03716.36
5.4.90.0000.04716.38
5.4.80.0100.06016.53
5.4.70.0030.07316.40
5.4.60.0130.06716.40
5.4.50.0130.06716.38
5.4.40.0070.06316.43
5.4.30.0100.03316.40
5.4.20.0000.07316.39
5.4.10.0070.07016.27
5.4.00.0130.03315.77
5.3.290.0000.06314.70
5.3.280.0000.05714.76
5.3.270.0070.07714.68
5.3.260.0070.07314.62
5.3.250.0030.04714.61
5.3.240.0000.07714.69
5.3.230.0130.07314.64
5.3.220.0030.03714.66
5.3.210.0100.03314.66
5.3.200.0070.03314.63
5.3.190.0000.08314.64
5.3.180.0100.04014.63
5.3.170.0030.07314.61
5.3.160.0030.08014.46
5.3.150.0030.04714.57
5.3.140.0030.06014.73
5.3.130.0070.04314.61
5.3.120.0100.07314.71
5.3.110.0070.07314.56
5.3.100.0030.04314.10
5.3.90.0070.04014.04
5.3.80.0130.05714.04
5.3.70.0100.04313.96
5.3.60.0100.07713.95
5.3.50.0030.05313.93
5.3.40.0130.07014.13
5.3.30.0070.06013.94
5.3.20.0070.03713.63
5.3.10.0100.03013.73
5.3.00.0070.03313.73
5.2.170.0030.05711.19
5.2.160.0070.05311.32
5.2.150.0100.05711.24
5.2.140.0030.06311.22
5.2.130.0000.05311.05
5.2.120.0000.04011.13
5.2.110.0070.02311.07
5.2.100.0070.03011.15
5.2.90.0070.03311.11
5.2.80.0070.03011.17
5.2.70.0070.04011.12
5.2.60.0030.06311.07
5.2.50.0030.04011.05
5.2.40.0030.04311.16
5.2.30.0000.03311.14
5.2.20.0000.03711.14
5.2.10.0030.06010.84
5.2.00.0030.06010.73
5.1.60.0070.03710.08
5.1.50.0030.0539.99
5.1.40.0030.05310.02
5.1.30.0100.04010.52
5.1.20.0070.04310.42
5.1.10.0100.03310.00
5.1.00.0030.06310.14
5.0.50.0000.0378.59
5.0.40.0030.0338.57
5.0.30.0030.0378.57
5.0.20.0000.0378.57
5.0.10.0000.0278.57
5.0.00.0070.0338.57
4.4.90.0000.0308.57
4.4.80.0000.0278.57
4.4.70.0070.0378.57
4.4.60.0030.0338.57
4.4.50.0000.0178.57
4.4.40.0000.0338.57
4.4.30.0000.0338.57
4.4.20.0030.0308.57
4.4.10.0000.0378.57
4.4.00.0000.0608.57
4.3.110.0030.0338.57
4.3.100.0100.0238.57
4.3.90.0000.0238.57
4.3.80.0030.0508.57
4.3.70.0070.0338.57
4.3.60.0030.0338.57
4.3.50.0070.0208.57
4.3.40.0000.0378.57
4.3.30.0000.0238.57
4.3.20.0000.0308.57
4.3.10.0000.0238.57
4.3.00.0000.0338.57

preferences:
44.33 ms | 401 KiB | 5 Q