Polymorphism and Self-Modifying Code

The drawbacks of variable function names (and partially variable variable names) is that you always have to have a "fixed" part of the program (in the case of variable function names, a list of previously declared functions that you can use) and then a "variable" part (the part that constructs the function names into a variable and then calls the function whose name has been constructed). This implies that for every possible constructed name, you have to create a function beforehand in order to let the program operate correctly—kind of restricting.

This can be overcome by completely dynamic programs—programs that generate themselves on the fly. Originally, this was an idea from the "early" days of programming, ...

Get Web Application Development with PHP 4.0 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.