From dfd505867630f0d8e7c45f52415f8aba3b3c2dba Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Thu, 6 Mar 2014 16:08:35 +0100 Subject: changes to documentation --- documentation/constructors-and-destructors.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'documentation/constructors-and-destructors.html') diff --git a/documentation/constructors-and-destructors.html b/documentation/constructors-and-destructors.html index 0453e5f..292aa60 100644 --- a/documentation/constructors-and-destructors.html +++ b/documentation/constructors-and-destructors.html @@ -1,6 +1,6 @@

Constructors and destructors

- There is a small but very important difference between constructor and + There is a small but very important difference between constructors and destructors in C++, and the __construct() and __destruct() methods in PHP.

@@ -314,16 +314,16 @@ extern "C" { In the code above we made the __construct() function of the Counter class private. This makes it impossible to create instances of this class - both from PHP user scripts, and via calls to Php::Object("Counter") - because - constructing objects in this way will eventually also result in a __construct() - call. + constructing objects in these ways will eventually result in a forbidden + __construct() call.

The Php::Object does have an alternative syntax that takes a pointer - to a C++ class (allocated on the heap, with operator new!), and that turns + to a C++ class (allocated on the heap, with operator new!) and that turns this pointer into a PHP variable without calling the __construct() method. Notice that you must also specify the classname, because C++ classes do not have any information about themselves (like their - name), while in a PHP such information is required to handle reflection and + name), while in PHP such information is required to handle reflection and functions like get_class().

Other magic methods

-- cgit v1.2.3