nipwaayoni / elastic-apm-php-agent

PHP Agent for Elastic APM
Other
28 stars 15 forks source link

Fixed PHP 8.1 compatibility #76

Closed lamka02sk closed 2 years ago

lamka02sk commented 2 years ago

Hi, there were some PHP type errors in 8.1, so I fixed them. There is no guarantee that more of these won't pop out in the future, but this is what we found during testing for now.

dstepe commented 2 years ago

@lamka02sk Can you provide more context for the changes you are proposing? I just completed a quick test of the latest version of this package (v7.5.3) under PHP 8.1.2 and see no reported issues. I have also updated the GitHub actions matrix to run linting and unit tests under PHP 8.0 and 8.1 (see https://github.com/nipwaayoni/elastic-apm-php-agent/actions/runs/1790344290). Those also execute without reporting any issues.

I absolutely want this package to be compatible with PHP 8.1, but I'm not ready to require PHP >=8.0 yet. What problem are you seeing that you want to solve with the PR?

lamka02sk commented 2 years ago

@dstepe I looked more into the issue and found some strange behaviour in our composer installation. The problem was that we had package psr/log installed in the latest version 3.0 (debugbar package defaults to 3.0) which contains multiple changes in method declarations, causing the errors. Locking the package to version 1.1 solved the issues. I am closing this PR now, sorry for making trouble.

dstepe commented 2 years ago

@lamka02sk I'm glad you got it worked out. No trouble at all. It's nice to know the package is used.