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/class-wp-user.php

    r48591 r49108  
    200200                return false;
    201201            }
    202             $value = intval( $value );
     202            $value = (int) $value;
    203203            if ( $value < 1 ) {
    204204                return false;
     
    646646    public function level_reduction( $max, $item ) {
    647647        if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) {
    648             $level = intval( $matches[1] );
     648            $level = (int) $matches[1];
    649649            return max( $max, $level );
    650650        } else {
Note: See TracChangeset for help on using the changeset viewer.