anthonybudd / WP_Model

A simple drop-in abstract class for creating active record style eloquent-esque models of WordPress Posts
MIT License
100 stars 20 forks source link

Possibly incompatible with PHP v.8+ #13

Closed mrpsiho closed 1 year ago

mrpsiho commented 1 year ago

Hi!

I have this log record: PHP Fatal error: Uncaught Error: Non-static method BlogPost::_finderAllinlang() cannot be called statically and it happens when I switch to PHP 8+. It is about dynamically created methods. With PHP 7.4 it works just fine.

Do you have any solution for this? Thanks!

geniuswebtools commented 1 year ago

@mrpsiho take a look at this. https://php.watch/versions/8.0/non-static-static-call-fatal-error

I would think you could test this by generating the log for PHP Notices in PHP 7.4, and see if you find the deprecation notice in your log.

mrpsiho commented 1 year ago

@geniuswebtools Thanks! I have made all my methods 'static' and now everything works with PHP 8+.