reactphp / filesystem

Evented filesystem access.
MIT License
135 stars 40 forks source link

PHP 7.3.27 compatibility #93

Closed carliedu closed 3 years ago

carliedu commented 3 years ago

I'm using 2 server providers, AWS and an local provider. I'm developing and testing on AWS, where installed PHP is 7.4.13. I put an copy of the application on my local provider, where installed PHP is 7.3.27. On my local provider I has no terminal access, so I have to transfer the entire folder, with vendor folder. Before transferring the files, on my AWS installation I have included "config": { "platform": { "php": "7.3" } } in composer.json file and executed composer update, composer install and composer dump. To make sure it was still working, I executed the application without problems. After that, I transfered the entire folder from AWS to my local provider. When execute it, bet get the following error: PHP Parse error: syntax error, unexpected 'FilesystemInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /home/public_html/zhukBook/src/Core/Uploader.php on line 15. With the editor the line private FilesystemInterface $filesystem; is checked with an PHP syntax error. Is there any version incompatibility?

Ahmard commented 3 years ago

That is because PHP 7.3 does not support property type declaration. That code can only run on PHP 7.4 or later versions.

Take a look at PHP 7.4 migration note

carliedu commented 3 years ago

I suggest to test version and throw an error if PHP < 7.4

carliedu commented 3 years ago

Now I saw that the error occurs on the application and not in reactphp/filesystem. I'm sorry. Closing the issue.