Monthly Archives: November 2010

You are browsing the site archives by month.

MySQL connections in Zend Studio 8.0

Recently I was having problems to get my unit tests to connect to my local MySQL server when ran within Zend Studio 8. After some reading on the internet it seems, that this issue is caused by the MySQL server running on the default port (3306). I’ve changed this to 8889 as MAMP (on mac) suggests and now it works like a charm.

call_user_func(_array) behaviour in PHP 5.3

Before PHP 5.3 you could use call_user_func and call_user_func_array even if you didnt provide an array with parameters. Since 5.3, this results in a ‘NULL’ without actually executing this method/function.

// works in < 5.3, but fails in > 5.3
$moduleItems = call_user_func_array(array($className, ‘getByTag’), $this->id);

// works everywhere
$moduleItems = call_user_func(array($className, ‘getByTag’), $this->id);

In all honesty, it’s normal that it shouldn’t work when you don’t provide the right parameters. However a decent notice would let me know that something is wrong.