1

I made loads of changes within my code and unfortunately kind of lost track what were the last one.. but I guess one of them created this weird problem. When I'm trying to run php artisan serve, I get this error -

Parse error: parse error in /Users/Guest/admanager/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500

And the function that returns the error in helpers.php looks like this -

function factory()
{
    $factory = app(EloquentFactory::class);

    $arguments = func_get_args();

    if (isset($arguments[1]) && is_string($arguments[1])) {
        return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ? null); // specifically, this is line 500
    } elseif (isset($arguments[1])) {
        return $factory->of($arguments[0])->times($arguments[1]);
    }

    return $factory->of($arguments[0]);
}
1
  • 1
    What is your php version? Commented Oct 29, 2018 at 7:33

2 Answers 2

1

Please change as per below code,

$arguments[2] ? null TO $arguments[2] ?? null

Sign up to request clarification or add additional context in comments.

1 Comment

yes.. i think it is a matter of my built-in mac's php version. will try to upgrade now and i'll update on this.
0

The problem was that I just uninstalled xampp and it downgraded my locally running php version, hence the artisan serve didn't know how to handle that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.