Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.6.5

Request #2054 page content is copied unnecessarily
Submitted: 2004-08-04 15:16 UTC
From: thomas-frank at gmx dot de Assigned: iwarner
Status: Closed Package: HTML_Page2
PHP Version: 4.3.3 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-08-04 15:16 UTC] thomas-frank at gmx dot de
Description: ------------ In HTML_Page2::_generateBody() and here in HTML_Page2::_elementToHtml(): If the element is an array you iterate through the items with 'foreach', which creates a copy of each array item, before finally calling e.g. toHtml() on the item.

Comments

 [2004-08-04 15:24 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-08-05 07:02 UTC] thomas-frank at gmx dot de
I think a problem may arise e.g. if one manipulates larger amounts of member data within the toHtml() of an Object. OK - this may not be a good design, but I think one shouldn't be forced to take care of this anyway. When I call addBodyContent() explicitly with a reference, I expect that HTML_Page2 stores and uses exclusively this reference. One general solution to avoid copies on array iteration is e.g.: $myArray=array( ... ); ... foreach ( array_keys( $myArray ) as $k ) { do_something_with( &$myArray[$k] ); echo $myArray[$k]->toHtml(); ... }
 [2005-03-24 18:44 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2006-11-01 04:18 UTC] iwarner at php dot net (Ian Warner)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.