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/src/wp-includes/revision.php

    r48975 r49108  
    548548        $num = -1;
    549549    } else {
    550         $num = intval( $num );
     550        $num = (int) $num;
    551551    }
    552552
     
    679679    }
    680680
    681     $thumbnail_id = intval( $_REQUEST['_thumbnail_id'] );
     681    $thumbnail_id = (int) $_REQUEST['_thumbnail_id'];
    682682    if ( $thumbnail_id <= 0 ) {
    683683        return '';
    684684    }
    685685
    686     return strval( $thumbnail_id );
     686    return (string) $thumbnail_id;
    687687}
    688688
Note: See TracChangeset for help on using the changeset viewer.