Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (4 years ago)
Author:
SergeyBiryukov
Message:

General: Replace older-style PHP type conversion functions with type casts.

This improves performance, readability, and consistency throughout core.

  • intval()(int)
  • strval()(string)
  • floatval()(float)

Props ayeshrajans.
Fixes #42918.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term/termExists.php

    r48937 r49108  
    1616        );
    1717
    18         $found = term_exists( intval( $t ), 'post_tag' );
     18        $found = term_exists( (int) $t, 'post_tag' );
    1919        $this->assertEquals( $t, $found['term_id'] );
    2020    }
     
    3131        );
    3232
    33         $this->assertNull( term_exists( intval( $t ), 'foo' ) );
     33        $this->assertNull( term_exists( (int) $t, 'foo' ) );
    3434    }
    3535
     
    4141        );
    4242
    43         $found = term_exists( intval( $t ), 'post_tag' );
     43        $found = term_exists( (int) $t, 'post_tag' );
    4444        $this->assertEquals( $t, $found['term_id'] );
    4545    }
Note: See TracChangeset for help on using the changeset viewer.