]> granicus.if.org Git - php/commitdiff
Adding note about declaration first use after that for classes.
authorAndrey Hristov <andrey@php.net>
Sat, 24 Jan 2004 00:14:43 +0000 (00:14 +0000)
committerAndrey Hristov <andrey@php.net>
Sat, 24 Jan 2004 00:14:43 +0000 (00:14 +0000)
#I had no time recently to add this but since a user complained on
#internals....

README.PHP4-TO-PHP5-THIN-CHANGES

index 0ef64e40fe0151ac8abe6f94b684600310d8877e..a8caec956e0c0a4c60ac759e96b2bb6dea7b34f9 100644 (file)
    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.