Archive for the ‘PHP extensions’ Category

Mock vs final fights in testing

There has always been a war between testers, who love mocking all classes, and library developers, who prevent misusing their code by means of final keyword. You cannot do both. Once a class (or method) is declared as final, it cannot be mocked (extended). Since testers need to test their applications built on top of […]

Optimizing class cache in PHP

Some time ago I read an article about hacking PHP internals to improve its performance. I liked the idea of avoiding unnecessary syscalls, because context switching is considered to be quiet expensive operation. And I realized there is quiet significant amount of work which needs be performed with class autoloading. So I decided to hack it and make it […]

Weak references in PHP

Today was created a new PECL package, which brings weak references to PHP. Weak references had already an RFC asking for their support in coming PHP 5.4, which was however not very perceived by PHP core developers. As they suggested, such a new feature which doesn't need changes in Zend Enginge (backend of PHP) should […]