PHP 7 Syntax error, question mark before specifying the parameter

1

I developed a site at Laravel using the PHP 7.2 version, when I uploaded it to the server ( which is using version 7.0 of PHP ) I noticed that it was giving a syntax error in the following line

public function __construct(?string $test)

This line belongs to a default framework file of 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 it has another error

  

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

Does anyone have an idea what it can be?

    
asked by anonymous 22.03.2018 / 20:52

1 answer

4

The version does not match the new feature called Nullable types that was introduced in 7.1 version, then 7.0 does not have this feature so the errors.

Reference: Nullable types - PHP Version 7.1

    
22.03.2018 / 21:39