Make WordPress Core


Ignore:
Timestamp:
10/06/2015 02:55:43 AM (11 years ago)
Author:
wonderboymusic
Message:

REST API: add JsonSerializable() compatibility interface for PHP <5.4 to compat.php

Props rmmcue.
See #33982.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r34844 r34845  
    317317        }
    318318endif;
     319
     320if ( ! interface_exists( 'JsonSerializable' ) ) {
     321        define( 'WP_JSON_SERIALIZE_COMPATIBLE', true );
     322        /**
     323         * JsonSerializable interface.
     324         *
     325         * Compatibility shim for PHP <5.4
     326         *
     327     * @link http://php.net/jsonserializable
     328         *
     329         * @since 4.4.0
     330         */
     331        interface JsonSerializable {
     332                public function jsonSerialize();
     333        }
     334}
Note: See TracChangeset for help on using the changeset viewer.