diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-16 21:38:07 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-16 21:38:07 +0100 |
commit | 630bf170ead85cfce5de05902357a31675917580 (patch) | |
tree | 461cbdf14eddbb9c42b96c17655b5582d23758ca /documentation | |
parent | 8e3653eef9b7f31bf4eaa78c95453f6e6cbfd657 (diff) |
documentation update
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/special-features.html | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/documentation/special-features.html b/documentation/special-features.html index 763f30d..859431a 100644 --- a/documentation/special-features.html +++ b/documentation/special-features.html @@ -5,9 +5,9 @@ conventions for many of the library features. </p> <p> - PHP uses <a href="magic-methods">magic methods</a> and + In PHP scripts you can use <a href="magic-methods">magic methods</a> and <a href="magic-interfaces">magic interfaces</a> to add special behavior to - classes. With C++ you can achieve the same, but by using technologies like + classes. With C++ classes 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++. The question that we asked ourselves was whether we should automatically @@ -17,18 +17,22 @@ <p> We have decided to follow the PHP conventions, and use magic methods and magic interfaces in C++ as well - although we must admit that having - methods that start with two underscores does not make the code very + methods that start with two underscores does not make the code look very 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 - so we could just - as well follow PHP completely in this. + interfaces could have been implemented with core C++ features (like operator + overloading), so we had to use <i>some</i> magic methods and/or interfaces + anyway. That's why we decided that because we had to use _some_ magic methods + in C++, we could just as well follow PHP completely and support _all_ magic + PHP methods in C++ too. </p> <p> - Besides the magic methods and interfaces that are also available in PHP - user space, the Zend engine has additional features that are not exposed via - magic methods, and that only are accessible for extension programmers. These - features available for extensions built with PHP-CPP. + Besides the magic methods and interfaces that are available in PHP + user space, the Zend engine has additional features that are not exposed to + PHP user space scripts. Features that are only accessible for extension + programmers. The PHP-CPP library also supports these special features. This + means that if you use PHP-CPP for writing functions and classes, you can + achieve things that can not be achieved by writing pure PHP code. </p> <h2 id="casting-functions">Extra casting functions</h2> <p> |