3v4l.org

run code in 200+ php & hhvm versions
<?php class A {} class B extends A{} class C extends B{} $b = 'B'; var_dump(is_subclass_of('A', 'A'), is_subclass_of('B', 'A'), is_subclass_of($b, 'A')); var_dump(is_a('A', 'A', true), is_a('B', 'A', true), is_a($b, 'A', true)); $className = 'C'; while($_parentClass = get_parent_class($className)) $parentClass = $_parentClass; var_dump($className, $parentClass);

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.1.100.0002.50118.19
7.1.70.0032.49816.99
7.1.60.0132.48819.40
7.1.50.0132.48816.95
7.1.00.0002.50022.21
7.0.200.0032.49816.81
7.0.140.0032.49722.19
7.0.80.0132.48719.94
7.0.70.0072.49320.18
7.0.60.0102.49019.98
7.0.50.0002.50020.18
7.0.40.0072.49320.11
7.0.30.0102.49020.12
7.0.20.0102.49020.05
7.0.10.0072.49320.05
7.0.00.0072.49320.01
5.6.280.0102.49020.82
5.6.230.0102.49020.63
5.6.220.0032.49720.70
5.6.210.0072.49320.77
5.6.200.0072.49321.02
5.6.190.0002.50021.07
5.6.180.0172.48321.02
5.6.170.0102.49020.96
5.6.160.0132.48721.08
5.6.150.0002.50020.95
5.6.140.0032.49721.17
5.6.130.0102.49021.02
5.6.120.0132.48721.00
5.6.110.0032.49721.01
5.6.100.0072.49321.02
5.6.90.0072.49321.09
5.6.80.0102.49020.46
5.6.70.0032.49720.46
5.6.60.1832.31320.33
5.6.50.0102.46020.40
5.6.40.0072.49320.30
5.6.30.2102.28720.38
5.6.20.0072.49320.27
5.6.10.0032.49720.43
5.6.00.0032.49720.48
5.5.370.0102.49020.38
5.5.360.0002.50020.48
5.5.350.0032.49720.39
5.5.340.0072.49320.64
5.5.330.0072.49320.80
5.5.320.0072.49320.73
5.5.310.0102.49020.86
5.5.300.0102.49020.89
5.5.290.0072.49320.76
5.5.280.0102.49020.82
5.5.270.0032.49720.71
5.5.260.0202.48020.89
5.5.250.0032.49720.57
5.5.240.0032.49720.11
5.5.230.0072.30020.28
5.5.220.0072.49320.13
5.5.210.0032.49720.29
5.5.200.0102.46720.27
5.5.190.0102.49020.08
5.5.180.0032.49720.15
5.5.160.0032.49720.17
5.5.150.0072.49320.14
5.5.140.0102.49020.27
5.5.130.0102.47020.17
5.5.120.0072.49320.23
5.5.110.0032.49720.23
5.5.100.0032.46020.12
5.5.90.0072.49320.10
5.5.80.0072.49320.12
5.5.70.0132.46020.03
5.5.60.0072.49320.05
5.5.50.0032.49720.05
5.5.40.0002.50020.08
5.5.30.0102.49020.14
5.5.20.0072.49320.15
5.5.10.0102.49020.09
5.5.00.0102.49019.97
5.4.450.0072.49319.26
5.4.440.0072.49319.28
5.4.430.0002.50019.36
5.4.420.0032.49719.15
5.4.410.0072.49319.16
5.4.400.0032.49719.05
5.4.390.0032.49718.97
5.4.380.0072.49318.95
5.4.370.0102.49019.00
5.4.360.0032.47718.96
5.4.350.0102.49018.97
5.4.340.0132.48718.84
5.4.320.0002.50018.79
5.4.310.0032.49718.82
5.4.300.0002.50018.96
5.4.290.1532.34718.83
5.4.280.0032.49718.99
5.4.270.0132.48718.95
5.4.260.0072.49318.93
5.4.250.0032.49718.96
5.4.240.0072.49318.88
5.4.230.0072.49319.11
5.4.220.0172.48318.78
5.4.210.0072.49318.97
5.4.200.0072.49318.95
5.4.190.0072.49318.98
5.4.180.0102.49018.95
5.4.170.0102.49019.01
5.4.160.0032.49718.92
5.4.150.0072.49318.96
5.4.140.0072.47016.48
5.4.130.0102.49016.35
5.4.120.0102.49016.32
5.4.110.0032.49716.26
5.4.100.0032.49716.39
5.4.90.0102.49016.48
5.4.80.0072.46316.43
5.4.70.0072.49316.34
5.4.60.0002.50016.45
5.4.50.0102.49016.27
5.4.40.0102.49016.30
5.4.30.0032.49716.20
5.4.20.0102.49016.41
5.4.10.0002.50016.27
5.4.00.0132.48715.66
5.3.290.0072.49314.56
5.3.280.0102.49014.51
5.3.270.0132.48714.40
5.3.260.0002.50014.33
5.3.250.0032.49714.37
5.3.240.0032.49714.46
5.3.230.0032.49714.50
5.3.220.0072.49314.32
5.3.210.0002.50014.32
5.3.200.0032.49714.42
5.3.190.0032.49714.36
5.3.180.0072.49314.28
5.3.170.0072.49314.37
5.3.160.0032.49714.53
5.3.150.0032.49714.32
5.3.140.0032.49714.36
5.3.130.0172.48314.29
5.3.120.0102.49014.42
5.3.110.0002.50014.45
5.3.100.0002.50013.98
5.3.90.0032.49713.82
5.3.70.0172.40713.93
5.3.60.0032.44013.64
5.3.50.0272.36313.72
5.3.40.0132.42313.71
5.3.30.0132.45313.66
5.3.20.0002.47713.49
5.3.10.0102.39313.27
5.3.00.0032.45713.38
5.2.170.0102.45710.94
5.2.160.0232.29010.77
5.2.150.0172.41710.92
5.2.140.0272.42710.89
5.2.130.0072.43710.88
5.2.120.0172.44710.86
5.2.110.0172.43710.77
5.2.100.0002.46310.89
5.2.90.0072.47310.83
5.2.80.0172.35710.90
5.2.70.0132.46310.85
5.2.60.0102.44710.77
5.2.50.0502.34710.79
5.2.40.0272.39710.76
5.2.30.0132.42010.70
5.2.20.0332.39310.79
5.2.10.0132.37310.73
5.2.00.0332.40310.42
5.1.60.0272.4009.88
5.1.50.0132.4139.77
5.1.40.0332.3779.81
5.1.30.0072.43710.13
5.1.20.0202.38710.19
5.1.10.0202.4139.90
5.0.50.0302.4038.47
5.0.40.0172.4408.47
5.0.30.0172.4378.47
5.0.20.0202.4378.47
5.0.10.0102.4378.47
5.0.00.0072.4408.47
4.4.90.0202.4138.47
4.4.80.0032.4638.47
4.4.70.0172.4208.47
4.4.60.0132.3908.47
4.4.50.0202.4438.47
4.4.40.0172.3838.47
4.4.30.0232.2878.47
4.4.20.0172.4138.47
4.4.10.0172.4178.47
4.4.00.0102.4378.47
4.3.110.0202.4338.47
4.3.100.0032.4638.47
4.3.90.0032.4538.47
4.3.80.0172.4208.47
4.3.70.0072.4538.47
4.3.60.0132.4078.47
4.3.50.0102.4578.47
4.3.40.0132.4478.47
4.3.30.0102.4578.47
4.3.20.0102.4338.47
4.3.10.0132.4508.47
4.3.00.0072.4578.47