One thing I often see when re-factoring PHP applications, is the improper use of the method_exists() function, and I think this needs a little bit of clarification.
Continue reading
Category Archives: php
Improving performance with return values caching
Many functions (and methods) in a project will often provide the same return value for the same arguments, like:
- mathematical functions:
1 2 3 4 | function someMaths( $x ) { return $x + pow( $x , 3.2) - cos ( $x ); } |
- functions which retrieve content from a file: