diff --git a/language/oop5/autoload.xml b/language/oop5/autoload.xml index 2ae83f25af..824c3fc2c0 100644 --- a/language/oop5/autoload.xml +++ b/language/oop5/autoload.xml @@ -2,10 +2,6 @@ Autoloading Classes - - void__autoload - stringclass - Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest @@ -14,7 +10,7 @@ In PHP 5, this is no longer necessary. You may define an - __autoload function which is automatically + __autoload function which is automatically called in case you are trying to use a class/interface which hasn't been defined yet. By calling this function the scripting engine is given a last chance to load the class before PHP fails with an error. diff --git a/reference/classobj/functions/autoload.xml b/reference/classobj/functions/autoload.xml new file mode 100644 index 0000000000..fc3488bd50 --- /dev/null +++ b/reference/classobj/functions/autoload.xml @@ -0,0 +1,74 @@ + + + + + + __autoload + Attempt to load undefined class + + + + &reftitle.description; + + void__autoload + stringclass + + + You can define this function to enable classes autoloading. + + + + + + &reftitle.parameters; + + + class + + + Name of the class to load + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.seealso; + + + spl_autoload_register + + + + + + + diff --git a/reference/spl/functions/spl-autoload-register.xml b/reference/spl/functions/spl-autoload-register.xml index 010afdf885..f2ed009485 100644 --- a/reference/spl/functions/spl-autoload-register.xml +++ b/reference/spl/functions/spl-autoload-register.xml @@ -140,6 +140,16 @@ Fatal error: Class 'Foobar\InexistentClass' not found in ... + + + &reftitle.seealso; + + + __autoload + + + +