In C++, it's possible to declare member functions "const" meaning they don't
change the object they operate on. This can help reason about programs,
because if you have something like (PHP syntax):

It would be pretty hard to enforce in PHP - how do you know the object is not changed, without strictly typing all the functions that access it? Also, while in C++ compiler can benefit from knowing the function is const - i.e. from knowing nothing was changed by it regarding this argument - PHP engine hardly can do it.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to