$foo = null; isset( $foo ); will yield false.
Sometimes we want to explicitly set a config to null, but ExtensionRegistry
is then overriding this variable with the default value.
This is no consistent with the old workflow:
require_once the extension and then override the setting with null.
Bug: T128661
Change-Id: I0654c9369a596e84591fcaa9643703e6b4ccf57e
// Optimistic: If the global is not set, or is an empty array, replace it entirely.
// Will be O(1) performance.
- if ( !isset( $GLOBALS[$key] ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
+ if ( !array_key_exists( $key, $GLOBALS ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
$GLOBALS[$key] = $val;
continue;
}
],
],
],
+ [
+ 'global is null before',
+ [
+ 'NullGlobal' => null,
+ ],
+ [
+ 'NullGlobal' => 'not-null'
+ ],
+ [
+ 'NullGlobal' => null
+ ],
+ ],
];
}
}