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
This commit is contained in:
Bartosz Dziewoński 2016-02-17 20:27:39 +01:00
parent a592a76edf
commit 361b09576e
2 changed files with 1 additions and 5 deletions

View file

@ -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 ) ) {

View file

@ -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 {