6.0.0-alpha12
6/6/25

[#1705] Don't use array_push
Summary Don't use array_push
Queue Horde Base
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners
Requester selsky (at) columbia (dot) edu
Created 04/07/2005 (7365 days ago)
Due
Updated 04/08/2005 (7364 days ago)
Assigned
Resolved 04/08/2005 (7364 days ago)
Milestone
Patch No

History
04/08/2005 03:26:24 AM Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Committed, thanks.
04/07/2005 06:32:08 PM selsky (at) columbia (dot) edu Comment #4 Reply to this comment
http://us2.php.net/manual/en/function.array-push.php says:



Note: If you use array_push() to add one element to the  array it's 
better to use $array[] = because in that  way there is no overhead of 
calling a function.



I'm not positive that it's applicable here since we're calling 
array(), but array() isn't a real function.



I only submitted this patch since it took 5 seconds and reduced a few 
lines of code that I had added.
04/07/2005 02:35:09 PM Chuck Hagenbuch Comment #3 Reply to this comment
Also, why are you optimizing this script? Does it really cause 
performance problems for you? Just thinking that optimization efforts 
could be better focused elsewhere...
04/07/2005 02:32:16 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Do you have any reference where this is explained? Or did you find 
this from your own benchmarks?
04/07/2005 09:36:03 AM selsky (at) columbia (dot) edu Comment #1
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Don't use array_push
Queue ⇒ Horde Base
New Attachment: remove_prefs.patch Download
Reply to this comment
This removes array_push() calls from scripts/remove_prefs.php since 
that function can be slow.

Saved Queries