From: Bartosz DziewoƄski Date: Wed, 17 Feb 2016 19:27:39 +0000 (+0100) Subject: Remove comments about isset( $string['foo'] ) being true on PHP 5.3 X-Git-Tag: 1.31.0-rc.0~7929^2 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=361b09576e4cde6415809b508572ca79687bc164;p=lhc%2Fweb%2Fwiklou.git Remove comments about isset( $string['foo'] ) being true on PHP 5.3 ...but don't remove the code. Calling isset( $bar['foo'] ) without checking that $bar is an array seems not very nice to me. Change-Id: I822c925b6f36bf34902f8075e54f71fe4f6d2566 --- diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 12a673a829..6d26419a6b 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -269,8 +269,6 @@ class ObjectCache { */ public static function newAccelerator( $params = [], $fallback = null ) { if ( $fallback === null ) { - // The is_array check here is needed because in PHP 5.3: - // $a = 'hash'; isset( $params['fallback'] ); yields true if ( is_array( $params ) && isset( $params['fallback'] ) ) { $fallback = $params['fallback']; } elseif ( !is_array( $params ) ) { diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index bc9b26d70c..33395f74ad 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -234,9 +234,7 @@ class ExtensionRegistry { foreach ( $info['globals'] as $key => $val ) { // If a merge strategy is set, read it and remove it from the value // so it doesn't accidentally end up getting set. - // Need to check $val is an array for PHP 5.3 which will return - // true on isset( 'string'['foo'] ). - if ( isset( $val[self::MERGE_STRATEGY] ) && is_array( $val ) ) { + if ( is_array( $val ) && isset( $val[self::MERGE_STRATEGY] ) ) { $mergeStrategy = $val[self::MERGE_STRATEGY]; unset( $val[self::MERGE_STRATEGY] ); } else {