amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

PHP Warning 8.2 #101

Closed Mich-es closed 9 months ago

Mich-es commented 9 months ago

With PHP 8.2 and Version 3.5.1 i got this PHP warning in Error Log [25-Sep-2023 09:56:33 Europe/Berlin] PHP Warning: The use statement with non-compound name 'DateTimeImmutable' has no effect in /home/www/opcache/opcache.php on line 62 [25-Sep-2023 09:56:33 Europe/Berlin] PHP Warning: The use statement with non-compound name 'DateTimeZone' has no effect in /home/www/opcache/opcache.php on line 63 [25-Sep-2023 09:56:33 Europe/Berlin] PHP Warning: The use statement with non-compound name 'Exception' has no effect in /home/www/opcache/opcache.php on line 64

amnuts commented 9 months ago

Hi @Mich-es

Thanks for letting me know! The problem comes because I have the src/Opcache/Service class with a namespace and use statements. When using it as a component, it's all as it should be. But when it's built into a standalone script it works more as a root level script and the use statements become ineffective.

At some point, I'll look into doing something with the build script so that the use and namespace get dropped from the standalone script. That should make the warnings stop appearing.

amnuts commented 9 months ago

@Mich-es, do you fancy trying out the 101-php-warning-82 branch at some point and see if it resolves the issues for you?

Mich-es commented 9 months ago

@amnuts looks good :-) thank u