I hope you know you can declare classes and methods as abstract in most programming languages (including PHP) and if you write high quality object oriented code, I guess you use them quiet often. There is no discussion if they're good or not (at least I hope; and I'd like to hear your opinions). But what about abstract […]
Archive for the ‘PHP internals’ Category
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 […]
Closures vs. code blocks
I wrote a post about lightweight closures couple of days ago, but I didn't realize the real meaning of them. That let most people, including myself, confused. When I read Jakub's blogpost about finally-clause (not English, but you can try using Google Translate) today, I realized what are my lightweight closures really about. Code blocks Saying they were closures wasn't probably […]
Lightweight closures in PHP
I kinda like closures as they are implemented in JavaScript. They're seem so lightweight, easy to use and to write. You don't need much code and you'll get just used to them and use them everywhere. This was not possible before PHP 5.3 and people use tended not to use any kind of callbacks unless really necessary. […]
Diving into PHP core
I was always wondering how difficult it is to program a programming language, what caveats are there in compiling source code and executing bytecode in virtual machine. I always thought it must be so easy, even I just somehow knew it's complicated. So I decided to dive deep into source code of PHP to find adventures and discover all this stuff. […]
Tuning error reporting in PHP
As developers, we see error messages tens or hundreds time a day. Identifying cause of such error is usually the most difficult part after which comes often easy and quick fix. It's therefore crucial to identify that cause as quickly as possible, so that we can focus on real programmer's work. PHP has very simple error reporting […]
Lazy-loading in PHP
Introduction Lazy-loading is a useful design pattern for deferred object loading to the time when it is needed for the first time. It may save some memory, requests to database etc. It is very often used in combination of Object Relational Mapping (ORM), when objects (or object graphs) are mapped into rows in relational database […]

