Closed (won't fix)
Project:
Drupal core
Version:
x.y.z
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 May 2006 at 01:37 UTC
Updated:
3 Nov 2006 at 17:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
pwolanin commentedAttached is a first attempt to document this better.
Comment #2
drummI would like to see a notice about how theme functions should never use pass by reference in their implementations (despite apparently being possible with PHP 5). That would make code a bit unpredictable and incomaptible with 4.
Comment #3
pwolanin commentedYes, I agree- but I wan't sure how/where to include this. Suggestions welcome.
Comment #4
pwolanin commentedOk- added more to the attached (if it's not overkill). In terms of PHP 5 behavior is that it seems all objects (like $node) are passed by reference in PHP 5. See, for example, http://www.php.net/manual/en/language.oop5.basic.php#51624
I'm new to PHP programming, but this difference between PHP 4 and PHP 5 seems like it could cause some subtle bugs if drupal code is developed on one and then used on the other?
Comment #5
pwolanin commentedre-reading this, the wording seem good enough- any comments?
Comment #6
chx commentedFirst of all, only objects are passed by reference. And regardless of PHP version because
theme()does not define any references the arguments are not taken by reference. So if you want to mention this, then specify objects in the comment but I do not think this needs commenting because it's a well known fact that PHP5 works this way. We do not need to restate PHP documentation in the comments. We only mention PHP bugs.