1

I am very new to php and I kind of need to work with another person's code. When I try to run it I get this error:

Cannot redeclare App\Core\view() (previously declared in 
D:\sandbox\app\Core\View.php:35) in D:\sandbox\app\Core\View.php on line 35

While the actual code in D:\sandbox\app\Core\View.php lines 32-50 is:

public static function register()
{
    if (!function_exists('view')) {
        function view($view, $data)
        {
            return View::view($view, $data);
        }
    }
}

public static function view($view, $data)
{
    $result = ...;

    return $result;
}

There're almost no includes in the project as it seems to be some homemade php framework

alt-ja
  • 144
  • 1
  • 11
  • This might answer your question: https://stackoverflow.com/questions/5864141/redeclaration-of-instance-and-static-function – Paweł Goca May 29 '17 at 20:36

0 Answers0