Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.0
-
Fix Version/s: 4.5
-
Component/s: None
-
Labels:
Description
When the return value is immediately cast to boolean (e.g in an if() statement) it is pointless to use CRM_Utils_Array::value(). According to my benchmarking, using empty() is 10 times faster.
Using empty() is also more concise and readable.
Benchmark test attached.
Attachments
Issue Links
- is supplemented by
-
CRM-13288 CRM_Utils_Array::value(): Not outsmarting PHP + Optimization
- Done/Fixed
- links to