3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * This base class defines two methods of interest, one private, one protected. * * It also includes 3 ways to invoke these methods from outside. */ class Base { /** * A private base method */ private function priv() { echo __CLASS__ . PHP_EOL; } /** * Expose the private method */ public function callPriv() { $this->priv(); } /** * Expose either method via call_user_func(). */ public function call() { call_user_func(array($this, 'priv')); } /** * Expose either method using Reflection. */ public function reflect() { $rm = new ReflectionMethod($this, 'priv'); $rm->setAccessible(true); $rm->invoke($this); } } /** * Class Child redefines the methods of interest. Will overrides apply ? */ class Child extends Base { /** * A child private method. Does it override the base method ? */ private function priv() { echo __CLASS__ . PHP_EOL; } } $f = new Child(); // Shouldn't instance method calls invoke the method from the instance class ? $f->callPriv(); $f->call('priv'); $f->reflect('priv');

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.01118.18
8.3.50.0030.01220.09
8.3.40.0070.01118.58
8.3.30.0090.00618.76
8.3.20.0070.00021.60
8.3.10.0040.00421.82
8.3.00.0040.00421.82
8.2.180.0060.00918.29
8.2.170.0040.01122.96
8.2.160.0110.00319.16
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0080.00019.03
8.2.120.0030.00526.35
8.2.110.0030.00620.52
8.2.100.0030.00919.76
8.2.90.0030.00517.88
8.2.80.0030.00620.39
8.2.70.0000.00817.63
8.2.60.0030.00517.63
8.2.50.0000.00817.55
8.2.40.0000.00817.75
8.2.30.0040.00419.24
8.2.20.0090.00017.95
8.2.10.0000.00918.05
8.2.00.0040.00418.28
8.1.280.0120.00325.92
8.1.270.0040.00422.02
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0090.01223.96
8.1.230.0040.00719.10
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0040.00417.48
8.1.190.0040.00417.54
8.1.180.0030.00518.10
8.1.170.0050.00317.65
8.1.160.0000.00718.89
8.1.150.0050.00218.78
8.1.140.0040.00419.04
8.1.130.0040.00417.46
8.1.120.0000.00717.50
8.1.110.0000.00717.38
8.1.100.0070.00017.35
8.1.90.0000.00717.44
8.1.80.0050.00317.40
8.1.70.0000.00817.34
8.1.60.0040.00417.61
8.1.50.0030.00917.52
8.1.40.0050.00317.47
8.1.30.0000.00817.63
8.1.20.0030.00517.54
8.1.10.0000.00817.41
8.1.00.0040.00417.39
8.0.300.0000.00818.77
8.0.290.0070.00016.63
8.0.280.0040.00418.36
8.0.270.0070.00017.25
8.0.260.0000.00716.82
8.0.250.0070.00016.87
8.0.240.0040.00416.87
8.0.230.0040.00416.83
8.0.220.0040.00416.92
8.0.210.0070.00016.90
8.0.200.0070.00016.94
8.0.190.0040.00416.91
8.0.180.0040.00416.90
8.0.170.0000.00916.95
8.0.160.0000.00716.91
8.0.150.0030.00716.88
8.0.140.0040.00416.87
8.0.130.0000.00513.22
8.0.120.0060.00316.84
8.0.110.0040.00416.95
8.0.100.0000.00716.71
8.0.90.0000.00716.84
8.0.80.0110.00816.91
8.0.70.0050.00216.79
8.0.60.0000.00716.88
8.0.50.0070.00016.68
8.0.30.0080.00917.15
8.0.20.0090.01317.40
8.0.10.0040.00416.88
8.0.00.0120.00516.93
7.4.330.0050.00015.55
7.4.320.0030.00316.52
7.4.300.0000.00616.42
7.4.290.0110.00016.50
7.4.280.0040.00416.48
7.4.270.0040.00416.65
7.4.260.0040.00416.61
7.4.250.0040.00416.46
7.4.240.0040.00416.61
7.4.230.0040.00416.34
7.4.220.0070.00016.50
7.4.210.0070.00816.56
7.4.200.0030.00416.34
7.4.160.0100.00916.62
7.4.150.0140.00417.40
7.4.140.0100.01217.86
7.4.130.0070.01016.72
7.4.120.0100.00916.38
7.4.110.0070.01016.40
7.4.100.0060.01216.41
7.4.90.0120.00616.32
7.4.80.0120.00619.39
7.4.70.0030.01916.64
7.4.60.0070.01416.43
7.4.50.0040.01116.43
7.4.40.0000.01716.52
7.4.00.0100.00715.21
7.3.330.0030.00313.27
7.3.320.0030.00313.24
7.3.310.0000.00616.25
7.3.300.0040.00416.32
7.3.290.0100.01016.32
7.3.280.0090.00616.27
7.3.270.0070.01117.40
7.3.260.0080.01416.39
7.3.250.0080.00816.45
7.3.240.0100.00816.48
7.3.230.0110.00816.55
7.3.210.0070.01416.51
7.3.200.0080.00816.40
7.3.190.0030.01216.38
7.3.180.0120.00416.37
7.3.170.0120.00616.40
7.3.160.0090.01516.56
7.2.330.0100.01016.65
7.2.320.0120.00916.88
7.2.310.0100.00716.58
7.2.300.0070.01016.50
7.2.290.0090.00916.78
7.2.60.0040.00716.90
7.2.00.0140.00619.37
7.1.200.0070.00715.33
7.1.120.0100.00618.50
7.1.110.0060.00617.57
7.1.100.0040.01217.92
7.1.90.0030.01318.24
7.1.80.0000.01317.89
7.1.70.0090.00317.09
7.1.60.0110.01534.91
7.1.50.0140.01134.68
7.1.40.0100.01634.59
7.1.30.0120.01634.46
7.1.20.0130.01334.51
7.1.10.0090.00816.75
7.1.00.0070.00716.50

preferences:
55.82 ms | 401 KiB | 5 Q