WordPress.org

Make WordPress Core

Ticket #47397: 47397.patch

File 47397.patch, 960 bytes (added by dkarfa, 5 months ago)

Patch for it

  • src/wp-includes/compat.php

     
    510510        require_once ABSPATH . WPINC . '/spl-autoload-compat.php';
    511511}
    512512
    513 if ( ! function_exists( 'is_countable' ) ) {
     513if ( ( version_compare( PHP_VERSION, '7.3' ) > 0  && ! function_exists( 'is_countable' ) ) {
    514514        /**
    515515         * Polyfill for is_countable() function added in PHP 7.3.
    516516         *
     
    524524         * @return bool True if `$var` is countable, false otherwise.
    525525         */
    526526        function is_countable( $var ) {
     527               
    527528                return ( is_array( $var )
    528529                        || $var instanceof Countable
    529530                        || $var instanceof SimpleXMLElement
     
    532533        }
    533534}
    534535
    535 if ( ! function_exists( 'is_iterable' ) ) {
     536if ( ( version_compare( PHP_VERSION, '7.3' ) > 0  && ! function_exists( 'is_iterable' ) ) {
    536537        /**
    537538         * Polyfill for is_iterable() function added in PHP 7.1.
    538539         *