diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-12 17:00:20 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-12 17:00:20 +0100 |
commit | 24165a2443e79c43c3c6dc63944a5dbd245f84e6 (patch) | |
tree | 3874ecb7f8fdec98a67e5da7317c733ee556ff6d /documentation | |
parent | 2e241e2215363de22c9e8b832ef414587a8422b3 (diff) |
small documentation changes
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/comparing-objects.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/documentation/comparing-objects.html b/documentation/comparing-objects.html index 2d2c12a..ad8b07f 100644 --- a/documentation/comparing-objects.html +++ b/documentation/comparing-objects.html @@ -10,7 +10,9 @@ classes. With C++ you can achieve the same, but by using technologies like operator overloading, implicit constructors and casting operators. The PHP __invoke() method for example, is more or less identical to operator () - in C++. + in C++. The question that we asked ourselves was whether we should automatically + pass the __invoke PHP method to a C++ operator() call - or use the same + __invoke() method name in C++ too? </p> <p> We have decided to follow the PHP conventions, and use magic methods @@ -19,7 +21,8 @@ pretty. But by using magic methods the switch from PHP to C++ is kept simpler for starting C++ programmers. And on top of that, not all magic methods and interfaces could have been implemented with core C++ features, so we did have - to use <i>some</i> magic methods and/or interfaces anyway. + to use <i>some</i> magic methods and/or interfaces anyway - so we could just + as well follow PHP completely in this. </p> <p> Besides the magic methods and functions, the Zend engine has additional @@ -32,7 +35,7 @@ </p> <p> If you compare two objects in PHP with comparison operators like < ==, != - > (and some others), the Zend engine runs an object comparison function. + > (and the obvious others), the Zend engine runs an object comparison function. The PHP-CPP library interupts this method, and passes the comparison method to the < operator of your class. In other words, if you want to install a custom comparison operator, you can do so by implementing operator<. |