Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-20099

php function array_key_exists() not supported in version 5.3 anymore [replaced by property_exists()]

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9, 2.0
    • Fix Version/s: 2.0
    • Component/s: General, PHPDoc
    • Labels:
      None
    • Environment:
      php 5.3
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      i have upgraded my local devel server (debian 5 unstable)
      from php 5.2.10 to php 5.3 a while ago.

      and while working on a new block i found out that function array_key_exists()
      has a compatibility issue with php version 5.3.

      it is replaced with property_exists()

      http://il2.php.net/array_key_exists

      PHP Version Description
      5.3.0 This function doesn't work with objects anymore, property_exists() should be used in this case.

      and there is allot (398 uses) of places in the code of version 1.9.5+ of that function.
      http://xref.moodle.org/_functions/index.html#array_key_exists

      i set this issue to major, i hope it is a minor one, thou.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            nadavkav Nadav Kavalerchik
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10