1

I'm trying to use sharing host to run may laravel app but it give's me this error in error_log

laravel files in directory I called it host

public folder in subdomain it name is gardenfilm.studioaleph.com

error log say's:

[11-May-2019 07:18:08 UTC] PHP Parse error: syntax error, unexpected '?' in /home/studioaleph/host/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 500

if (! function_exists('factory')) {
    /**
     * Create a model factory builder for a given class, name, and amount.
     *
     * @param  dynamic  class|class,name|class,amount|class,name,amount
     * @return \Illuminate\Database\Eloquent\FactoryBuilder
     */
    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);
        } elseif (isset($arguments[1])) {
            return $factory->of($arguments[0])->times($arguments[1]);
        }

        return $factory->of($arguments[0]);
    }
}

this line is problem :

return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);

PHP Version 5.6.32

Laravel Framework 5.8.16

Amir Hossein
  • 916
  • 2
  • 13
  • 38
  • 1
    As far as I can tell - from the [Laravel 5.8 installation page](https://laravel.com/docs/5.8/installation) you need PHP >= 7.1.3 – Nigel Ren May 11 '19 at 08:39

1 Answers1

0

Salaam. This error occurs when you use PHP < 7.0. You have to use PHP > 7.0.

You can read more about this here. It's called Null coalescing operator.

And the system requirement for Laravel 5.8 says you must use PHP >= 7.1.3. Laravel documentation.

Rouhollah Mazarei
  • 3,969
  • 1
  • 14
  • 20