3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Current output: // TestWithPublicMethods@enter OK // TestWithPrivateMethods@enter OK // TestWithPublicMethods@leave OK // // Warning: (Registered shutdown functions) Unable to call TestWithPrivateMethods::leave() - function does not exist in Unknown on line 0 // Expected: // TestWithPublicMethods@enter OK // TestWithPrivateMethods@enter OK // TestWithPublicMethods@leave OK // TestWithPrivateMethods@leave OK class TestWithPublicMethods { public function test() { spl_autoload_register([ $this, 'enter' ], true, true); register_shutdown_function([ $this, 'leave' ]); } public function enter() { eval('class TestWithPublicMethodsAutoload {}'); echo __CLASS__ . '@' . __FUNCTION__ . " OK\n"; } public function leave() { echo __CLASS__ . '@' . __FUNCTION__ . " OK\n"; } } (new TestWithPublicMethods)->test(); new TestWithPublicMethodsAutoload; class TestWithPrivateMethods { public function test() { spl_autoload_register([ $this, 'enter' ], true, true); register_shutdown_function([ $this, 'leave' ]); } private function enter() { eval('class TestWithPrivateMethodsAutoload {}'); echo __CLASS__ . '@' . __FUNCTION__ . " OK\n"; } private function leave() { echo __CLASS__ . '@' . __FUNCTION__ . " OK\n"; } } (new TestWithPrivateMethods)->test(); new TestWithPrivateMethodsAutoload;

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.0170.00318.31
8.3.50.0110.00318.28
8.3.40.0040.01118.79
8.3.30.0110.00318.70
8.3.20.0040.00420.95
8.3.10.0040.00420.24
8.3.00.0040.00420.77
8.2.180.0140.00318.17
8.2.170.0120.00322.96
8.2.160.0130.00020.39
8.2.150.0000.00824.18
8.2.140.0140.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.60
8.2.110.0050.00521.13
8.2.100.0040.00819.37
8.2.90.0000.00919.23
8.2.80.0080.00018.64
8.2.70.0080.00017.50
8.2.60.0040.00418.09
8.2.50.0040.00418.10
8.2.40.0000.00819.30
8.2.30.0040.00419.27
8.2.20.0080.00017.95
8.2.10.0040.00418.88
8.2.00.0040.00419.32
8.1.280.0040.01125.92
8.1.270.0000.00820.82
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0110.00021.95
8.1.230.0040.00722.66
8.1.220.0080.00018.53
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0060.00318.46
8.1.160.0040.00418.97
8.1.150.0030.00518.76
8.1.140.0020.00520.59
8.1.130.0070.00020.09
8.1.120.0040.00417.46
8.1.110.0070.00317.41
8.1.100.0030.00517.30
8.1.90.0000.00817.43
8.1.80.0040.00417.43
8.1.70.0000.00817.29
8.1.60.0040.00417.44
8.1.50.0080.00017.52
8.1.40.0040.00417.37
8.1.30.0030.00617.57
8.1.20.0050.00217.57
8.1.10.0060.00317.45
8.1.00.0030.00617.51
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0070.00018.38
8.0.270.0000.00817.29
8.0.260.0000.00620.22
8.0.250.0040.00416.94
8.0.240.0000.00817.01
8.0.230.0040.00417.03
8.0.220.0000.00717.00
8.0.210.0000.00816.87
8.0.200.0070.00017.04
8.0.190.0050.00316.97
8.0.180.0000.00716.99
8.0.170.0080.00017.02
8.0.160.0050.00316.87
8.0.150.0000.00816.94
8.0.140.0100.00016.89
8.0.130.0000.00613.37
8.0.120.0040.00416.96
8.0.110.0070.00317.03
8.0.100.0040.00416.86
8.0.90.0050.00516.83
8.0.80.0140.00716.86
8.0.70.0070.00016.99
8.0.60.0000.00716.93
8.0.50.0050.00216.86
8.0.30.0130.00616.90
8.0.20.0130.00617.10
8.0.10.0040.00416.94
8.0.00.0130.00616.97
7.4.330.0050.00015.55
7.4.320.0030.00316.55
7.4.300.0030.00316.52
7.4.290.0040.00416.50
7.4.280.0050.00516.53
7.4.270.0040.00416.55
7.4.260.0050.00013.41
7.4.250.0020.00516.63
7.4.240.0030.00516.57
7.4.230.0030.00316.47
7.4.220.0020.00516.43
7.4.210.0050.00916.71
7.4.200.0030.00316.53
7.4.130.0150.00916.45
7.4.120.0120.01216.47
7.4.110.0120.00916.57
7.4.100.0140.00916.52
7.4.90.0030.01416.56
7.4.80.0100.01019.39
7.4.70.0060.01016.45
7.4.60.0140.00316.49
7.4.50.0070.00716.54
7.4.40.0070.01016.73
7.4.00.0050.00915.10
7.3.330.0070.00016.21
7.3.320.0000.00613.19
7.3.310.0000.00716.27
7.3.300.0000.00716.39
7.3.290.0120.00516.37
7.3.280.0090.00616.36
7.3.260.0110.01216.35
7.3.230.0140.01116.57
7.3.210.0050.01316.63
7.3.200.0090.01216.37
7.3.190.0120.00416.37
7.3.180.0130.00716.30
7.3.170.0120.00616.27
7.3.160.0130.00716.37
7.3.120.0090.00414.60
7.3.110.0050.00814.77
7.3.100.0090.00614.83
7.3.90.0080.00914.53
7.3.80.0100.00414.74
7.3.70.0080.00514.72
7.3.60.0040.00914.78
7.3.50.0060.00714.82
7.3.40.0080.00514.54
7.3.30.0070.00814.65
7.3.20.0100.00514.75
7.3.10.0050.00914.66
7.3.00.0110.00514.80
7.2.330.0100.00616.32
7.2.320.0130.01316.46
7.2.310.0110.00716.71
7.2.300.0120.00616.64
7.2.290.0140.00716.71
7.2.250.0070.00714.78
7.2.240.0050.01114.75
7.2.230.0100.00914.95
7.2.220.0070.00914.75
7.2.210.0030.01114.91
7.2.200.0060.00815.00
7.2.190.0090.00515.01
7.2.180.0100.00814.90
7.2.170.0070.00914.68
7.2.160.0140.00415.05
7.2.150.0100.00614.90
7.2.140.0070.01215.13
7.2.130.0110.00715.13
7.2.120.0090.00914.92
7.2.110.0190.01014.88
7.2.100.0100.00715.02
7.2.90.0220.01315.18
7.2.80.0110.00715.03
7.2.70.0120.00714.94
7.2.60.0090.00915.02
7.2.50.0140.00815.09
7.2.40.0070.01215.05
7.2.30.0130.00714.92
7.2.20.0240.00415.09
7.2.10.0100.01615.13
7.2.00.0070.00915.10
7.1.330.0080.00613.88
7.1.320.0180.00913.95
7.1.310.0080.00614.03
7.1.300.0000.01213.74
7.1.290.0080.00713.77
7.1.280.0040.00913.83
7.1.270.0120.00313.63
7.1.260.0030.01213.86
7.1.250.0100.00613.92
7.1.240.0290.00813.80
7.1.230.0130.00613.95
7.1.220.0070.01113.74
7.1.210.0150.00513.90
7.1.200.0170.00313.79
7.1.190.0100.01013.65
7.1.180.0130.00713.87
7.1.170.0120.00713.68
7.1.160.0160.01413.91
7.1.150.0140.00813.99
7.1.140.0130.00913.58
7.1.130.0130.00513.85
7.1.120.0150.00413.80
7.1.110.0160.00613.76
7.1.100.0140.00613.99
7.1.90.0160.00313.73
7.1.80.0120.00413.73
7.1.70.0160.00013.99
7.1.60.0120.00713.71
7.1.50.0160.00613.96
7.1.40.0090.00913.81
7.1.30.0070.01013.42
7.1.20.0090.00913.88
7.1.10.0110.00713.72
7.1.00.0160.00413.88
7.0.330.0170.00013.58
7.0.320.0160.00413.58
7.0.310.0100.01013.54
7.0.300.0080.01113.29
7.0.290.0170.00613.41
7.0.280.0090.01013.60
7.0.270.0170.00713.55
7.0.260.0110.00713.61
7.0.250.0110.00713.54
7.0.240.0160.00313.53
7.0.230.0120.00413.45
7.0.220.0150.00013.18
7.0.210.0110.00713.44
7.0.200.0110.00813.55
7.0.190.0060.01013.57
7.0.180.0150.00313.39
7.0.170.0070.01113.52
7.0.160.0240.00713.46
7.0.150.0130.00313.58
7.0.140.0070.00913.32
7.0.130.0180.00513.46
7.0.120.0130.00713.36
7.0.110.0130.00713.64
7.0.100.0090.00913.52
7.0.90.0130.01013.53
7.0.80.0110.00713.54
7.0.70.0110.01113.25
7.0.60.0160.00813.53
7.0.50.0120.01313.59
7.0.40.0080.01013.52
7.0.30.0080.01313.50
7.0.20.0040.01413.64
7.0.10.0170.00713.44
7.0.00.0130.00813.46
5.6.400.0120.00614.32
5.6.390.0080.01214.02
5.6.380.0130.00514.04
5.6.370.0130.00614.35
5.6.360.0130.00814.14
5.6.350.0190.00414.33
5.6.340.0130.00914.13
5.6.330.0110.01114.11
5.6.320.0090.00914.25
5.6.310.0060.01114.18
5.6.300.0040.01114.40
5.6.290.0130.00614.33
5.6.280.0090.00914.14
5.6.270.0160.00414.45
5.6.260.0130.00514.18
5.6.250.0090.01114.15
5.6.240.0110.00814.26
5.6.230.0190.00014.16
5.6.220.0220.00414.32
5.6.210.0140.01214.16
5.6.200.0130.01314.13
5.6.190.0160.00313.95
5.6.180.0160.00614.17
5.6.170.0090.01514.16
5.6.160.0080.01214.00
5.6.150.0080.01314.20
5.6.140.0130.00814.16
5.6.130.0000.01514.08
5.6.120.0170.00414.28
5.6.110.0080.00814.23
5.6.100.0130.00413.96
5.6.90.0090.01114.34
5.6.80.0120.00614.11
5.6.70.0190.00614.21
5.6.60.0120.01314.18
5.6.50.0110.00714.17
5.6.40.0140.00514.34
5.6.30.0190.00314.18
5.6.20.0130.00914.10
5.6.10.0100.01014.13
5.6.00.0170.00314.14
5.5.380.0130.00614.10
5.5.370.0070.01114.27
5.5.360.0160.00914.28
5.5.350.0110.01114.19
5.5.340.0120.00614.54
5.5.330.0110.00813.96
5.5.320.0170.00314.28
5.5.310.0150.00914.22
5.5.300.0100.00713.96
5.5.290.0030.01214.36
5.5.280.0100.01014.00
5.5.270.0090.01214.39
5.5.260.0060.01214.17
5.5.250.0110.00814.19
5.5.240.0150.00314.17
5.5.230.0190.00313.97
5.5.220.0110.01213.66
5.5.210.0070.01114.21
5.5.200.0090.00913.88
5.5.190.0150.01013.94
5.5.180.0140.00514.19
5.5.170.0150.00314.01
5.5.160.0150.00914.03
5.5.150.0120.00614.28
5.5.140.0070.01114.17
5.5.130.0080.01113.88
5.5.120.0150.00514.37
5.5.110.0090.01813.95
5.5.100.0210.00313.95
5.5.90.0130.00814.33
5.5.80.0130.00414.02
5.5.70.0180.00813.70
5.5.60.0060.01214.36
5.5.50.0150.00514.16
5.5.40.0140.00414.24
5.5.30.0190.00414.01
5.5.20.0180.00014.05
5.5.10.0070.01514.21
5.5.00.0120.00614.18
5.4.450.0060.00911.07
5.4.440.0050.00910.86
5.4.430.0090.00610.93
5.4.420.0070.00711.29
5.4.410.0110.00410.80
5.4.400.0070.00710.79
5.4.390.0060.01210.90
5.4.380.0070.00710.83
5.4.370.0150.00011.05
5.4.360.0090.00611.04
5.4.350.0080.01111.13
5.4.340.0060.00810.86
5.4.330.0150.00010.97
5.4.320.0170.00010.95
5.4.310.0140.00010.98
5.4.300.0090.00410.94
5.4.290.0120.00410.46
5.4.280.0110.00410.86
5.4.270.0090.01211.14
5.4.260.0120.00611.10
5.4.250.0120.00310.88
5.4.240.0040.00910.99
5.4.230.0190.00010.80
5.4.220.0120.00610.88
5.4.210.0090.00611.19
5.4.200.0090.01010.90
5.4.190.0100.00711.04
5.4.180.0160.00010.88
5.4.170.0150.00010.99
5.4.160.0050.00911.13
5.4.150.0050.01010.80
5.4.140.0140.00311.17
5.4.130.0100.00311.07
5.4.120.0100.00411.11
5.4.110.0080.00610.64
5.4.100.0080.00810.98
5.4.90.0100.01011.20
5.4.80.0100.00311.11
5.4.70.0040.01110.76
5.4.60.0100.00310.86
5.4.50.0090.01510.81
5.4.40.0050.00911.05
5.4.30.0080.00611.12
5.4.20.0050.01011.10
5.4.10.0120.00611.00
5.4.00.0090.00910.79
5.3.290.0100.00210.41
5.3.280.0060.01210.39
5.3.270.0040.00910.39
5.3.260.0120.00610.39
5.3.250.0100.00310.39
5.3.240.0060.00610.39
5.3.230.0130.00010.39
5.3.220.0040.00910.39
5.3.210.0170.00010.39
5.3.200.0110.00310.39
5.3.190.0080.00410.39
5.3.180.0100.00310.39
5.3.170.0000.01210.44
5.3.160.0160.00310.39
5.3.150.0060.00610.39
5.3.140.0150.00010.39
5.3.130.0060.00610.39
5.3.120.0110.00410.39
5.3.110.0100.00710.39
5.3.100.0070.01010.40
5.3.90.0100.00710.48
5.3.80.0070.01010.39
5.3.70.0100.00610.39
5.3.60.0110.00610.39
5.3.50.0070.00710.39
5.3.40.0090.00510.39
5.3.30.0080.00410.39
5.3.20.0100.00310.39
5.3.10.0000.01210.39
5.3.00.0030.00910.39
5.2.170.0000.01010.39
5.2.160.0050.00510.39
5.2.150.0080.00210.39
5.2.140.0000.01010.39
5.2.130.0050.00510.39
5.2.120.0070.00310.39
5.2.110.0030.00710.39
5.2.100.0080.00310.39
5.2.90.0000.01110.39
5.2.80.0100.00010.39
5.2.70.0050.00510.39
5.2.60.0050.00510.39
5.2.50.0050.00510.39
5.2.40.0070.00310.39
5.2.30.0090.00610.39
5.2.20.0040.01010.39
5.2.10.0050.00510.39
5.2.00.0050.00510.39
5.1.60.0080.00010.39
5.1.50.0030.00610.39
5.1.40.0050.00510.39
5.1.30.0090.00010.39
5.1.20.0050.00510.39
5.1.10.0070.00310.39
5.1.00.0070.00210.39
5.0.50.0000.00810.39
5.0.40.0080.00010.39
5.0.30.0040.00410.39
5.0.20.0060.00210.39
5.0.10.0070.00010.39
5.0.00.0000.00810.39
4.4.90.0060.00010.39
4.4.80.0060.00010.39
4.4.70.0030.00310.39
4.4.60.0030.00310.39
4.4.50.0040.00210.39
4.4.40.0030.00310.39
4.4.30.0000.00610.39
4.4.20.0030.00310.39
4.4.10.0000.00610.39
4.4.00.0030.00310.39
4.3.110.0060.00010.39
4.3.100.0000.00710.39
4.3.90.0030.00310.39
4.3.80.0020.00510.39
4.3.70.0000.00610.39
4.3.60.0070.00010.39
4.3.50.0000.00910.39
4.3.40.0080.00010.39
4.3.30.0040.00210.39
4.3.20.0040.00210.39
4.3.10.0030.00310.39
4.3.00.0050.00010.39

preferences:
64.41 ms | 400 KiB | 5 Q