• Resolved [email protected]

    (@areaareasasit)


    Dears all,

    I was convinced that WordPress is compatible with PHP 5.2.17 while it is not, due to the extensive use of is_a() statement which should have been replaced by instanceof.

    I may suppress the error presentation but the performance, of course, will suffer anyway.

    Is there any workaround?

    Thanks for your support.

    Carmine Iaciofano
    Area

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator James Huff

    (@macmanx)

    The deprecation of is_a() was reverted in PHP 5.3 and higher.

    Seeing as PHP 5.2 reached end-of-life in January 2011, is there any way that you would be able to upgrade to PHP 5.3 or higher, or at least ask your hosting provider to bring you up to a version of PHP that isn’t over 4 years out-of-date?

    If not, what sort of trouble are you having? There are (sadly) many WordPress users still on PHP 5.2: https://www.ads-software.com/about/stats/

    Thread Starter [email protected]

    (@areaareasasit)

    .. sorry for not being more clear: is_a() deprecation messages are warnings, instead of errors.

    Anyway, I checked deeper and discovered that the discussion about which is better and which to chose is still open at stackoverflow.com.

    Then, I will have to manage the warnings and the update to PHP 5.3.

    Thanks for your support,

    Carmine Iaciofano
    Area

    Thread Starter [email protected]

    (@areaareasasit)

    .. ok. I solved just adding, at root folder’s index.php, the declaration:

    error_reporting( 0 );

    Thanks for your support,

    Carmine Iaciofano
    Area

    Moderator James Huff

    (@macmanx)

    Excellent, I think you’ll be happier on PHP 5.3, that won’t reach end-of-life for another week (August 14, to be exact). ??

    Better to upgrade to 5.4 if you can, but in the long run 5.3 is much better than 5.2. ??

    As for the warnings, if functionality isn’t broken, they’re nothing more than idle warnings and not necessarily something to be concerned about since is_a() is still supported at the moment.

    Thread Starter [email protected]

    (@areaareasasit)

    As for the warnings, if functionality isn’t broken

    .. functionality was hardly broken! So that I was not able to access administration.

    Anyway, I solved as indicated.

    Thanks for your support,

    Carmine Iaciofano
    Area

    Moderator James Huff

    (@macmanx)

    So that I was not able to access administration.

    Ah, that was important to know, we probably could have helped with that. It may have just been a plugin or theme function that wasn’t entirely compatible with PHP 5.2.

    As mentioned, the majority of WordPress users are still trapped on PHP 5.2, so I doubt it was an incompatibility directly between WordPress and PHP 5.2.

    Anyway, you have solved your problem, so that’s good. ??

    Thread Starter [email protected]

    (@areaareasasit)

    It may have just been a plugin or theme function

    ..sorry to say that if you check the full project by any good IDE you will find the 60 occurrences in the core WP. In my project, I have just found only 2 more declarations (62 in total, then) in plugin which I may change by myself.

    Just resuming in terms of folders:

    • wp-admin/includes (4)
    • wp-includes (56)

    Thanks for your patience,

    Carmine Iaciofano
    Area

    Moderator James Huff

    (@macmanx)

    I know there are several occurrences of is_a(), that’s not what I was saying.

    Take a look at https://www.ads-software.com/about/stats/ again.

    Sadly, 39.5% of reporting WordPress installations (the largest group on that chart) are under PHP 5.2, mostly because their hosting providers refuse to upgrade from a version of PHP deprecated over 4 years ago.

    If is_a() was a problem and actually breaking functionality on its own in WordPress as-is, we’d have a lot more reports than this and the maybe one other we see each month.

    Most often, it’s actually a plugin or theme conflicting, as you can see from most of the threads which mention this.

    Thread Starter [email protected]

    (@areaareasasit)

    Dear MacManX,

    for what is my experience, we are talking about two different aspects of the same problem. I have a technical approach where WP may elevated to a “perfect code” level while you, instead, have a support/marketing approach of the kind “no problem evidence – no problem at all”. I may understand you but may be you have missed my post where I wrote:

    .. sorry for not being more clear: is_a() deprecation messages are warnings, instead of errors.

    So, I am talking about warning messages which may be avoided, universally, just by one line of code, so to avoid the presentation of the message which both solve the issue in terms of performance and presentation related both to the core project and not related to any third party.

    At the other side, 60 line of code is nothing related to the full WP project and if WP should have been a project of mine I would have said “sorry” and I would have immediately correct it. But, anyway, you are not a “WP master” to decide if doing it or not is a priority so I may understand your position and your answers as well as I hope you will understand my follow-up.

    Again, and more, thanks for your patience and support,

    Carmine Iaciofano
    Area

    Moderator James Huff

    (@macmanx)

    Have you considered filing a bug report to bring this to the attention of the developers and hear their feedback?

    https://codex.www.ads-software.com/Reporting_Bugs

    Most of what we do here in the support forums is support, we help people work around and solve problems within the existing system. If you want to actually change the existing system, it’s best to file a bug report.

    Thread Starter [email protected]

    (@areaareasasit)

    Dear MacManX,

    thanks to your indication here is the related ticket #29139.

    Thanks for your support,

    Carmine Iaciofano
    Area

    Moderator James Huff

    (@macmanx)

    Excellent, thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WP incompatibility with PHP 5.2.17 due to is_a() deprecation’ is closed to new replies.