From: Andrey Hristov Date: Sat, 24 Jan 2004 00:14:43 +0000 (+0000) Subject: Adding note about declaration first use after that for classes. X-Git-Tag: php_ibase_before_split~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85de35e47081217f5a72bd79644cdca796e4315a;p=php Adding note about declaration first use after that for classes. #I had no time recently to add this but since a user complained on #internals.... --- diff --git a/README.PHP4-TO-PHP5-THIN-CHANGES b/README.PHP4-TO-PHP5-THIN-CHANGES index 0ef64e40fe..a8caec956e 100644 --- a/README.PHP4-TO-PHP5-THIN-CHANGES +++ b/README.PHP4-TO-PHP5-THIN-CHANGES @@ -52,3 +52,19 @@ always make argc and argv available in the CLI version regardless of the variables_order setting. As in, the CLI version will now always populate the global $argc and $argv variables. + +8. Classes should be declared before used : + echo(); + + class fubar { + function echo() { + echo 'fubar'; + } + } + ?> + This script is perfectly valid and works in PHP4 but with PHP5 there + will be a fatal error like : + Fatal error: Class 'fubar' not found in .... + If there is defined function __autoload() it will be called.