WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/24/2018 04:32:29 PM (2 years ago)
Author:
jorbin
Message:

php7.3 compatibility: Fix compact throwing notices

In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

This fixes all unit tested code that uses compact.

Props desrosj.
Fixes #44416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/tests/phpunit/tests/dependencies/scripts.php

    r43788 r43819  
    862862     */
    863863    public function test_wp_enqueue_code_editor_when_generated_array_by_compact_will_be_passed() {
     864        $file                   = '';
    864865        $wp_enqueue_code_editor = wp_enqueue_code_editor( compact( 'file' ) );
    865866        $this->assertNonEmptyMultidimensionalArray( $wp_enqueue_code_editor );
Note: See TracChangeset for help on using the changeset viewer.