Welcome Guest, Not a member yet? Register   Sign In
Fatal error because of using the same key?
#1

Hello!

Maybe someone can explain me this error, which I solved but I don't understand what happens here.


Quote:Fatal error: Cannot redeclare App\Models\creator() (previously declared in /var/www/app/Models/PathModel.php:38) in /var/www/app/Models/PathModel.php on line 38


This happens, when it comes to the second line below. "creator()" is only used in "createNaviagatorArray()" in the first line (its a function in this function). "getChildrenWithType()" is empty!

PHP Code:
$this->data['sidebar'] = $this->subjects->fillNavigatorArray($this->paths->createNavigatorArray($this->id));
$this->data['sidebar'] = $this->subjects->getChildrenWithType(); 

It works with

PHP Code:
$this->data['foo'] = $this->subjects->getChildrenWithType(); 
Why? I only accidentally used the same key...

Huh
Reply




Theme © iAndrew 2016 - Forum software by © MyBB