Skip to main content
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Web Architecture : Education - Tutorials
Writing efficient PHP
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
2. Writing efficient code

Eliminating empty functions page 7 of 15

Occasionally programmers new to object-oriented development and PHP may define subclasses that contain empty function definitions. This is necessary only if you intend to disable the behavior of a parent class -- generally as a result of a poor design in the first place.

Eliminate any empty functions, such as functions that simply return, and their function calls. The unnecessary overhead of calling a function that does nothing and then returning from it is eliminated.

Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact