diff --git a/reference/classobj/functions/call-user-method-array.xml b/reference/classobj/functions/call-user-method-array.xml index d99398d041..aa3e326859 100644 --- a/reference/classobj/functions/call-user-method-array.xml +++ b/reference/classobj/functions/call-user-method-array.xml @@ -1,12 +1,12 @@ - + call_user_method_array Call a user method given with an array of parameters [deprecated] - - Description + + &reftitle.description; mixedcall_user_method_array stringmethod_name @@ -20,15 +20,14 @@ with the array(&$obj, "method_name") syntax instead. + + + &reftitle.seealso; - Calls the method referred by method_name from - the user defined obj object, using the parameters - in paramarr. - - - See also: - call_user_func_array, and - call_user_func. + + call_user_func_array + call_user_func + diff --git a/reference/classobj/functions/call-user-method.xml b/reference/classobj/functions/call-user-method.xml index 99bb18093e..4c3b8b2258 100644 --- a/reference/classobj/functions/call-user-method.xml +++ b/reference/classobj/functions/call-user-method.xml @@ -1,12 +1,12 @@ - + call_user_method Call a user method on an specific object [deprecated] - - Description + + &reftitle.description; mixedcall_user_method stringmethod_name @@ -21,51 +21,15 @@ with the array(&$obj, "method_name") syntax instead. + + + &reftitle.seealso; - Calls the method referred by method_name from - the user defined obj object. An example of usage - is below, where we define a class, instantiate an object and use - call_user_method to call indirectly its - print_info method. + + call_user_func_array + call_user_func + - - - -NAME = $name; - $this->TLD = $tld; - } - - function print_info($prestr = "") - { - echo $prestr . "Country: " . $this->NAME . "\n"; - echo $prestr . "Top Level Domain: " . $this->TLD . "\n"; - } -} - -$cntry = new Country("Peru", "pe"); - -echo "* Calling the object method directly\n"; -$cntry->print_info(); - -echo "\n* Calling the same method indirectly\n"; -call_user_method("print_info", $cntry, "\t"); -?> -]]> - - - - - See also call_user_func_array, and - call_user_func. - diff --git a/reference/classobj/functions/class-exists.xml b/reference/classobj/functions/class-exists.xml index 40996846df..ef1c0f2a04 100644 --- a/reference/classobj/functions/class-exists.xml +++ b/reference/classobj/functions/class-exists.xml @@ -1,22 +1,76 @@ - + class_exists Checks if the class has been defined - - Description + + &reftitle.description; boolclass_exists stringclass_name boolautoload - This function returns &true; if the class given by - class_name has been defined, + This function checks if the given class have been defined. + + + + &reftitle.parameters; + + + + class_name + + + The class name + + + + + autoload + + + Wether to call &link.autoload; or not by default + + + + + + + + &reftitle.returnvalues; + + Returns &true; if class_name is a defined class, &false; otherwise. + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.0.0 + + The autoload was added. + + + + + + + + + &reftitle.examples; <function>class_exists</function> example @@ -32,14 +86,6 @@ if (class_exists('MyClass')) { ]]> - - - class_exists will attempt to call &link.autoload; by - default, if you don't want class_exists to - call &link.autoload;, you can set the parameter autoload - to &false;. - - <parameter>autoload</parameter> parameter example @@ -64,15 +110,15 @@ if (class_exists('MyClass')) { - - - The autoload parameter was added in PHP 5 - - - - See also interface_exists, and - get_declared_classes. - + + + &reftitle.seealso; + + + interface_exists + get_declared_classes + + diff --git a/reference/classobj/functions/get-class-methods.xml b/reference/classobj/functions/get-class-methods.xml index 5de5d2ce0f..5708c2c0e3 100644 --- a/reference/classobj/functions/get-class-methods.xml +++ b/reference/classobj/functions/get-class-methods.xml @@ -1,37 +1,74 @@ - - + get_class_methods - Returns an array of class methods' names + Gets the class methods' names - - Description + + &reftitle.description; arrayget_class_methods mixedclass_name - This function returns an array of method names defined for the - class specified by class_name. - In case of an error, it returns &null; + Gets the class methods names. - - - As of PHP 4.0.6, you can specify the object itself instead of - class_name. For example: - - - -]]> - - - - + + + &reftitle.parameters; + + + + class_name + + + The class name of an object instance + + + + + + + + &reftitle.returnvalues; + + Returns an array of method names defined for the class specified by + class_name. In case of an error, it returns &null;. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.0.0 + + As of PHP 5, this function returns the name of the methods as they + were declared (case-sensitive). In PHP 4 they were lowercased. + + + + 4.0.6 + + The ability of specifying the object itself has been added. + + + + + + + + + &reftitle.examples; <function>get_class_methods</function> example @@ -80,17 +117,16 @@ myfunc2 - - - As of PHP 5, this function returns the name of the methods as they were - declared (case-sensitive). In PHP 4 they were lowercased. - - - - See also get_class, - get_class_vars and - get_object_vars. - + + + &reftitle.seealso; + + + get_class + get_class_vars + get_object_vars + + diff --git a/reference/classobj/functions/get-class-vars.xml b/reference/classobj/functions/get-class-vars.xml index c474499422..dfdb6241b3 100644 --- a/reference/classobj/functions/get-class-vars.xml +++ b/reference/classobj/functions/get-class-vars.xml @@ -1,27 +1,69 @@ - + get_class_vars - Returns an array of default properties of the class + Get the default properties of the class - - Description + + &reftitle.description; arrayget_class_vars stringclass_name - This function will return an associative array of default public - properties of the class. The resulting array elements are in the - form of varname => value. + Get the default properties of the given class. - - - Prior to PHP 4.2.0, Uninitialized class variables will not be reported - by get_class_vars. - - + + + &reftitle.parameters; + + + + class_name + + + The class name + + + + + + + + &reftitle.returnvalues; + + Returns an associative array of default public properties of the class. + The resulting array elements are in the form of + varname => value. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + Prior to 4.2.0 + + Uninitialized class variables will not be reported by + get_class_vars + + + + + + + + + &reftitle.examples; <function>get_class_vars</function> example @@ -72,10 +114,15 @@ var3 : 100 - - See also get_class_methods, - get_object_vars - + + + &reftitle.seealso; + + + get_class_methods + get_object_vars + + diff --git a/reference/classobj/functions/get-class.xml b/reference/classobj/functions/get-class.xml index 29d4a9e84f..df184f0da8 100644 --- a/reference/classobj/functions/get-class.xml +++ b/reference/classobj/functions/get-class.xml @@ -1,35 +1,75 @@ - + get_class Returns the name of the class of an object - - Description + + &reftitle.description; stringget_class - objectobj + objectobject - This function returns the name of the class of which the - object obj is an instance. Returns - &false; if obj is not an object. + Gets the name of the class of the given object. - - - A class defined in a PHP extension is returned in its original notation. - In PHP 4 get_class returns a user defined class - name in lowercase, but in PHP 5 it will return the class name in it's - original notation too, just like class names from PHP extensions. - - - - - Since PHP 5, obj is optional if called from the - object's method. - - + + + &reftitle.parameters; + + + + object + + + The tested object + + + + + + + + &reftitle.returnvalues; + + Returns the name of the class of which object is an + instance. Returns &false; if object is not an + object. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + Since 5.0.0 + + The class name is returned in it's original notation. + + + + Since 5.0.0 + + The object parameter is optional if called + from the object's method. + + + + + + + + + &reftitle.examples; Using <function>get_class</function> @@ -70,10 +110,15 @@ My name is foo + + + &reftitle.seealso; - See also get_parent_class, - gettype, and - is_subclass_of. + + get_parent_class + gettype + is_subclass_of + diff --git a/reference/classobj/functions/get-declared-classes.xml b/reference/classobj/functions/get-declared-classes.xml index 50c821dc9e..2b37fd6c10 100644 --- a/reference/classobj/functions/get-declared-classes.xml +++ b/reference/classobj/functions/get-declared-classes.xml @@ -1,19 +1,25 @@ - + get_declared_classes Returns an array with the name of the defined classes - - Description + + &reftitle.description; arrayget_declared_classes - This function returns an array of the names of the declared classes - in the current script. + Gets the declared classes. + + + + &reftitle.returnvalues; + + Returns an array of the names of the declared classes in the current + script. @@ -34,6 +40,9 @@ the appendices. + + + &reftitle.examples; <function>get_declared_classes</function> example @@ -57,10 +66,15 @@ Array - - See also class_exists, and - get_declared_interfaces. - + + + &reftitle.seealso; + + + class_exists + get_declared_interfaces + + diff --git a/reference/classobj/functions/get-declared-interfaces.xml b/reference/classobj/functions/get-declared-interfaces.xml index ddbbdeda85..a2b5041eb1 100644 --- a/reference/classobj/functions/get-declared-interfaces.xml +++ b/reference/classobj/functions/get-declared-interfaces.xml @@ -1,20 +1,29 @@ - + get_declared_interfaces Returns an array of all declared interfaces - - Description + + &reftitle.description; arrayget_declared_interfaces - This function returns an array of the names of the declared interfaces - in the current script. + Gets the declared interfaces. + + + &reftitle.returnvalues; + + Returns an array of the names of the declared interfaces in the current + script. + + + + &reftitle.examples; <function>get_declared_interfaces</function> example @@ -42,9 +51,14 @@ Array - - See also get_declared_classes. - + + + &reftitle.seealso; + + + get_declared_classes + + diff --git a/reference/classobj/functions/get-object-vars.xml b/reference/classobj/functions/get-object-vars.xml index 265a53f95b..f3a73ba626 100644 --- a/reference/classobj/functions/get-object-vars.xml +++ b/reference/classobj/functions/get-object-vars.xml @@ -1,28 +1,70 @@ - + get_object_vars - Returns an associative array of object properties + Gets the properties of the given object - - Description + + &reftitle.description; arrayget_object_vars - objectobj + objectobject - This function returns an associative array of defined object properties - for the specified object obj. + Gets the properties of the given object. - - - In versions prior to PHP 4.2.0, if the variables declared in the class - of which the obj is an instance, have not been - assigned a value, those will not be returned in the array. In versions - after PHP 4.2.0, the key will be assigned with a &null; value. - - + + + &reftitle.parameters; + + + + object + + + An object instance. + + + + + + + + &reftitle.returnvalues; + + Returns an associative array of defined object properties for the + specified object. If a property have not been + assigned a value, it will be returned with a &null; value. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + prior to 4.2.0 + + If the variables declared in the class of which the + object is an instance, have not been assigned a + value, those will not be returned in the array + + + + + + + + + &reftitle.examples; Use of <function>get_object_vars</function> @@ -82,10 +124,15 @@ print_r(get_object_vars($p1)); - - See also get_class_methods and - get_class_vars. - + + + &reftitle.seealso; + + + get_class_methods + get_class_vars + + diff --git a/reference/classobj/functions/get-parent-class.xml b/reference/classobj/functions/get-parent-class.xml index 28871b5421..2e4742b89f 100644 --- a/reference/classobj/functions/get-parent-class.xml +++ b/reference/classobj/functions/get-parent-class.xml @@ -1,34 +1,85 @@ - + get_parent_class Retrieves the parent class name for object or class - - Description + + &reftitle.description; stringget_parent_class - mixedobj + mixedobject - If obj is an object, returns the name of the - parent class of the class of which obj is an - instance. + Retrieves the parent class name for object or class. + + + + &reftitle.parameters; + + + + object + + + The tested object or class name + + + + + + + + &reftitle.returnvalues; + + Returns the name of the parent class of the class of which + object is an instance or the name. - If obj is a string, returns the name of the parent - class of the class with that name. This functionality was added in PHP - 4.0.5. + If called without parameter outside object, this function returns &false;. - - - Since PHP 5, obj is optional if called from the - object's method. - If called without parameter outside object, this function returns - &false; (or &null; with a warning before PHP 5.1.0). - - + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + Before 5.1.0 + + If called without parameter outside object, this function would have + returned &null; with a warning. + + + + Since 5.0.0 + + The object parameter is optional if called + from the object's method. + + + + Since 4.0.5 + + If object is a string, returns the name of the + parent class of the class with that name. + + + + + + + + + &reftitle.examples; Using <function>get_parent_class</function> @@ -72,9 +123,14 @@ I'm dad's son too + + + &reftitle.seealso; - See also get_class and - is_subclass_of. + + get_class + is_subclass_of + diff --git a/reference/classobj/functions/interface-exists.xml b/reference/classobj/functions/interface-exists.xml index 95756c2be0..44ca31dff4 100644 --- a/reference/classobj/functions/interface-exists.xml +++ b/reference/classobj/functions/interface-exists.xml @@ -1,22 +1,53 @@ - + interface_exists Checks if the interface has been defined - - Description + + &reftitle.description; boolinterface_exists stringinterface_name boolautoload - This function returns &true; if the interface given by - interface_name has been defined, - &false; otherwise. + Checks if the given interface has been defined. + + + &reftitle.parameters; + + + + interface_name + + + The interface name + + + + + autoload + + + Wether to call &link.autoload; or not by default + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the interface given by + interface_name has been defined, &false; otherwise. + + + + &reftitle.examples; <function>interface_exists</function> example @@ -36,15 +67,14 @@ if (interface_exists('MyInterface')) { + + + &reftitle.seealso; - interface_exists will attempt to call &link.autoload; by - default, if you don't want interface_exists to - call &link.autoload;, you can set the parameter autoload - to &false;. + + class_exists + - - See also class_exists. - diff --git a/reference/classobj/functions/is-a.xml b/reference/classobj/functions/is-a.xml index ff3802d708..9126202a61 100644 --- a/reference/classobj/functions/is-a.xml +++ b/reference/classobj/functions/is-a.xml @@ -1,21 +1,61 @@ - + is_a - Returns &true; if the object is of this class or has this class as one of its parents + Checks if the object is of this class or has this class as one of its parents - - Description + + &reftitle.description; boolis_a objectobject stringclass_name - This function returns &true; if the object is of this class or - has this class as one of its parents, &false; otherwise. + Checks if the given object is of this class or has + this class as one of its parents. + + + The is_a function is deprecated as of PHP 5 in + favor of the instanceof + type operator. + + + + + &reftitle.parameters; + + + + object + + + The tested object + + + + + class_name + + + The class name + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the object is of this class or has this class as one of + its parents, &false; otherwise. + + + + &reftitle.examples; <function>is_a</function> example @@ -38,14 +78,6 @@ if (is_a($WF, 'WidgetFactory')) { ]]> - - - The is_a function is deprecated as of PHP 5 in - favor of the instanceof - type operator. In the above example we could use the following in - PHP 5: - - Using the <emphasis>instanceof</emphasis> operator in PHP 5 @@ -59,11 +91,16 @@ if ($WF instanceof WidgetFactory) { - - See also get_class, - get_parent_class, and - is_subclass_of. - + + + &reftitle.seealso; + + + get_class + get_parent_class + is_subclass_of + + diff --git a/reference/classobj/functions/is-subclass-of.xml b/reference/classobj/functions/is-subclass-of.xml index ec60d7f93b..ac3ebb62c9 100644 --- a/reference/classobj/functions/is-subclass-of.xml +++ b/reference/classobj/functions/is-subclass-of.xml @@ -1,28 +1,79 @@ - + is_subclass_of - Returns &true; if the object has this class as one of its parents + Checks if the object has this class as one of its parents - - Description + + &reftitle.description; boolis_subclass_of mixedobject stringclass_name - This function returns &true; if the object - object, belongs to a class which is a - subclass of class_name, &false; otherwise. + Checks if the given object has the class + class_name as one of its parents. - - - Since PHP 5.0.3 you may also specify the object - parameter as a string (the name of the class). - - + + + &reftitle.parameters; + + + + object + + + A class name or an object instance + + + + + class_name + + + The class name + + + + + + + + &reftitle.returnvalues; + + This function returns &true; if the object object, + belongs to a class which is a subclass of + class_name, &false; otherwise. + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.0.3 + + You may also specify the object parameter as a + string (the name of the class) + + + + + + + + + &reftitle.examples; <function>is_subclass_of</function> example @@ -78,11 +129,16 @@ yes, WidgetFactory_Child is a subclass of WidgetFactory - - See also get_class, - get_parent_class and - is_a. - + + + &reftitle.seealso; + + + get_class + get_parent_class + is_a + + diff --git a/reference/classobj/functions/method-exists.xml b/reference/classobj/functions/method-exists.xml index 450d485a28..bedb7480d8 100644 --- a/reference/classobj/functions/method-exists.xml +++ b/reference/classobj/functions/method-exists.xml @@ -1,22 +1,55 @@ - + method_exists Checks if the class method exists - - Description + + &reftitle.description; boolmethod_exists objectobject stringmethod_name - This function returns &true; if the method given by - method_name has been defined for the given - object, &false; otherwise. + Checks if the class method exists in the given + object. + + + &reftitle.parameters; + + + + object + + + An object instance + + + + + method_name + + + The method name + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the method given by method_name + has been defined for the given object, &false; + otherwise. + + + + &reftitle.examples; <function>method_exists</function> example @@ -36,9 +69,14 @@ bool(true) + + + &reftitle.seealso; - See also function_exists and - is_callable. + + function_exists + is_callable + diff --git a/reference/classobj/functions/property-exists.xml b/reference/classobj/functions/property-exists.xml index 050fbfc139..83481c4dc3 100755 --- a/reference/classobj/functions/property-exists.xml +++ b/reference/classobj/functions/property-exists.xml @@ -1,5 +1,5 @@ - + property_exists @@ -34,7 +34,7 @@ class - A string with the class name or an object of the class to test for + The class name or an object of the class to test for