Details
Description
There are some methods (full list below) in Zend_Acl class, where optional parameters are used incorrectly - they are not placed on the end of the parameters list, so they are followed by mandatory parameters, which actually makes optional parameters implicitly mandatory. Looks like this is done intentionally to allow passing NULL's instead of actual classes, but has a huge side effect when using Reflection on Zend_Acl.
Here is an example of the wrong behaviour when reflecting the Zend_Acl::_roleDFSVisitAllPrivileges() method:
$method = new ReflectionMethod('Zend_Acl', '_roleDFSVisitAllPrivileges');
$params = $method->getParameters();
echo $params[1]->isOptional() ? 'true' : 'false'; // is $resource parameter optional?
The output is 'false', though 'true' is expected.
I'm not actually sure if this is a ReflectionMethod implementation bug, or a Zend_Acl bug, but it looks like a controversial design to me.
Here is the list of affected methods I discovered:
_roleDFSVisitAllPrivileges
_roleDFSOnePrivilege
_roleDFSVisitOnePrivilege
Please categorize/fix as needed.