3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { private function priv() { echo "Base\n"; } // Expose the private method directly. public function callPriv() { $this->priv(); } // Expose the 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 extends Base { // A child private method. Does it override the base method ? private function priv() { echo "Child\n"; } // Expose the private method directly. public function callPriv() { $this->priv(); } } $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.0090.01216.38
8.3.50.0070.01419.85
8.3.40.0070.00718.71
8.3.30.0120.00318.50
8.3.20.0080.00021.91
8.3.10.0040.00421.87
8.3.00.0000.00721.54
8.2.180.0090.00925.92
8.2.170.0090.00922.96
8.2.160.0000.01422.96
8.2.150.0030.00525.66
8.2.140.0050.00224.66
8.2.130.0080.00026.16
8.2.120.0040.00419.96
8.2.110.0000.01020.39
8.2.100.0040.00817.84
8.2.90.0040.00420.24
8.2.80.0060.00317.97
8.2.70.0040.00717.63
8.2.60.0000.00818.05
8.2.50.0080.00018.16
8.2.40.0000.00720.59
8.2.30.0000.00819.32
8.2.20.0000.00718.11
8.2.10.0040.00418.06
8.2.00.0050.00218.14
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0090.00028.09
8.1.240.0060.00319.21
8.1.230.0080.00420.36
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00818.65
8.1.160.0000.00718.76
8.1.150.0070.00018.84
8.1.140.0030.00519.05
8.1.130.0070.00017.32
8.1.120.0050.00317.35
8.1.110.0030.00617.42
8.1.100.0040.00417.47
8.1.90.0040.00417.36
8.1.80.0080.00017.48
8.1.70.0030.00317.35
8.1.60.0060.00317.51
8.1.50.0120.00017.45
8.1.40.0030.00617.48
8.1.30.0070.00017.59
8.1.20.0000.00717.54
8.1.10.0020.00517.58
8.1.00.0050.00317.39
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0030.00318.36
8.0.270.0070.00017.15
8.0.260.0040.00416.87
8.0.250.0000.00716.92
8.0.240.0080.00016.95
8.0.230.0000.00716.82
8.0.220.0030.00316.90
8.0.210.0000.00716.83
8.0.200.0060.00016.97
8.0.190.0090.00016.92
8.0.180.0070.00316.82
8.0.170.0040.00416.91
8.0.160.0030.00316.95
8.0.150.0030.00716.86
8.0.140.0040.00416.74
8.0.130.0030.00313.28
8.0.120.0000.00816.85
8.0.110.0000.00816.85
8.0.100.0080.00016.82
8.0.90.0000.00716.90
8.0.80.0100.01016.78
8.0.70.0030.00516.95
8.0.60.0050.00216.70
8.0.50.0050.00216.80
8.0.30.0110.00717.19
8.0.20.0110.01017.40
8.0.10.0070.00016.81
8.0.00.0070.01316.74
7.4.330.0020.00215.55
7.4.320.0060.00016.59
7.4.300.0060.00016.61
7.4.290.0060.00316.52
7.4.280.0040.00416.44
7.4.270.0060.00416.60
7.4.260.0030.00316.58
7.4.250.0040.00316.57
7.4.240.0030.00316.45
7.4.230.0000.00716.58
7.4.220.0040.00416.51
7.4.210.0100.00816.59
7.4.200.0040.00416.63
7.4.160.0070.01216.49
7.4.150.0190.00317.40
7.4.140.0120.01017.86
7.4.130.0140.00316.44
7.4.120.0110.00816.54
7.4.110.0130.01016.55
7.4.100.0160.00016.51
7.4.90.0060.01116.56
7.4.80.0130.01019.39
7.4.70.0170.00016.52
7.4.60.0060.00916.39
7.4.50.0130.00316.61
7.4.40.0110.00716.53
7.4.00.0070.01115.12
7.3.330.0020.00213.38
7.3.320.0030.00313.17
7.3.310.0060.00016.35
7.3.300.0000.00616.17
7.3.290.0040.01116.22
7.3.280.0060.00816.27
7.3.270.0120.00617.40
7.3.260.0090.01016.34
7.3.250.0070.01016.25
7.3.240.0150.00616.34
7.3.230.0070.01016.27
7.3.210.0110.00616.38
7.3.200.0130.00316.21
7.3.190.0060.00916.18
7.3.180.0070.01016.48
7.3.170.0130.00916.50
7.3.160.0060.01216.29
7.2.330.0180.00816.77
7.2.320.0070.01016.93
7.2.310.0160.00016.50
7.2.300.0060.01516.82
7.2.290.0100.00616.64
7.2.80.0000.01116.37
7.2.60.0070.00716.78
7.2.00.0080.00619.48
7.1.200.0070.00715.81
7.1.120.0030.01018.24
7.1.110.0060.00917.61
7.1.100.0060.01217.79
7.1.90.0040.01417.90
7.1.80.0030.01017.82
7.1.70.0100.00617.01
7.1.60.0180.01234.95
7.1.50.0190.01034.47
7.1.40.0170.01034.12
7.1.30.0170.01334.29
7.1.20.0160.01634.27
7.1.10.0100.00516.66
7.1.00.0070.01016.61

preferences:
62.43 ms | 401 KiB | 5 Q