array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.spl-autoload.php', 1 => 'spl_autoload', ), 'up' => array ( 0 => 'ref.spl.php', 1 => 'SPL 関数', ), 'prev' => array ( 0 => 'function.spl-autoload-unregister.php', 1 => 'spl_autoload_unregister', ), 'next' => array ( 0 => 'function.spl-classes.php', 1 => 'spl_classes', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/spl/functions/spl-autoload.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
spl_autoload — __autoload() のデフォルト実装
この関数は、__autoload() のデフォルト実装として使用されることを意図しています。 ほかに何も指定されておらず、autoload_register() がパラメータなしでコールされた場合には、 その後の __autoload() のコール時にはこの関数が使用されます。
class
インスタンスを作成するクラス名 (および名前空間名)。
file_extensions
デフォルトでは、クラス名を小文字にして .inc および .php を拡張子につけたファイル名のファイルが存在するかどうかを すべてのインクルードパスから探します。
値を返しません。
クラスが見つからず、かつそれ以外にオートローダーが登録されていない場合に LogicException をスローします。
バージョン | 説明 |
---|---|
8.0.0 |
file_extensions は、nullable になりました。
|