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.0040.01118.98
8.3.30.0040.01118.79
8.3.20.0060.00318.86
8.3.10.0000.00920.66
8.3.00.0000.00821.90
8.2.170.0090.00622.96
8.2.160.0110.00320.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0110.00419.48
8.2.110.0110.00721.08
8.2.100.0040.00817.84
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0000.00817.93
8.2.50.0080.00018.07
8.2.40.0050.00318.22
8.2.30.0080.00318.12
8.2.20.0000.00817.74
8.2.10.0050.00317.85
8.2.00.0060.00317.64
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00621.24
8.1.230.0040.00817.42
8.1.220.0040.00417.76
8.1.210.0040.00418.77
8.1.200.0090.00017.36
8.1.190.0000.00917.23
8.1.180.0000.00818.10
8.1.170.0040.00418.75
8.1.160.0040.00418.82
8.1.150.0030.00518.73
8.1.140.0040.00417.47
8.1.130.0030.00317.77
8.1.120.0040.00417.53
8.1.110.0000.00717.34
8.1.100.0000.00717.48
8.1.90.0030.00517.46
8.1.80.0030.00317.45
8.1.70.0040.00417.44
8.1.60.0040.00417.51
8.1.50.0030.00617.44
8.1.40.0070.00017.43
8.1.30.0060.00317.53
8.1.20.0040.00417.57
8.1.10.0040.00417.59
8.1.00.0040.00417.42
8.0.300.0000.00718.77
8.0.290.0030.00516.75
8.0.280.0030.00318.47
8.0.270.0000.00717.27
8.0.260.0080.00016.90
8.0.250.0040.00317.10
8.0.240.0090.00017.05
8.0.230.0040.00416.99
8.0.220.0070.00017.04
8.0.210.0070.00017.00
8.0.200.0030.00316.87
8.0.190.0040.00417.00
8.0.180.0000.00816.88
8.0.170.0040.00416.92
8.0.160.0080.00417.09
8.0.150.0030.00616.86
8.0.140.0070.00016.99
8.0.130.0030.00313.45
8.0.120.0000.00716.82
8.0.110.0000.00817.03
8.0.100.0000.00716.93
8.0.90.0050.00316.85
8.0.80.0060.00916.95
8.0.70.0000.00816.95
8.0.60.0070.00016.88
8.0.50.0000.00717.02
8.0.30.0130.00617.37
8.0.20.0060.01217.40
8.0.10.0040.00417.17
8.0.00.0100.00816.71
7.4.330.0060.00013.43
7.4.320.0060.00016.63
7.4.300.0030.00316.63
7.4.290.0000.00816.55
7.4.280.0070.00016.52
7.4.270.0030.00316.54
7.4.260.0000.00613.22
7.4.250.0040.00416.50
7.4.240.0000.00716.60
7.4.230.0030.00316.55
7.4.220.0120.00916.71
7.4.210.0080.00716.57
7.4.200.0000.00716.64
7.4.190.0000.00716.71
7.4.160.0110.00516.64
7.4.150.0090.00917.40
7.4.140.0100.00717.86
7.4.130.0080.01116.46
7.4.120.0090.00916.69
7.4.110.0070.01116.52
7.4.100.0160.00916.56
7.4.90.0070.01616.74
7.4.80.0180.00419.04
7.4.70.0060.01316.45
7.4.60.0110.00716.55
7.4.50.0030.00616.51
7.4.40.0000.01922.27
7.4.30.0160.00016.58
7.4.00.0060.01014.82
7.3.330.0000.00513.52
7.3.320.0040.00413.40
7.3.310.0000.00816.44
7.3.300.0020.00516.32
7.3.290.0070.00716.46
7.3.280.0110.00616.46
7.3.270.0070.01117.40
7.3.260.0100.01018.24
7.3.250.0090.01116.44
7.3.240.0140.00616.51
7.3.230.0160.00016.66
7.3.210.0080.00816.46
7.3.200.0210.00019.39
7.3.190.0140.00316.51
7.3.180.0080.00816.66
7.3.170.0040.01316.48
7.3.160.0040.01216.43
7.3.120.0030.01015.05
7.3.110.0100.00715.02
7.3.100.0100.00314.60
7.3.90.0120.00414.62
7.3.80.0060.00914.71
7.3.70.0000.00914.56
7.3.60.0080.00814.81
7.3.50.0000.01214.78
7.3.40.0080.00814.74
7.3.30.0030.01214.89
7.3.20.0070.00716.72
7.3.10.0030.01316.49
7.3.00.0040.00816.77
7.2.330.0150.00916.74
7.2.320.0090.01316.67
7.2.310.0120.00616.68
7.2.300.0070.01016.45
7.2.290.0060.01616.67
7.2.250.0030.01015.26
7.2.240.0000.01515.04
7.2.230.0100.00714.91
7.2.220.0030.01415.25
7.2.210.0070.01015.12
7.2.200.0030.00815.04
7.2.190.0030.01315.10
7.2.180.0030.01215.14
7.2.170.0060.00915.03
7.2.80.0090.00316.42
7.2.60.0060.00916.96
7.2.00.0070.00719.42
7.1.330.0000.01315.70
7.1.320.0040.00715.85
7.1.310.0100.00315.95
7.1.300.0030.01015.61
7.1.290.0080.00415.78
7.1.280.0040.01115.51
7.1.270.0150.00315.66
7.1.260.0070.00716.02
7.1.200.0070.00715.71
7.1.100.0000.01117.95
7.1.70.0070.00316.97
7.1.60.0100.01419.40
7.1.50.0100.01317.05
7.1.00.0000.06322.48
7.0.200.0030.01016.80
7.0.140.0000.07722.04
7.0.60.0070.08319.93
7.0.50.0070.07017.98
7.0.40.0070.04319.96
7.0.30.0030.05320.46
7.0.20.0370.07320.12
7.0.10.0300.05720.07
7.0.00.0130.08320.19
5.6.280.0070.06321.03
5.6.210.0130.05320.54
5.6.200.0100.07318.27
5.6.190.0030.05320.49
5.6.180.0270.03720.55
5.6.170.0200.04020.56
5.6.160.0070.04020.45
5.6.150.0130.06718.27
5.6.140.0000.04318.15
5.6.130.0000.08018.16
5.6.120.0070.08721.00
5.6.110.0030.08721.02
5.6.100.0070.07320.90
5.6.90.0100.06021.00
5.6.80.0200.07320.30
5.5.350.4130.04020.54
5.5.340.0170.06017.96
5.5.330.0070.04020.31
5.5.320.0070.03720.27
5.5.310.0200.08320.28
5.5.300.0070.08018.06
5.5.290.0100.07018.04
5.5.280.0030.08720.84
5.5.270.0070.04020.86
5.5.260.0130.08020.80
5.5.250.0100.06020.70
5.5.240.0070.04720.39
5.4.450.0100.08019.59
5.4.440.0000.04319.57
5.4.430.0130.05319.30
5.4.420.0030.05319.48
5.4.410.0000.06019.35
5.4.400.0070.08019.17
5.4.390.0030.08319.14
5.4.380.0100.07319.24
5.4.370.0000.06719.14
5.4.360.0030.05019.00
5.4.350.0030.08319.17
5.4.340.0100.07319.20
5.4.320.0100.06019.16
5.4.310.0000.05318.88
5.4.300.0100.04019.11
5.4.290.0100.05319.23
5.4.280.0100.07019.14
5.4.270.0100.05019.24
5.4.260.0070.03719.14
5.4.250.0100.06719.15
5.4.240.0070.05319.14
5.4.230.0100.07319.21
5.4.220.0070.06018.85
5.4.210.0000.08319.23
5.4.200.0170.06319.14
5.4.190.0000.07719.13
5.4.180.0130.05318.91
5.4.170.0100.06019.13
5.4.160.0100.07718.85
5.4.150.0000.08718.85
5.4.140.0100.07316.38
5.4.130.0130.07016.31
5.4.120.0130.06716.35
5.4.110.0170.06716.35
5.4.100.0030.05716.35
5.4.90.0070.07316.48
5.4.80.0000.07016.41
5.4.70.0070.03716.42
5.4.60.0070.04716.28
5.4.50.0070.06316.27
5.4.40.0130.03716.27
5.4.30.0170.06716.30
5.4.20.0070.06716.42
5.4.10.0000.05716.44
5.4.00.0130.05015.80
5.3.290.0130.05714.84
5.3.280.0070.07014.68
5.3.270.0100.06714.65
5.3.260.0000.06314.70
5.3.250.0030.07714.68
5.3.240.0070.04314.64
5.3.230.0000.05314.63
5.3.220.0070.05314.66
5.3.210.0030.07714.59
5.3.200.0030.07714.59
5.3.190.0100.07714.60
5.3.180.0030.07314.73
5.3.170.0030.06714.63
5.3.160.0000.05014.63
5.3.150.0130.07314.74
5.3.140.0030.06014.59
5.3.130.0070.08014.57
5.3.120.0030.06714.46
5.3.110.0070.07314.57
5.3.100.0100.07014.09
5.3.90.0070.07313.96
5.3.80.0030.07013.99
5.3.70.0070.04714.04
5.3.60.0100.06714.08
5.3.50.0100.06713.97
5.3.40.0070.07013.86
5.3.30.0070.06013.89
5.3.20.0130.05713.71
5.3.10.0100.06713.83
5.3.00.0030.06313.70
5.2.170.0030.04011.18
5.2.160.0100.05011.18
5.2.150.0030.04311.13
5.2.140.0030.03711.21
5.2.130.0170.04711.16
5.2.120.0070.05711.28
5.2.110.0130.03711.12
5.2.100.0070.05711.28
5.2.90.0070.05311.04
5.2.80.0100.05711.06
5.2.70.0070.06311.26
5.2.60.0030.06711.06
5.2.50.0000.05311.05
5.2.40.0070.05010.98
5.2.30.0030.04710.95
5.2.20.0000.04010.95
5.2.10.0030.06010.92
5.2.00.0070.06010.89
5.1.60.0070.0539.93
5.1.50.0030.0409.93
5.1.40.0070.05310.01
5.1.30.0000.06010.37
5.1.20.0030.05310.29
5.1.10.0100.04310.06
5.1.00.0000.06010.17
5.0.50.0070.0438.73
5.0.40.0000.0438.57
5.0.30.0030.0678.15
5.0.20.0000.0338.37
5.0.10.0070.0438.24
5.0.00.0030.0538.09
4.4.90.0000.0277.84
4.4.80.0000.0377.84
4.4.70.0000.0377.84
4.4.60.0030.0307.84
4.4.50.0000.0407.84
4.4.40.0030.0407.84
4.4.30.0000.0407.84
4.4.20.0070.0307.84
4.4.10.0030.0337.84
4.4.00.0030.0477.84
4.3.110.0030.0377.84
4.3.100.0030.0337.84
4.3.90.0030.0337.84
4.3.80.0030.0377.84
4.3.70.0000.0237.84
4.3.60.0000.0237.84
4.3.50.0000.0237.84
4.3.40.0000.0507.84
4.3.30.0030.0377.84
4.3.20.0070.0207.84
4.3.10.0000.0377.84
4.3.00.0000.0237.84

preferences:
42.42 ms | 400 KiB | 5 Q