Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (5 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/comment-submission.php

    r48937 r49108  
    251251        $this->assertSame( $user->user_email, $comment->comment_author_email );
    252252        $this->assertSame( $user->user_url, $comment->comment_author_url );
    253         $this->assertSame( $user->ID, intval( $comment->user_id ) );
     253        $this->assertSame( $user->ID, (int) $comment->user_id );
    254254
    255255    }
Note: See TracChangeset for help on using the changeset viewer.