6.0.0-RC7
6/29/26

[#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 4/7/05 (7753 days ago)
Due
Updated 4/8/05 (7752 days ago)
Assigned
Resolved 4/8/05 (7752 days ago)
Milestone
Patch No

History
243 Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Committed, thanks.
86 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.
92 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...
162 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?
39 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