3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait tSB_FormFieldObject { } interface iSB_FormFieldObject { } class SB_FormFieldObject implements iSB_FormFieldObject { use tSB_FormFieldObject; public $Test2 = "aa"; } function test($a=null) { echo "trait: " .($a instanceof tSB_FormFieldObject) . PHP_EOL; echo "interface: " .($a instanceof iSB_FormFieldObject) . PHP_EOL; echo "using: " .(is_using($a, "tSB_FormFieldObject")) . PHP_EOL; echo "instanceof: " .(is_instance_of($a, "SB_FormFiedldObject")) . PHP_EOL; } function is_using($class, $trait) { return in_array($trait, (new ReflectionClass($class))->getTraitNames()); } function is_instance_of($sub, $super) { $sub = is_object($sub) ? get_class($sub) : (string)$sub; $super = is_object($super) ? get_class($super) : (string)$super; switch(true) { case $sub === $super; // well ... conformity case is_subclass_of($sub, $super): case in_array($super, class_implements($sub)): return true; default: return false; } } $a = new SB_FormFieldObject(); test($a); ?>

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.0110.00716.50
8.3.50.0110.00817.46
8.3.40.0120.00318.71
8.3.30.0110.00318.71
8.3.20.0000.00818.82
8.3.10.0080.00018.77
8.3.00.0030.00619.02
8.2.180.0030.01816.63
8.2.170.0120.00622.96
8.2.160.0040.01118.57
8.2.150.0000.00924.18
8.2.140.0020.00524.66
8.2.130.0070.00026.16
8.2.120.0000.00819.54
8.2.110.0030.00720.48
8.2.100.0040.00717.91
8.2.90.0050.00318.94
8.2.80.0070.00317.97
8.2.70.0030.00617.63
8.2.60.0060.00317.93
8.2.50.0030.00618.07
8.2.40.0040.00419.48
8.2.30.0040.00717.57
8.2.20.0030.00617.57
8.2.10.0000.00717.61
8.2.00.0000.00717.68
8.1.280.0110.01125.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0080.00319.16
8.1.230.0110.00018.87
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0080.00018.89
8.1.160.0050.00218.93
8.1.150.0000.00718.68
8.1.140.0000.00717.47
8.1.130.0030.00317.50
8.1.120.0050.00317.48
8.1.110.0040.00417.49
8.1.100.0030.00517.38
8.1.90.0040.00417.37
8.1.80.0040.00417.36
8.1.70.0040.00417.39
8.1.60.0030.00617.47
8.1.50.0050.00317.51
8.1.40.0040.00417.41
8.1.30.0000.00817.48
8.1.20.0050.00517.68
8.1.10.0040.00417.61
8.1.00.0040.00417.43
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.45
8.0.270.0070.00017.31
8.0.260.0030.00316.83
8.0.250.0050.00516.98
8.0.240.0070.00016.93
8.0.230.0040.00416.98
8.0.220.0000.01016.79
8.0.210.0070.00016.89
8.0.200.0060.00016.86
8.0.190.0000.00816.90
8.0.180.0030.00516.96
8.0.170.0040.00416.94
8.0.160.0040.00416.98
8.0.150.0080.00016.96
8.0.140.0040.00416.75
8.0.130.0000.00813.37
8.0.120.0060.00316.78
8.0.110.0020.00516.77
8.0.100.0050.00216.76
8.0.90.0000.00716.95
8.0.80.0090.00916.96
8.0.70.0000.00716.88
8.0.60.0050.00516.87
8.0.50.0000.00716.90
8.0.30.0170.00317.13
8.0.20.0140.00916.86
8.0.10.0030.00517.08
8.0.00.0130.00816.72
7.4.330.0050.00013.05
7.4.320.0000.00616.52
7.4.300.0000.00616.57
7.4.290.0030.00616.52
7.4.280.0070.00016.51
7.4.270.0000.00816.37
7.4.260.0030.00313.30
7.4.250.0050.00316.59
7.4.240.0000.00716.42
7.4.230.0030.00316.48
7.4.220.0170.00716.51
7.4.210.0100.00616.50
7.4.200.0030.00316.41
7.4.190.0000.00816.77
7.4.160.0140.00316.47
7.4.150.0090.00916.43
7.4.140.0110.01117.86
7.4.130.0110.00616.59
7.4.120.0170.00016.60
7.4.110.0130.01016.55
7.4.100.0070.01016.53
7.4.90.0120.01216.42
7.4.80.0210.00319.39
7.4.70.0090.00716.53
7.4.60.0090.00916.36
7.4.50.0020.00216.18
7.4.40.0040.00816.47
7.4.30.0040.01216.51
7.4.00.0070.01014.69
7.3.330.0060.00013.24
7.3.320.0000.00513.22
7.3.310.0030.00316.34
7.3.300.0070.00016.39
7.3.290.0070.00716.36
7.3.280.0070.00716.45
7.3.270.0080.00816.57
7.3.260.0080.01016.62
7.3.240.0100.00716.41
7.3.230.0050.01316.62
7.3.210.0160.00016.51
7.3.200.0100.01016.50
7.3.190.0080.00816.63
7.3.180.0040.01216.59
7.3.170.0030.01416.41
7.3.160.0000.01516.41
7.3.120.0030.01015.08
7.2.330.0070.01016.60
7.2.320.0090.00916.79
7.2.310.0060.01216.67
7.2.300.0100.00516.73
7.2.290.0100.01316.52
7.2.00.0080.00619.38
7.1.100.0040.00818.29
7.1.70.0030.01017.08
7.1.60.0090.01519.21
7.1.50.0170.01734.79
7.1.00.0000.04022.30
7.0.200.0050.00316.86
7.0.140.0030.07322.21
7.0.120.0000.03322.04
7.0.60.0030.07320.05
7.0.50.0030.06717.88
7.0.40.0100.06320.20
7.0.30.0230.06720.10
7.0.20.0470.06320.06
7.0.10.0130.05320.08
7.0.00.0100.08020.20
5.6.280.0030.07320.79
5.6.210.0070.07320.51
5.6.200.0100.05318.16
5.6.190.0000.05720.48
5.6.180.0130.05320.56
5.6.170.0430.06720.45
5.6.160.0030.04020.46
5.6.150.0130.07718.16
5.6.140.0070.07318.18
5.6.130.0100.05018.21
5.6.120.0100.04320.87
5.6.110.0130.06321.00
5.6.100.0100.08021.00
5.6.90.0070.05721.04
5.6.80.0100.07720.37
5.6.70.4330.04020.41
5.5.350.0170.03020.46
5.5.340.0030.06317.98
5.5.330.0070.06720.30
5.5.320.0230.04020.27
5.5.310.0270.05320.34
5.5.300.0070.04318.07
5.5.290.0000.08717.93
5.5.280.0070.05720.70
5.5.270.0170.07320.74
5.5.260.0070.03720.78
5.5.250.0070.08020.63
5.5.240.0070.07320.27
5.4.450.0230.04719.20
5.4.440.3830.03319.32
5.4.430.0100.05319.32
5.4.420.0070.05719.46
5.4.410.0100.05319.31
5.4.400.0200.04319.13
5.4.390.0100.05019.12
5.4.380.0200.05318.80
5.4.370.0070.05718.43
5.4.360.0200.04018.70
5.4.350.0090.03412.03
5.4.340.0060.03512.02
5.4.320.0110.03212.52
5.4.310.0030.04112.52
5.4.300.0060.05112.52
5.4.290.0090.05412.51
5.4.280.0110.05012.41
5.4.270.0110.04512.41
5.4.260.0080.04812.41
5.4.250.0060.04912.41
5.4.240.0080.04512.41
5.4.230.0110.04012.41
5.4.220.0060.04112.40
5.4.210.0060.03912.40
5.4.200.0060.04112.41
5.4.190.0060.04112.40
5.4.180.0090.04312.40
5.4.170.0080.04412.41
5.4.160.0080.04212.41
5.4.150.0070.03912.40
5.4.140.0060.04112.08
5.4.130.0060.04012.07
5.4.120.0070.04012.03
5.4.110.0080.04012.02
5.4.100.0070.04012.02
5.4.90.0060.04312.02
5.4.80.0080.03912.02
5.4.70.0060.03912.02
5.4.60.0070.03912.02
5.4.50.0070.04412.02
5.4.40.0090.03912.00
5.4.30.0090.04512.00
5.4.20.0070.04912.00
5.4.10.0060.04612.00
5.4.00.0070.04511.49
5.3.290.0080.05312.80
5.3.280.0080.04712.71
5.3.270.0080.05012.72
5.3.260.0110.04912.72
5.3.250.0080.04812.72
5.3.240.0070.04812.72
5.3.230.0060.04512.71
5.3.220.0070.04312.68
5.3.210.0080.04512.68
5.3.200.0070.04412.68
5.3.190.0090.05812.67
5.3.180.0080.05412.67
5.3.170.0120.05012.67
5.3.160.0070.04412.67
5.3.150.0080.05312.67
5.3.140.0080.04312.66
5.3.130.0090.05012.66
5.3.120.0090.05012.66
5.3.110.0130.05812.66
5.3.100.0080.04812.12
5.3.90.0070.04912.08
5.3.80.0090.04412.07
5.3.70.0090.04112.07
5.3.60.0070.04212.06
5.3.50.0090.04512.00
5.3.40.0090.04412.00

preferences:
41.81 ms | 401 KiB | 5 Q