<?php
/*
Plugin name: apply_filters_ref_array tests
Author: scribu
Version: 1.1
*/

// A filter that applies only on secondary loops
function test_func_query($where, $query) {
	global $wp_query;

	if ( $query != $wp_query )
		$query->test = 'pass';

	return $where;
}
add_filter('posts_where', 'test_func_query', 10, 2);

function do_test() {
	$q = new WP_Query('posts_per_page=10');
	global $wp_query;

	var_dump('pass' == $q->test);
	var_dump('pass' != $wp_query->test);
	die;
}
add_action('wp_head', 'do_test');

