Troels has been crafting web applications, as a freelancer and while employed by companies of various sizes, since around the time of the IT-bubble burst. Nowadays, he's working on backend systems for a Danish ISP. In his spare time, he develops and maintains Konstrukt, a web application framework for PHP, and is the organizer of a monthly PHP-meetup in Copenhagen.
Character Encoding: Issues with Cultural Integration
Ever been stuck trying to shoehorn UTF-8 encoded strings into a Latin1 character set? Troels encountered this problem recently, and this is how he tackled it.
Keeping Current With PHP
Just a quick hint to people with an interest in the development of PHP, but no time for following php-internals. Since March, there has been a wiki at wiki.php.net. The most interesting section is probably wiki.php.net/rfc, which – as the name implies – contains RFC‘s for improvements of the language. I’ve rambled on about closures […]
I just checked in a little project, I’ve been working on for the last couple of weeks. It really begun at the last Copenhagen php-meetup; Joakim Nygård and Jacob Oettinger made a presentation of their project, WebCacheGrind. I casually mentioned something about having played with the dbgp-protocol (The debugging part of Xdebug) and that it […]
Useful in-browser development tools for PHP
While debuggers exists, there isn’t much of a tradition for using them in PHP. People have largely come to rely on injecting debugging code directly into the program, for inspecting program scope. The infamous var_dump have served for this purpose and version 4.3.0 of PHP brought us another equally useful function — debug_backtrace. Tracers and […]
What’s so bad about the Singleton?
I keep running into people who caution against using Singleton and recommend to avoid it like a plague. What is so scary about it? — Kailash Badu It’s a good question, for it is true that global variables are often demonised and more recently the Singleton has befallen the same fate. Perhaps a bit surprising, […]
Dealing with Dependencies
Compositional programming style In the object oriented programming style, it’s preferable to split functionality out to multiple objects, that can work together to solve a single task. Taken to the extreme, this results in more, but smaller, classes and generally relies less on inheritance and more on composition. In lack of better words, I’ll call […]
Lexical scope to appear in PHP?
I mentioned briefly, in my last post, that Wez Furlong made a patch back in March, that allows a native syntax for creating anonymous functions. This could replace the heinous create_function. Since then, I brought up Wez’ original patch again on the php-internals lists. This has prompted some hefty debate over the last week. The […]
The state of functional programming in PHP
PHP Manual CLI style 2.0
Harry mentioned the handy little phpm some three years ago. And Sean Coates was kind enough to point out how it could be replaced with a shell one-liner. Doesn’t that just make one love bash? One thing, I missed with either of the two, was the ability to see the entire manual entry. It’s quite […]
Index of PHP tokens for Emacs and beyond
I’ve been using Emacs as my primary editor for a while now. A lot of people prefer IDE’s, but I’ve never been comfortable with them. I kind of like the ability to show a list of classes & functions in a file though. Emacs can use ctags to generate a list of tokens for a […]