Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
PHP 8.0 - method_exists on non-object causes Fatal TypeError

I'm trying to understand in the Breaking Changes for PHP 7.4 to 8.0 what is causing the below line to throw a Fatal TypeError. Obviously, I know it isn't correct but need clarity on what is causing it. Perhaps it has something to do with the php.ini default value changes? I don't get any errors using PHP 7.4.

echo method_exists(false, 'pre_setup') . PHP_EOL;
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I'm not sure why it isn't listed anywhere in the breaking changes (unless I'm missing something). It certainly seems like one.

The change was Bug #79462 being fixed, which aligned the behaviour of method_exists and property_exists. The decision was to go with the stricter of the two behaviours, and raise a TypeError on invalid arguments.

It's listed in the PHP 8 changelog, although I can see why that would be hard to track down.

One of the Symfony core team opened a PHP bug for it here: https://bugs.php.net/bug.php?id=79623, so you're definitely not the only person that's been affected.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!