@ 2021-09-08T08:21:42Z <?php
class UserDefinedClass{}
class DynamicObject{}
$ud_obj = new UserDefinedClass();
$do_obj = new DynamicObject();
$sc_obj = new stdClass();
$a_obj = (object)array();
echo "===[get_class()]===\n";
printf( "UserDefinedClass Object Class: %s\n", get_class($ud_obj));
printf( "DynamicObject Object Class: %s\n", get_class($do_obj));
printf( "StdClass Object Class: %s\n", get_class($sc_obj));
printf( "Array-derived Object Class: %s\n", get_class($a_obj));
echo "\n===[gettype()]===\n";
printf( "UserDefinedClass Object Type: %s\n", gettype($ud_obj));
printf( "DynamicObject Object Type: %s\n", gettype($do_obj));
printf( "StdClass Object Type: %s\n", gettype($sc_obj));
printf( "Array-derived Object Type: %s\n", gettype($a_obj));
echo "\n===[is_a(stdClass::class)]===\n";
printf( "UserDefinedClass Object Type: %s\n", is_a($ud_obj,stdClass::class));
printf( "DynamicObject Object Type: %s\n", is_a($do_obj,stdClass::class));
printf( "StdClass Object Type: %s\n", is_a($sc_obj,stdClass::class));
printf( "Array-derived Object Type: %s\n", is_a($a_obj,stdClass::class));
echo "\n===[instanceof stdClass]===\n";
printf( "UserDefinedClass Object Type: %s\n", $ud_obj instanceof stdClass);
printf( "DynamicObject Object Type: %s\n", $do_obj instanceof stdClass);
printf( "StdClass Object Type: %s\n", $sc_obj instanceof stdClass);
printf( "Array-derived Object Type: %s\n", $a_obj instanceof stdClass);
echo "\n===[is_a(DynamicObject::class)]===\n";
printf( "UserDefinedClass Object Type: %s\n", is_a($ud_obj,DynamicObject::class));
printf( "DynamicObject Object Type: %s\n", is_a($do_obj,DynamicObject::class));
printf( "DynamicObject Object Type: %s\n", is_a($sc_obj,DynamicObject::class));
printf( "Array-derived Object Type: %s\n", is_a($a_obj,DynamicObject::class));
echo "\n===[instanceof DynamicObject]===\n";
printf( "UserDefinedClass Object Type: %s\n", $ud_obj instanceof DynamicObject);
printf( "DynamicObject Object Type: %s\n", $do_obj instanceof DynamicObject);
printf( "DynamicObject Object Type: %s\n", $sc_obj instanceof DynamicObject);
printf( "Array-derived Object Type: %s\n", $a_obj instanceof DynamicObject);
echo "\n===[is_subclass_of(stdClass::class)]===\n";
printf( "UserDefinedClass Object Type: %s\n", is_subclass_of($ud_obj,stdClass::class));
printf( "DynamicObject Object Type: %s\n", is_subclass_of($do_obj,stdClass::class));
printf( "StdClass Object Type: %s\n", is_subclass_of($sc_obj,stdClass::class));
printf( "Array-derived Object Type: %s\n", is_subclass_of($a_obj,stdClass::class));
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
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).
Version System time (s) User time (s) Memory (MiB) 8.4.2 0.006 0.013 19.53 8.4.1 0.011 0.000 19.56 8.3.15 0.016 0.003 19.08 8.3.14 0.008 0.000 20.74 8.3.13 0.003 0.005 18.60 8.3.12 0.004 0.004 19.08 8.3.11 0.009 0.000 20.94 8.3.10 0.009 0.009 24.06 8.3.9 0.013 0.006 26.77 8.3.8 0.004 0.004 16.63 8.3.7 0.009 0.006 16.75 8.3.6 0.008 0.008 18.40 8.3.5 0.007 0.007 18.40 8.3.4 0.011 0.011 21.73 8.3.3 0.003 0.013 18.76 8.3.2 0.005 0.002 24.18 8.3.1 0.008 0.000 24.66 8.3.0 0.005 0.003 26.16 8.2.26 0.007 0.011 18.88 8.2.25 0.006 0.003 16.62 8.2.24 0.004 0.004 17.21 8.2.23 0.004 0.004 22.58 8.2.22 0.004 0.004 37.54 8.2.21 0.011 0.003 26.77 8.2.20 0.006 0.003 17.00 8.2.19 0.012 0.006 18.54 8.2.18 0.012 0.006 25.92 8.2.17 0.008 0.008 19.08 8.2.16 0.007 0.007 22.96 8.2.15 0.004 0.004 25.66 8.2.14 0.004 0.004 24.66 8.2.13 0.008 0.000 26.16 8.2.12 0.004 0.004 21.05 8.2.11 0.007 0.003 20.47 8.2.10 0.000 0.010 20.63 8.1.31 0.006 0.003 16.94 8.1.30 0.006 0.003 17.95 8.1.29 0.000 0.008 18.88 8.1.28 0.009 0.009 25.92 8.1.27 0.008 0.000 23.99 8.1.26 0.004 0.004 26.35 8.1.25 0.005 0.003 28.09 8.1.24 0.003 0.006 23.82 8.1.23 0.011 0.011 20.28 8.0.10 0.004 0.004 17.03
preferences:dark mode live preview
33.92 ms | 403 KiB | 5 Q