PHP 7 Syntax error, question mark before specifying the parameter

Asked

Viewed 261 times

1

I developed a website on Laravel using the version PHP 7.2, when I climbed to the server (that is using version 7.0 of PHP) I noticed that I was giving a syntax error in the following line

public function __construct(?string $test)

This line belongs to a standard file of the Laravel

Here is the complete error:

mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/vhosts/placarama.com.br/httpdocs/vendor/symfony/finder/Comparator/NumberComparator.php on line 42

Along with him is another mistake

mod_fcgid: stderr: PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0

Does anyone have any idea what it might be?

  • 1

    I think it’s the version that doesn’t have that feature

1 answer

4


Browser other questions tagged

You are not signed in. Login or sign up in order to post.