Archive for 'PHP' Category
Zend Studio for Eclipse
Right, lets get this out of the way. Zend Studio for Eclipse is a great tool and no other PHP IDEs come near to its level of Intellisense smarts, features, and integration. I’ve been using it steadily since version 5, before it was Eclipse, and I don’t see myself stopping in the future.
That said…
Most code [...]
register_shutdown_function after all the other register_shutdown_functions
PHP’s register_shutdown_function lets me run code after it finishes running the script, be that naturally or forcibly. This makes it a perfect fit for a whole bunch of things, like running maintenance database queries or showing debugging information.
function do_maintenance()
{
$db->doSomeQueries();
}
function debug_write()
{
echo ’some debugging information’;
}
// Last things to execute
register_shutdown_function( ‘do_maintenance’ );
register_shutdown_function( ‘debug_write’ );
There’s [...]
What good are ArrayObjects?
Ever since I had my first encounter with the SPL, it took me a while to understand the actual usefulness of the ArrayObject. Its use isn’t obvious, because it only reveals itself if you want to follow a strict discipline of class encapsulation. Otherwise it doesn’t offer any advantage over the standard PHP array.
A lot [...]