Somehow I thought the singleton pattern would be pretty useful for my Request and Response classes, because they’re unique things and there should be only one object of them. They shouldn’t get initialized over and over again. PHP is request based, which means, once you got the output of your php script, the request is finished. Reloading the page will just cause a new request. That means if you write a Request or a Response class it doesn’t make much sense to initialize them more than once. At least, that’s my opinion.
In my last blog-entry you’ve seen that I compared regexp vs nonregexp-techniques and the result was, that there are „bad“ and „good“ regexp; while the good regexp are as fast as non-regexp-techniques. Let’s take a closer look at what „good“ regexp are. Please notice that I’m not a regexp-magician so if you know about a regexp which would do better than the regexp I’ll show, please let me know.
Yesterday I was talking with Sven about my Imap-Class and I told him that I switched regexp to non-regexp to gain performance. He was asking me whether the use of str* is really faster than the use of regexp in PHP and thus he said „you could write an entry about that in your blog, I’d be interested“ – Hey Sven, here you go.
some time ago I wrote a small document about MySQL’s COALESCE usage. Today I was asked to help with such a construct for a similar usage-scenario. Here’s the result:
Currently I’m working on some sort of shipping-system for a customer. It turned out that i was spending 3 days looking for a problem with my query while there was no problem. Well, apart from phpmyadmin 🙂 But, lemme tell you later about it.