/**
* Array lookup
- * Returns an array where the values in the first array are replaced by the
- * values in the second array with the corresponding keys
+ * Returns an array where the values in array $b are replaced by the
+ * values in array $a with the corresponding keys
*
+ * @deprecated since 1.22; use array_intersect_key()
* @param $a Array
* @param $b Array
* @return array
*/
function wfArrayLookup( $a, $b ) {
+ wfDeprecated( __FUNCTION__, '1.22' );
return array_flip( array_intersect( array_flip( $a ), array_keys( $b ) ) );
}
* Backwards array plus for people who haven't bothered to read the PHP manual
* XXX: will not darn your socks for you.
*
+ * @deprecated since 1.22; use array_replace()
* @param $array1 Array
* @param [$array2, [...]] Arrays
* @return Array
*/
function wfArrayMerge( $array1/* ... */ ) {
+ wfDeprecated( __FUNCTION__, '1.22' );
$args = func_get_args();
$args = array_reverse( $args, true );
$out = array();
/**
* Get the current unix timestamp with microseconds. Useful for profiling
+ * @deprecated since 1.22; call microtime() directly
* @return Float
*/
function wfTime() {
+ wfDeprecated( __FUNCTION__, '1.22' );
return microtime( true );
}
UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) );
}
- function testTime() {
- $start = wfTime();
- $this->assertInternalType( 'float', $start );
- $end = wfTime();
- $this->assertTrue( $end > $start, "Time is running backwards!" );
- }
-
public static function provideArrayToCGI() {
return array(
array( array(), '' ), // empty