2016-05-22 4 views
-1

iは7PHP 7に関数を変更する方法を理解していますか?

function custom_autoloader($className) //$className inside spl function 
{ 
if (file_exists(CORE_ROOT . '/includes/' . lcfirst($className) . '. class.php')) 
{ 
    spl_autoload_register('custom_autoloader') 


    //require_once(CORE_ROOT . '/includes/' . lcfirst($className) . '.class.php'); 
} 
}); 
+2

よくないので理由はありませんので、 –

答えて

0

PHP 7.1はまだ実行されるPHP古いコードに精通していない、しかし、立ち往生7.got PHPにはPHP 5.2から機能を変更しましたが、あなたはスカラ型のヒントを作成し、同じようなタイプを返すことができますこの。 voidの戻り値の型は昨年mergedでした。

function custom_autoloader(string $className) : void 
{ 
    if (file_exists(CORE_ROOT . '/includes/' . 
        lcfirst($className) . '.class.php')) { 
     spl_autoload_register('custom_autoloader') 

    } 
}); 
関連する問題