faqts : Computers : Programming : Languages : PHP : kms : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 6 people (67%) answered Yes
Recently 3 of 4 people (75%) answered Yes

Entry

Will PHP return an error if I have a call to an undefined function but that code branch is not run?

Aug 10th, 1999 10:27
Nathan Wallace, prgr@u5.com


In good old compiled languages like C++ you are not allowed to do that.
I would think that it is an approach to be disrecommended - such things
are not a part of the language definition (I assume) so even if it works
now - the PHP-developer team might change it without notice, especially
if they later were to make a "compiler" for php3.

But - why not just write an empty function now and replace it later if
you need? Your code would work just the same - and you are on the safe
side! You can always use 'require' and 'include' to control which files
containing functions that are loaded.