New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Error with Laravel 5.5 and PHP 7.0.27 within Mail function #22955
Comments
Did it give a line number? Are you sure your running PHP7? That error looks alot like PHP5.6 trying to run PHP7 code... |
Yes, it is 7.0.27. |
ping @GrahamCampbell - your the composer expert 😄 . |
actually - @kikky7 - did you run Because technically the |
Composer packages are only installed and updated locally on 7.1 and copied to server, where is 7.0. I will manage to get 7.1 on server, but it would be nice to have some other solution also. |
Yeah - you cant do this. The problem is composer is installing packages that need PHP If you want to run on |
You need to use the platform config to lock to the version of php you want to use: {
...
"config": {
"platform": {
"php": "7.0.27"
},
...
},
...
} |
That way, when you generate a lock file on a newer version of php, your dependencies will still work on php 7.0.27. |
You can also require |
As far as I can see nullable types were only added to PHP in v7.1, but the required version is >=7.0.0 |
See the above comments. The dependencies are correct. |
@GrahamCampbell Where to put this "symfony/lts": "^3.0"? |
Some Symfony packages are incompatible (introduction of nullable concept in PHP) with PHP 7.0. |
@Rolice - no, because Composer will detect those packages and install PHP 7.0 equilivant for Symfony. |
It is strage as it is brand new Docker image with |
Description:
Parse error: syntax error, unexpected '?', expecting variable
in
/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php
Steps To Reproduce:
It happens when I am trying to send an email using Mail::to()...
It doesn't happen with PHP 7.1.8.
How to fix this issue without downgrading Laravel version (with 5.4 worked, as I recall) or changing PHP (because this version is on shared server and I am unable to change it)
The text was updated successfully, but these errors were encountered: