2014-10-07 209 views

回答

1

這發生在我身上,因爲我不小心注入了兩個類到對方。

class Foo(Bar $bar){} 

class Bar(Foo $foo){} 


$bar = new Bar(new Foo(new bar(new Foo(...)))); 

之所以沒有看到那是因爲Laravel國際奧委會。因此,實例化類的synax會是這樣的:

$bar = new Bar(Foo $foo); 
-1

這裏的問題在我的情況。

我有一個服務類是codeigniter中的圖書館員。像這樣有一個函數。

class PaymentService { 

    private $CI; 

    public function __construct() { 

     $this->CI =& get_instance(); 

    } 

    public function procss(){ 
     // lots of Ci referencing here ... 
    } 

我的控制器如下:

$this->load->library('PaymentService'); 
$this->process_(); // see I got his wrong instead it should be like below 

$this->Payment_service->process(); //the library class name 

然後我被保持獲得超過錯誤消息。但我確實禁用了XDebug,但沒有幫助。任何方式請檢查您的類名或您的代碼進行正確的函數調用。

+0

這聽起來更像是一個「我也是」的評論,而不是實際的問題答案。 – hakre 2015-04-02 06:17:54

0

問題是由默認xdebug.max_nesting_level是100

通過添加以下行來引導/ autoload.php在Laravel 5.1

ini_set('xdebug.max_nesting_level', 120); 

......... 

define('LARAVEL_START', microtime(true)); 

這個回答讓我引起的。

https://stackoverflow.com/a/30839127/3524046

相關問題