Posted by andrejpodzimek on October 9, 2009 at 1:07pm
Jump to:
| Project: | Taxonomy Access Control Lite |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
PHP 5.3.0 revealed that some functions in extension modules require references as parameters, but get values instead. It produces a bunch of warnings.
For example, tac_lite_node_grants() called using call_user_func_array() at includes/module.inc:471 gets its parameters by value, although its declaration expects references. Fortunately, these parameters seem to be neither assigned nor modified in any way, so this doesn't change the semantics.
AFAIK,
- Modules shouldn't get direct references to shared data structures so that they can't modify them. (There's probably nothing like a 'constant reference' in PHP.)
- PHP uses the CoW (Copy on Write) approach when parameters are passed by "value", so there should be no performance penalty compared to passing by "reference", provided that they are not assigned or modified.
If I'm not mistaken, this issue could be resolved by simply removing the &.
Comments
#1
Thanks I'll look into this when back from vacation...
#2
The same problem.
I've got error:
Warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in module_invoke_all() (line 483 of /home/kenorb/websites/doc/trunk/src/includes/module.inc).With PHP 5.3.x
Related issues: #765308: hook_node_view and hook_node_load should not use & in their parameters
#3
Already fixed in HEAD.
#589322: Make tac_lite compatible with PHP 5.3