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.60.0540.02072.81
8.3.50.0620.02773.34
8.3.40.0290.01344.80
8.3.30.0270.01745.18
8.3.20.0190.00346.38
8.3.10.0070.01150.14
8.3.00.0130.00745.29
8.2.180.0440.03074.65
8.2.170.0360.00744.82
8.2.160.0210.01747.68
8.2.150.0230.00045.14
8.2.140.0210.00345.19
8.2.130.0100.01349.21
8.2.120.0220.01046.50
8.2.110.0070.01448.34
8.2.100.0270.01043.72
8.2.90.0100.01345.24
8.2.80.0170.01043.63
8.2.70.0160.00743.63
8.2.60.0200.01044.16
8.2.50.0070.02043.63
8.2.40.0110.01844.26
8.2.30.0130.01044.17
8.2.20.0200.00343.51
8.2.10.0100.01344.07
8.2.00.0130.01043.50
8.1.270.0140.00749.00
8.1.260.0200.00344.83
8.1.250.0090.00949.73
8.1.240.0040.01151.93
8.1.230.0210.01445.01
8.1.220.0140.00743.53
8.1.210.0040.02143.36
8.1.200.0120.01243.60
8.1.190.0130.01043.35
8.1.180.0130.01543.22
8.1.170.0090.01244.73
8.1.160.0100.01048.00
8.1.150.0130.01044.54
8.1.140.0090.01243.50
8.1.130.0130.00743.76
8.1.120.0100.01043.55
8.1.110.0180.00443.46
8.1.100.0070.01543.43
8.1.90.0070.01443.44
8.1.80.0100.01043.43
8.1.70.0100.01043.45
8.1.60.0130.01043.54
8.1.50.0160.00643.50
8.1.40.0190.00343.59
8.1.30.0170.01443.62
8.1.20.0100.01343.57
8.1.10.0300.02073.15
8.1.00.0260.01373.07
8.0.300.0260.01376.28
8.0.290.0220.01672.80
8.0.280.0230.01374.16
8.0.270.0270.01072.76
8.0.260.0160.01972.85
8.0.250.0230.01372.62
8.0.240.0330.01972.47
8.0.230.0100.02872.37
8.0.220.0070.02772.40
8.0.210.0330.01372.36
8.0.200.0270.01072.45
8.0.190.0250.01272.46
8.0.180.0390.02372.52
8.0.170.0160.02372.52
8.0.160.0140.02472.38
8.0.150.0270.01072.46
8.0.140.0220.01672.34
8.0.130.0370.027121.79
8.0.120.0230.01672.44
8.0.110.0200.01772.41
8.0.100.0270.01372.38
8.0.90.0100.02672.46
8.0.80.0460.03272.34
8.0.70.0070.02872.28
8.0.60.0260.01072.45
8.0.50.0250.01172.26
8.0.30.0620.02972.84
8.0.20.0650.04772.76
8.0.10.0240.01072.53
8.0.00.0500.05372.39
7.4.330.0280.00669.80
7.4.320.0200.01372.04
7.4.300.0180.01872.14
7.4.290.0260.01372.16
7.4.280.0160.02272.07
7.4.270.0240.01472.09
7.4.260.0160.02372.07
7.4.250.0280.01372.08
7.4.240.0240.01272.17
7.4.230.0280.00672.14
7.4.220.0810.02572.15
7.4.210.0420.03972.16
7.4.200.0310.00972.03
7.4.190.0170.01772.01
7.4.160.0500.03772.00
7.4.150.0460.04972.14
7.4.140.0690.02872.01
7.4.130.0470.04372.07
7.4.120.0590.04172.09
7.4.110.0550.03972.07
7.4.100.0580.03672.21
7.4.90.0560.03672.19
7.4.80.0770.04871.98
7.4.70.0580.04471.99
7.4.60.0440.05071.94
7.4.50.0140.03172.02
7.4.40.0620.03172.15
7.4.30.0460.04372.08
7.4.10.0400.02370.19
7.4.00.0350.02870.68
7.3.330.0580.019121.86
7.3.320.0420.024121.88
7.3.310.0140.02171.87
7.3.300.0200.01671.86
7.3.290.0390.04671.91
7.3.280.0570.05571.90
7.3.270.0620.02971.95
7.3.260.0820.04572.03
7.3.250.0590.04671.93
7.3.240.0490.04371.96
7.3.230.0520.03972.14
7.3.210.0720.05971.76
7.3.200.0720.03672.21
7.3.190.0770.04971.87
7.3.180.0890.03671.93
7.3.170.0640.03872.04
7.3.160.0830.03072.11
7.3.130.0370.04470.44
7.3.120.0490.02170.56
7.3.110.0360.03370.35
7.3.100.0270.04070.38
7.3.90.0370.02070.41
7.3.80.0360.02970.52
7.3.70.0160.03970.40
7.3.60.0170.03470.39
7.3.50.0330.02070.47
7.3.40.0280.03170.29
7.3.30.0230.03070.35
7.3.20.0110.02578.71
7.3.10.0230.01378.63
7.3.00.0170.02478.24
7.2.330.0540.04780.05
7.2.320.0770.04679.84
7.2.310.0650.03980.03
7.2.300.0260.07979.78
7.2.290.0890.02079.95
7.2.260.0470.04478.47
7.2.250.0460.03978.40
7.2.240.0370.03678.58
7.2.230.0560.02078.47
7.2.220.0500.03478.46
7.2.210.0270.03478.40
7.2.200.0320.03378.39
7.2.190.0330.02678.25
7.2.180.0250.04678.34
7.2.170.0370.02378.33
7.2.160.0400.03078.33
7.2.150.0100.02778.69
7.2.140.0160.02278.96
7.2.130.0100.03378.80
7.2.120.0160.03678.89
7.2.110.0170.02478.95
7.2.100.0070.03078.86
7.2.90.0100.03778.73
7.2.80.0110.02578.81
7.2.70.0130.03378.82
7.2.60.1180.01878.91
7.2.50.0100.02878.93
7.2.40.0130.03078.91
7.2.30.0100.03278.98
7.2.20.0070.04678.82
7.2.10.0170.02478.63
7.2.00.0150.03080.06
7.1.330.0130.03477.76
7.1.320.0160.02977.88
7.1.310.0170.02677.79
7.1.300.0220.02277.73
7.1.290.0140.04777.45
7.1.280.0280.02177.63
7.1.270.0170.02477.82
7.1.260.0090.03177.99
7.1.250.0070.04577.67
7.1.240.0140.03877.81
7.1.230.0130.03977.60
7.1.220.2430.02077.61
7.1.210.0030.04377.76
7.1.200.0700.02277.82
7.1.190.0160.02577.93
7.1.180.0230.03377.74
7.1.170.0170.02777.97
7.1.160.0130.03077.68
7.1.150.0200.02377.84
7.1.140.0220.04077.76
7.1.130.0100.03177.82
7.1.120.0130.04677.93
7.1.110.0100.03077.97
7.1.100.0360.02453.74
7.1.90.0100.04177.57
7.1.80.0100.02977.95
7.1.70.0210.01678.61
7.1.60.0110.04178.63
7.1.50.0540.04178.26
7.1.40.0130.03977.81
7.1.30.0140.02477.73
7.1.20.0110.02577.81
7.1.10.0630.03777.51
7.1.00.0090.06680.99
7.0.330.0200.02477.63
7.0.320.0240.02477.30
7.0.310.0130.02377.57
7.0.300.0170.03777.43
7.0.290.0100.03477.31
7.0.280.0100.03077.42
7.0.270.0100.03977.18
7.0.260.0160.03277.43
7.0.250.0170.02977.44
7.0.240.0030.04277.22
7.0.230.0960.02677.48
7.0.220.0170.02477.67
7.0.210.0100.03577.51
7.0.200.3390.03077.75
7.0.190.0140.04477.51
7.0.180.0060.03277.50
7.0.170.1610.02677.28
7.0.160.0070.03077.37
7.0.150.0070.03077.60
7.0.140.0100.06980.68
7.0.130.0120.02877.52
7.0.120.0200.04177.52
7.0.110.0270.02377.54
7.0.100.0030.04777.52
7.0.90.0200.03677.18
7.0.80.0100.04377.33
7.0.70.0220.06280.72
7.0.60.0370.06180.49
7.0.50.0240.06880.84
7.0.40.0230.06816.74
7.0.30.0260.06216.75
7.0.20.0170.07316.89
7.0.10.0190.06916.84
7.0.00.0190.05816.78
5.6.400.0180.00630.84
5.6.390.0180.00930.69
5.6.380.0160.00930.66
5.6.370.0160.00930.57
5.6.360.0170.01430.96
5.6.350.0210.00330.50
5.6.340.0200.01330.71
5.6.330.0160.01030.54
5.6.320.0140.01130.52
5.6.310.0160.01330.63
5.6.300.0110.01830.53
5.6.290.0170.01030.65
5.6.280.0080.04733.99
5.6.270.0120.01230.96
5.6.260.0150.01230.98
5.6.250.0170.01031.08
5.6.240.0200.00330.60
5.6.230.0270.00030.61
5.6.220.0170.04733.78
5.6.210.0150.05233.73
5.6.200.0210.05333.95
5.6.190.0150.05834.00
5.6.180.0220.04334.11
5.6.170.0210.04934.20
5.6.160.0180.05634.16
5.6.150.0240.04534.00
5.6.140.0150.03533.96
5.6.130.0210.04934.00
5.6.120.0170.03734.05
5.6.110.0230.05133.86
5.6.100.0200.04133.89
5.6.90.0160.04834.17
5.6.80.0130.05333.69
5.6.70.0220.04333.80
5.6.60.0200.04633.50
5.6.50.0150.05033.73
5.6.40.0210.04233.58
5.6.30.0150.04933.67
5.6.20.0110.04133.61
5.6.10.0230.04133.53
5.6.00.0200.02933.63
5.5.380.0130.01330.35
5.5.370.0110.01530.78
5.5.360.0100.05133.49
5.5.350.0120.05633.64
5.5.340.0290.04233.63
5.5.330.0210.04833.88
5.5.320.0190.05133.91
5.5.310.0170.05033.87
5.5.300.0200.04733.91
5.5.290.0180.02933.96
5.5.280.0200.04133.96
5.5.270.0160.04533.76
5.5.260.0210.04633.93
5.5.250.0140.04633.72
5.5.240.0120.04733.54
5.5.230.0150.04833.60
5.5.220.0140.04933.52
5.5.210.0110.04933.57
5.5.200.0130.05433.37
5.5.190.0180.04033.69
5.5.180.0210.04033.28
5.5.170.0300.00930.62
5.5.160.0170.04333.40
5.5.150.0150.04833.41
5.5.140.0240.03633.54
5.5.130.0100.03833.57
5.5.120.0140.03233.65
5.5.110.0170.04233.43
5.5.100.0130.02633.40
5.5.90.0070.02833.64
5.5.80.0120.02733.50
5.5.70.0150.04333.52
5.5.60.0160.04533.40
5.5.50.0110.04033.52
5.5.40.0130.04833.61
5.5.30.0130.04633.37
5.5.20.0120.02933.41
5.5.10.0110.04233.54
5.5.00.0140.03833.59
5.4.450.0140.03531.33
5.4.440.0150.03031.53
5.4.430.0200.04431.42
5.4.420.0220.03731.56
5.4.410.0150.04831.37
5.4.400.0250.03831.24
5.4.390.0140.04631.35
5.4.380.0120.03731.41
5.4.370.0150.03931.10
5.4.360.0150.04531.16
5.4.350.0140.04931.14
5.4.340.0170.03031.19
5.4.330.0240.00727.13
5.4.320.0110.02731.34
5.4.310.0150.04631.49
5.4.300.0170.04431.20
5.4.290.0120.04231.45
5.4.280.0140.05731.30
5.4.270.0170.02831.23
5.4.260.0160.04431.35
5.4.250.0050.05231.27
5.4.240.0130.04031.36
5.4.230.0150.03231.37
5.4.220.0120.04831.28
5.4.210.0160.03331.05
5.4.200.0140.04431.31
5.4.190.0150.04131.21
5.4.180.0110.04431.08
5.4.170.0100.05031.19
5.4.160.0160.04031.33
5.4.150.0130.05131.19
5.4.140.0110.04729.95
5.4.130.0170.03629.83
5.4.120.0170.03829.85
5.4.110.0140.04230.04
5.4.100.0150.04130.04
5.4.90.0100.04329.90
5.4.80.0130.04129.96
5.4.70.0150.03529.84
5.4.60.0140.04129.87
5.4.50.0120.04329.90
5.4.40.0080.04529.96
5.4.30.0120.04329.87
5.4.20.0100.04729.84
5.4.10.0080.04529.97
5.4.00.0160.03529.32
5.3.290.0120.04530.04
5.3.280.0140.04429.42
5.3.270.0110.03629.48
5.3.260.0100.05029.47
5.3.250.0130.04129.41
5.3.240.0160.04029.45
5.3.230.0030.05529.26
5.3.220.0090.05129.09
5.3.210.0150.04029.10
5.3.200.0110.03529.20
5.3.190.0110.04829.17
5.3.180.0130.04129.13
5.3.170.0130.04829.25
5.3.160.0100.04529.26
5.3.150.0140.04429.24
5.3.140.0130.03229.10
5.3.130.0110.04829.10
5.3.120.0150.04129.28
5.3.110.0130.04529.20
5.3.100.0100.03928.93
5.3.90.0070.05229.12
5.3.80.0110.04328.60
5.3.70.0100.03128.69
5.3.60.0120.02828.74
5.3.50.0100.04828.63
5.3.40.0120.04528.71
5.3.30.0090.04228.72
5.3.20.0140.04028.59
5.3.10.0100.04028.42
5.3.00.0130.03628.78
5.2.170.0070.05712.28
5.2.160.0070.06012.28
5.2.150.0070.06012.28
5.2.140.0100.05312.28
5.2.130.0030.06012.28
5.2.120.0000.05312.28
5.2.110.0030.06012.28
5.2.100.0030.06712.28
5.2.90.0070.05712.28
5.2.80.0070.05712.28
5.2.70.0000.06012.28
5.2.60.0070.04712.28
5.2.50.0000.05712.28
5.2.40.0030.06312.28
5.2.30.0100.03712.28
5.2.20.0100.05312.28
5.2.10.0070.06012.28
5.2.00.0070.05712.28
5.1.60.0030.05012.28
5.1.50.0030.04712.28
5.1.40.0030.05312.28
5.1.30.0030.05712.28
5.1.20.0030.05712.28
5.1.10.0030.04012.28
5.1.00.0030.04012.28
5.0.50.0030.04712.28
5.0.40.0000.04712.28
5.0.30.0000.06712.28
5.0.20.0070.02712.28
5.0.10.0130.03312.28
5.0.00.0030.06312.28
4.4.90.0030.03312.28
4.4.80.0030.02712.28
4.4.70.0030.03312.28
4.4.60.0030.03312.28
4.4.50.0030.02712.28
4.4.40.0070.04312.28
4.4.30.0000.03712.28
4.4.20.0000.03012.28
4.4.10.0000.03712.28
4.4.00.0030.05312.28
4.3.110.0000.02312.28
4.3.100.0030.03312.28
4.3.90.0000.02012.28
4.3.80.0000.05312.28
4.3.70.0030.01712.28
4.3.60.0000.02712.28
4.3.50.0030.01712.28
4.3.40.0030.04012.28
4.3.30.0000.03012.28
4.3.20.0100.03012.28
4.3.10.0000.03712.28
4.3.00.0070.03012.28

preferences:
57.09 ms | 400 KiB | 5 Q