Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

interface_exists(3) [php man page]

INTERFACE_EXISTS(3)							 1						       INTERFACE_EXISTS(3)

interface_exists - Checks if the interface has been defined

SYNOPSIS
bool interface_exists (string $interface_name, [bool $autoload = true]) DESCRIPTION
Checks if the given interface has been defined. PARAMETERS
o $interface_name - The interface name o $autoload - Whether to call __autoload or not by default. RETURN VALUES
Returns TRUE if the interface given by $interface_name has been defined, FALSE otherwise. EXAMPLES
Example #1 interface_exists(3) example <?php // Check the interface exists before trying to use it if (interface_exists('MyInterface')) { class MyClass implements MyInterface { // Methods } } ?> SEE ALSO
get_declared_interfaces(3), class_implements(3), class_exists(3). PHP Documentation Group INTERFACE_EXISTS(3)

Check Out this Related Man Page

CLASS_PARENTS(3)							 1							  CLASS_PARENTS(3)

class_parents - Return the parent classes of the given class

SYNOPSIS
array class_parents (mixed $class, [bool $autoload = true]) DESCRIPTION
This function returns an array with the name of the parent classes of the given $class. PARAMETERS
o $class - An object (class instance) or a string (class name). o $autoload - Whether to allow this function to load the class automatically through the __autoload(3) magic method. RETURN VALUES
An array on success, or FALSE on error. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | Added the option to pass the $class parameter as | | | a string. Added the $autoload parameter. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 class_parents(3) example <?php class foo { } class bar extends foo {} print_r(class_parents(new bar)); // since PHP 5.1.0 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)); ?> The above example will output something similar to: Array ( [foo] => foo ) Array ( [parent_of_not_loaded] => parent_of_not_loaded ) SEE ALSO
class_implements(3). PHP Documentation Group CLASS_PARENTS(3)
Man Page