Jump to content

spl_autoload_register


BobbyPeng

Recommended Posts

hi

    i have some questions about spl_autoload_register when the first param is null.

    eg. spl_autoload_register(null, false);

    the manul describe"  If no parameter is provided, then the default implementation of spl_autoload() will be registered." now why the follow can't run

<?php

spl_autoload_register(NULL, false);

spl_autoload_extensions('.class.php, .php');

$demo2 = new Demo2();//Demo2.class.php is exist

?>

 

the fllow can run

 

<?php

spl_autoload_extensions('.class.php, .php');

spl_autoload('Demo2');

$demo2 = new Demo2();

?>

 

so , what's the meaning of spl_autoload_register(null, false)? anyone can give me some examples, thanks.

Link to comment
https://forums.phpfreaks.com/topic/219272-spl_autoload_register/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.