From f5ca557b90286fda486a4353e7446bccf5c1031d Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 16 Apr 2008 16:31:45 +0000 Subject: [PATCH] - Added information about NULL as the default parameter value git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@257695 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop5/typehinting.xml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/language/oop5/typehinting.xml b/language/oop5/typehinting.xml index 5a2cb930b5..fe1ae2fe40 100644 --- a/language/oop5/typehinting.xml +++ b/language/oop5/typehinting.xml @@ -1,11 +1,13 @@ - + Type Hinting PHP 5 introduces Type Hinting. Functions are now able to force parameters to be objects (by specifying the name of the class in the function - prototype) or arrays (since PHP 5.1). + prototype) or arrays (since PHP 5.1). However, if NULL is used + as the default parameter value, it will be allowed as an argument for any + later call. @@ -97,6 +99,24 @@ function MyFunction (MyClass $foo) { // Works $myclass = new MyClass; MyFunction($myclass); +?> +]]> + + + Type hinting allowing NULL value: + + + ]]>