Tagged With: php
Netbeans vs Vim … round 1 … fight
So, I think I’ve changed ‘editor’. Perhaps this is a bit like an engineer changing their calculator or something. For the last 10 years, I’ve effectively only used ‘vim‘ for development of any PHP code I work on. I felt I was best served using something like vim – where the interface was uncluttered, everything … Continue reading
A week of fire fighting (aka why you should <3 unit tests).
I feel like I’ve spent most of this week debugging some PHP code, and writing unit tests for it. Thankfully I think this firefighting exercise is nearly over. Perhaps the alarm bells should have been going off a bit more in my head when it was implied that the code was being written in a … Continue reading
Zend_Cache – automatic cache cleaning can be bad, mmkay?
$customer uses Zend_Cache in their codebase – and I noticed that every so often a page request would take ~5 seeconds (for no apparent reason), while normally they take < 1 second … Some rummaging and profiling with xdebug showed that some requests looked like : Note how there are 25,000 or so calls for … Continue reading
A caching PHP autoloader
This is probably of little use to normal people, or even many PHP programmers – unless you have more than a handful of directories to rummage through when __autoload()’ing PHP class files. I’ve sometimes found myself rummaging through 10-15, and this has a performance impact. Some random code which uses APC to cache a lookup … Continue reading
Late to the performance party
Everyone else probably already knows this, but $project is/was doing two queries on the MySQL database every time the end user typed in something to search on to get the data between a set range (SELECT x,y….. LIMIT n, OFFSET m or whatever) and another to get the total count of records (SELECT count(field) ….). … Continue reading
Still looking for a PHP contractor….
At work I’m still looking for a short term PHP contractor. Perhaps I’m being unrealistic in my expectations/requirements (rate/location/duration/skills etc), but nevertheless…. As I’ve not found anyone via normal channels (twitter/phpwm user group etc) I thought I’d turn to a random recruitment agency (who I’d spoken to a week or so ago). Yesterday I interviewed … Continue reading
Random PHP project progress
Random php development musing Continue reading
PHP array and object addition and string indexing
While reading someone’s code, I came across the following sort of thing: function foo($config = array()) { $this->_config += $config; //… } To which I thought WTF? How does PHP cast an array to a number to perform addition? A few random tests later, it appears PHP joins the two arrays together, only adding indexes … Continue reading