Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

364
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda