Skip to content
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

Fixed issue #19550: Calling get_class() without arguments is deprecated PHP8.3 #3839

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TonisOrmisson
Copy link
Collaborator

LimeSurvey manual says v6 php requirement is LS 6.x from PHP 7.4.x to 8.x

LS master should not use mehods deprecated by the latest php 8 (8.3) also the tests should run the 8.3 instead of 8.2.

This fix replaces all get_class() without arguments that will throw an error in php 8.3 with get_class() WITH relevant argument $this or new static in static context to avoid errors in php 8.3

also I changed the php 8.2=>8.3 in ci tests matrix that without this fix would be red, but are green with this fix.

@TonisOrmisson
Copy link
Collaborator Author

note: there is still relevant get_class() without arguments in vendor/pear/pear-core-minimal

Copy link
Collaborator

@gabrieljenik gabrieljenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks OK.
Still a few remarks:

  • Should the PR go to DEV or master?
  • @olleharstedt I added you as reviewer as there are changes to the automatic tests.

@gabrieljenik
Copy link
Collaborator

I wouldn't merge it until getting another revision

@@ -14,7 +14,7 @@ protected static function initialize()
if (static::$initialized) return;
static::$initialized = true;
static::$parentPath = __FILE__;
for ($i=substr_count(get_class(), (string) static::$nsChar);$i>=0;$i--) {
for ($i=substr_count(get_class(new static), (string) static::$nsChar);$i>=0;$i--) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shnoulle
Copy link
Collaborator

I wouldn't merge it until getting another revision

Send it in testing ?

We need PHP8.3 in some month. Some forum post already send with PHP8.3 issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants