Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (6 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/xmlrpc/wp/getPosts.php

    r48937 r49108  
    103103                $last_comment_count = 100;
    104104                foreach ( $results2 as $post ) {
    105                         $comment_count = intval( get_comments_number( $post['post_id'] ) );
     105                        $comment_count = (int) get_comments_number( $post['post_id'] );
    106106                        $this->assertLessThanOrEqual( $last_comment_count, $comment_count );
    107107                        $last_comment_count = $comment_count;
Note: See TracChangeset for help on using the changeset viewer.