Browse files

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....
  • Loading branch information...
1 parent eff2006 commit 85de35e47081217f5a72bd79644cdca796e4315a Andrey Hristov committed Jan 24, 2004
Showing with 16 additions and 0 deletions.
  1. +16 −0 README.PHP4-TO-PHP5-THIN-CHANGES
View
16 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 :
+ <?php
+ $test = new fubar();
+ $test->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.

0 comments on commit 85de35e

Please sign in to comment.