Örnek:
ClassName.php
<?php echo "This will crash all"; ?>
Başka bir dosyada ...
foreach ($FILENAMES_WITHOUT_DOT_PHP as $name => $value) {
if (class_exists( $value )) {
echo "ClassName exists...";
}
else {
echo "ClassName doesn't exists....";
}
}
The output of this code is: This will crash all
Instead of this: ClassName doesn't exists....
Özdevinimli_yükle fonksiyonu:
function __autoload( $var_class )
{
require_once( "$var_class.php") ;
}