3v4l.org

run code in 300+ PHP versions simultaneously
<?php // ClassA.php class A { public function __construct(){print "Init";} public function bye(){print "Hey :)";} } //ScriptAClassAction.php require 'ClassA.php'; $class = new A(); $reflection = new ReflectionClass($class); if (!empty($reflection) && $reflection->hasMethod('hello')){ if($reflection->hasMethod('init')) $class->init($request, $response); //Prints 'Init called' if($reflection->hasMethod('preDispatch')) $class->preDispatch(); // 'Predispatch called' $class->hello(); if($reflection->hasMethod('postDispatch')) $class->postDispatch(); // 'post dispatch called'.. } else { if (!$reflection) // I know this might not be the best check but.. print "Not a valid class supplied"; if (false == $reflection->hasMethod('hello')) // True trigger print "Supplied class does not have any manners and does not greet you :D"; // This is the expected output and it should be the only output }

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.0150.00318.50
8.3.50.0100.01121.95
8.3.40.0150.00618.94
8.3.30.0150.00019.07
8.3.20.0050.00320.34
8.3.10.0090.00021.93
8.3.00.0030.00522.34
8.2.180.0070.01017.00
8.2.170.0070.00722.96
8.2.160.0140.00020.95
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00419.36
8.2.110.0100.00022.28
8.2.100.0090.00319.58
8.2.90.0000.00719.17
8.2.80.0030.00619.66
8.2.70.0030.00517.50
8.2.60.0030.00617.80
8.2.50.0000.00818.07
8.2.40.0000.00918.28
8.2.30.0030.00717.99
8.2.20.0040.00417.74
8.2.10.0000.00717.65
8.2.00.0040.00417.77
8.1.280.0210.00025.92
8.1.270.0080.00022.09
8.1.260.0070.00026.35
8.1.250.0090.00028.09
8.1.240.0040.00424.02
8.1.230.0070.00419.02
8.1.220.0080.00017.79
8.1.210.0000.00918.77
8.1.200.0040.00417.23
8.1.190.0040.00417.30
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0030.00622.03
8.1.150.0030.00520.31
8.1.140.0040.00417.39
8.1.130.0000.00717.80
8.1.120.0000.00817.46
8.1.110.0020.00517.48
8.1.100.0000.00817.39
8.1.90.0050.00217.46
8.1.80.0040.00417.43
8.1.70.0030.00317.42
8.1.60.0030.00617.61
8.1.50.0040.00417.59
8.1.40.0050.00317.42
8.1.30.0060.00317.67
8.1.20.0040.00417.66
8.1.10.0030.00517.49
8.1.00.0030.00517.41
8.0.300.0070.00018.77
8.0.290.0050.00217.16
8.0.280.0070.00018.39
8.0.270.0070.00017.37
8.0.260.0030.00316.89
8.0.250.0000.00717.01
8.0.240.0050.00217.09
8.0.230.0070.00017.10
8.0.220.0030.00316.93
8.0.210.0000.00717.04
8.0.200.0030.00317.05
8.0.190.0070.00017.05
8.0.180.0080.00016.99
8.0.170.0000.00817.14
8.0.160.0030.00517.03
8.0.150.0030.00317.00
8.0.140.0000.00716.97
8.0.130.0030.00313.41
8.0.120.0040.00416.97
8.0.110.0000.00717.11
8.0.100.0040.00416.88
8.0.90.0050.00317.07
8.0.80.0000.01417.04
8.0.70.0000.00716.96
8.0.60.0030.00316.86
8.0.50.0030.00517.03
8.0.30.0130.00817.21
8.0.20.0140.00617.40
8.0.10.0000.00716.90
8.0.00.0070.01016.71
7.4.330.0000.00515.01
7.4.320.0030.00316.45
7.4.300.0070.00016.54
7.4.290.0030.00516.61
7.4.280.0070.00016.41
7.4.270.0080.00016.66
7.4.260.0070.00016.40
7.4.250.0000.00716.56
7.4.240.0040.00316.59
7.4.230.0000.00716.64
7.4.220.0150.00416.57
7.4.210.0110.00716.59
7.4.200.0000.00716.64
7.4.190.0000.00716.39
7.4.160.0150.00416.43
7.4.150.0150.00917.40
7.4.140.0150.00617.86
7.4.130.0110.00716.63
7.4.120.0080.00916.47
7.4.110.0130.00416.71
7.4.100.0210.00016.59
7.4.90.0090.00916.47
7.4.80.0030.01719.39
7.4.70.0100.00616.61
7.4.60.0100.00716.29
7.4.50.0020.00216.45
7.4.40.0100.00722.77
7.4.30.0130.00716.69
7.4.00.0070.01014.78
7.3.330.0050.00013.09
7.3.320.0020.00213.30
7.3.310.0000.00716.13
7.3.300.0040.00416.33
7.3.290.0100.00316.32
7.3.280.0090.00916.26
7.3.270.0060.01217.40
7.3.260.0060.01316.38
7.3.250.0120.00916.49
7.3.240.0130.00716.41
7.3.230.0100.00616.39
7.3.210.0090.00916.38
7.3.200.0120.00619.39
7.3.190.0150.00616.51
7.3.180.0080.00816.36
7.3.170.0090.00616.54
7.3.160.0060.00916.43
7.3.120.0040.01114.60
7.3.10.0080.00816.41
7.3.00.0160.00616.09
7.2.330.0170.00616.55
7.2.320.0150.00316.55
7.2.310.0150.00916.53
7.2.300.0190.00416.59
7.2.290.0060.01116.51
7.2.130.0140.00916.44
7.2.120.0110.00716.65
7.2.110.0170.00616.21
7.2.100.0140.00716.47
7.2.90.0130.01016.41
7.2.80.0100.01016.36
7.2.70.0170.00816.66
7.2.60.0060.01116.46
7.2.50.0110.01116.78
7.2.40.0140.00716.39
7.2.30.0150.01216.63
7.2.20.0100.00816.36
7.2.10.0140.01016.39
7.2.00.0100.01016.88
7.1.250.0110.01115.52
7.1.200.0070.00315.79
7.1.70.0040.00417.01
7.1.60.0100.01419.82
7.1.50.0100.00716.73
7.1.00.0000.08022.34
7.0.200.0040.00816.41
7.0.140.0070.07021.99
7.0.60.0130.06719.89
7.0.50.0130.03317.98
7.0.40.0000.04320.41
7.0.30.0300.09020.20
7.0.20.0370.07320.16
7.0.10.0330.07020.31
7.0.00.0070.04720.20
5.6.280.0070.07020.78
5.6.210.0000.04320.75
5.6.200.0030.04318.15
5.6.190.0070.07020.64
5.6.180.0070.05020.50
5.6.170.0430.07320.48
5.6.160.0030.09720.56
5.6.150.0070.04718.13
5.6.140.0070.06318.15
5.6.130.0070.08318.29
5.6.120.0070.05321.02
5.6.110.0030.04720.96
5.6.100.0130.07720.97
5.6.90.0070.09020.88
5.6.80.0130.07020.54
5.6.70.0200.03720.38
5.5.350.0100.08020.41
5.5.340.0030.04017.92
5.5.330.0070.05320.58
5.5.320.0100.06320.37
5.5.310.0230.07020.32
5.5.300.0100.08317.95
5.5.290.0070.03718.05
5.5.280.0030.06320.98
5.5.270.0100.07720.87
5.5.260.0100.08020.65
5.5.250.0070.08020.72
5.5.240.0100.06720.19
5.4.450.0330.06019.18
5.4.440.0630.06719.23
5.4.430.1200.05319.48
5.4.420.0200.04719.53
5.4.410.0070.06018.92
5.4.400.0430.04318.82
5.4.390.0330.05718.54
5.4.380.0270.05318.79
5.4.370.0130.03318.75
5.4.360.0100.04018.56
5.4.350.0240.08112.04
5.4.340.0080.03412.03
5.4.320.0070.03812.52
5.4.310.0060.04312.51
5.4.300.0050.03912.52
5.4.290.0090.04412.52
5.4.280.0050.04612.41
5.4.270.0090.03412.41
5.4.260.0040.04212.41
5.4.250.0040.03912.41
5.4.240.0050.04212.41
5.4.230.0070.04412.40
5.4.220.0060.03912.40
5.4.210.0050.03612.40
5.4.200.0080.04212.40
5.4.190.0080.03712.40
5.4.180.0100.03512.40
5.4.170.0140.04512.39
5.4.160.0190.04212.38
5.4.150.0140.04712.38
5.4.140.0180.04112.07
5.4.130.0180.04512.05
5.4.120.0170.04312.01
5.4.110.0130.04512.01
5.4.100.0140.04712.01
5.4.90.0140.04812.01
5.4.80.0120.04612.01
5.4.70.0170.04012.01
5.4.60.0150.04212.00
5.4.50.0140.04412.01
5.4.40.0150.04311.99
5.4.30.0120.04711.99
5.4.20.0140.04811.99
5.4.10.0170.04111.98
5.4.00.0100.04711.48
5.3.290.0090.03812.80
5.3.280.0030.04012.71
5.3.270.0160.04612.72
5.3.260.0180.04412.71
5.3.250.0140.05112.71
5.3.240.0180.04412.72
5.3.230.0200.04712.71
5.3.220.0200.04212.68
5.3.210.0230.03912.68
5.3.200.0170.05112.68
5.3.190.0190.04612.68
5.3.180.0180.04612.68
5.3.170.0250.03912.66
5.3.160.0160.05012.68
5.3.150.0150.05112.68
5.3.140.0170.04812.66
5.3.130.0190.04712.66
5.3.120.0150.04912.66
5.3.110.0210.04512.66
5.3.100.0190.04812.14
5.3.90.0250.03912.11
5.3.80.0210.04612.09
5.3.70.0160.04812.10
5.3.60.0230.04112.08
5.3.50.0170.04512.03
5.3.40.0120.05112.04
5.3.30.0190.04412.00
5.3.20.0160.04911.78
5.3.10.0180.04111.74
5.3.00.0210.03811.72
5.2.170.0120.0399.23
5.2.160.0130.0369.23
5.2.150.0160.0359.23
5.2.140.0180.0349.23
5.2.130.0150.0369.19
5.2.120.0130.0359.19
5.2.110.0160.0359.19
5.2.100.0180.0319.19
5.2.90.0100.0409.18
5.2.80.0170.0329.18
5.2.70.0120.0399.18
5.2.60.0140.0349.14
5.2.50.0130.0369.11
5.2.40.0140.0379.09
5.2.30.0140.0349.06
5.2.20.0100.0389.07
5.2.10.0160.0318.96
5.2.00.0130.0358.82
5.1.60.0080.0338.11
5.1.50.0100.0318.11
5.1.40.0090.0328.09
5.1.30.0180.0268.43
5.1.20.0130.0318.46
5.1.10.0150.0298.18
5.1.00.0120.0308.18
5.0.50.0090.0276.66
5.0.40.0120.0216.53
5.0.30.0080.0376.33
5.0.20.0080.0256.31
5.0.10.0110.0226.29
5.0.00.0100.0366.27
4.4.90.0080.0214.78
4.4.80.0050.0224.75
4.4.70.0080.0214.76
4.4.60.0080.0204.76
4.4.50.0070.0194.77
4.4.40.0110.0284.71
4.4.30.0100.0174.76
4.4.20.0110.0174.84
4.4.10.0040.0224.85
4.4.00.0100.0294.76
4.3.110.0080.0194.67
4.3.100.0070.0194.67
4.3.90.0110.0154.63
4.3.80.0100.0264.59
4.3.70.0080.0204.63
4.3.60.0090.0204.63
4.3.50.0080.0204.62
4.3.40.0080.0284.54
4.3.30.0050.0193.31
4.3.20.0050.0203.30
4.3.10.0080.0163.26
4.3.00.0030.01715.15

preferences:
59.17 ms | 400 KiB | 5 Q