diff --git a/reference/spl/functions/class-implements.xml b/reference/spl/functions/class-implements.xml index 81be83d484..e2e7d29bc4 100755 --- a/reference/spl/functions/class-implements.xml +++ b/reference/spl/functions/class-implements.xml @@ -1,5 +1,5 @@ - + class_implements @@ -32,6 +32,16 @@ + + autoload + + + Whether to allow this function to load the class automatically through + the __autoload magic + method. Defaults to &true;. + + + @@ -59,7 +69,8 @@ 5.1.0 - Added the option to pass the parameter as a string + Added the option to pass the class parameter as + a string. Added the autoload parameter. @@ -82,6 +93,17 @@ class bar implements foo {} print_r(class_implements(new bar)); +// since PHP 5.1 you may also specify the parameter as a string +print_r(class_implements('bar')); + + +function __autoload($class_name) { + require_once $class_name . '.php'; +} + +// use __autoload to load the 'not-loaded' class +print_r(class_implements('not-loaded', true)); + ?> ]]> diff --git a/reference/spl/functions/class-parents.xml b/reference/spl/functions/class-parents.xml index 5efe58fb05..bf72a59c88 100755 --- a/reference/spl/functions/class-parents.xml +++ b/reference/spl/functions/class-parents.xml @@ -1,5 +1,5 @@ - + class_parents @@ -28,7 +28,17 @@ class - An object or a string of the class + An object (class instance) or a string (class name). + + + + + autoload + + + Whether to allow this function to load the class automatically through + the __autoload magic + method. Defaults to &true;. @@ -58,7 +68,8 @@ 5.1.0 - Added the option to pass the parameter as a string + Added the option to pass the class parameter as + a string. Added the autoload parameter. @@ -81,6 +92,16 @@ class bar extends foo {} print_r(class_parents(new bar)); +// since PHP 5.1 you may also specify the parameter as a string +print_r(class_parents('bar')); + + +function __autoload($class_name) { + require_once $class_name . '.php'; +} + +// use __autoload to load the 'not-loaded' class +print_r(class_parents('not-loaded', true)); ?> ]]>