From 6e133c0d53cf2cbfb92f64422021ebb5b76d3e5e Mon Sep 17 00:00:00 2001 From: Daniel Egeberg Date: Sun, 15 Aug 2010 07:39:53 +0000 Subject: [PATCH] Fixed PHP bug #52494 (description of keyword "new") git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@302259 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop5/basic.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/language/oop5/basic.xml b/language/oop5/basic.xml index ea870323c7..f185089a65 100644 --- a/language/oop5/basic.xml +++ b/language/oop5/basic.xml @@ -111,14 +111,19 @@ $this is not defined. new - To create an instance of a class, a new object must be created and - assigned to a variable. An object will always be assigned when - creating a new object unless the object has a + To create an instance of a class, the new keyword must + be used. An object will always be created when unless the object has a constructor defined that throws an exception on error. Classes should be defined before instantiation (and in some cases this is a requirement). + + If a string containing the name of a class is used with + new, a new instance of that class will be created. If + the class is in a namespace, its fully qualified name must be used when + doing this. + Creating an instance