11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

www.it-ebooks.infoCHAPTER 6 • OBJECT-ORIENTED <strong>PHP</strong>Creating a Class AliasThe class_alias() function creates a class alias, allowing the class to be referred to by more than onename. Its prototype follows:boolean class_alias(string originalClassName, string aliasName)This function was introduced in <strong>PHP</strong> 5.3.Determining Whether a Class ExistsThe class_exists() function returns TRUE if the class specified by class_name exists within thecurrently executing script context and returns FALSE otherwise. Its prototype follows:boolean class_exists(string class_name)Determining Object ContextThe get_class() function returns the name of the class to which object belongs and returns FALSE ifobject is not an object. Its prototype follows:string get_class(object object)Learning about Class MethodsThe get_class_methods() function returns an array containing all method names defined by the classclass_name. Its prototype follows:array get_class_methods(mixed class_name)Learning about Class PropertiesThe get_class_vars() function returns an associative array containing the names of all properties andtheir corresponding values defined within the class specified by class_name. Its prototype follows:array get_class_vars(string class_name)Learning about Declared ClassesThe function get_declared_classes() returns an array containing the names of all classes defined withinthe currently executing script. The output of this function will vary according to how your <strong>PHP</strong>distribution is configured. For instance, executing get_declared_classes() on a test server produces alist of 97 classes. Its prototype follows:array get_declared_classes(void)155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!