mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@49108 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -299,7 +299,7 @@ function xml_array_dumbdown( &$data ) {
|
||||
|
||||
function dmp( ...$args ) {
|
||||
foreach ( $args as $thing ) {
|
||||
echo ( is_scalar( $thing ) ? strval( $thing ) : var_export( $thing, true ) ), "\n";
|
||||
echo ( is_scalar( $thing ) ? (string) $thing : var_export( $thing, true ) ), "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ function gen_tests_array( $name, $array ) {
|
||||
$out = array();
|
||||
foreach ( $array as $k => $v ) {
|
||||
if ( is_numeric( $k ) ) {
|
||||
$index = strval( $k );
|
||||
$index = (string) $k;
|
||||
} else {
|
||||
$index = "'" . addcslashes( $k, "\n\r\t'\\" ) . "'";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user