WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (16 months 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/src/wp-includes/class-wp-comment-query.php

    r48990 r49108  
    457457        if ( $this->query_vars['count'] ) {
    458458            // $comment_ids is actually a count in this case.
    459             return intval( $comment_ids );
     459            return (int) $comment_ids;
    460460        }
    461461
     
    943943
    944944        if ( $this->query_vars['count'] ) {
    945             return intval( $wpdb->get_var( $this->request ) );
     945            return (int) $wpdb->get_var( $this->request );
    946946        } else {
    947947            $comment_ids = $wpdb->get_col( $this->request );
Note: See TracChangeset for help on using the changeset viewer.