调用时传递引用不会生成E_DEPRECATED错误

I'm encountering a consistency issue with an E_DEPRECATED message.

I have the following snippet of code that can be run on the command-line to demonstrate.

php -d error_reporting=-1 -d display_errors=1 -r 'function foo(&$bar) {return $bar->title . ".";} $bar = new stdClass(); $bar->title = "foobar"; print foo(&$bar) . PHP_EOL . PHP_VERSION . PHP_EOL;'

Readable version:

// error reporting set to E_ALL via command-line
function foo(&$bar) {
  return $bar->title . ".";
} 

$bar = new stdClass(); 
$bar->title = "foobar"; 

print foo(&$bar) . PHP_EOL . PHP_VERSION . PHP_EOL;
//        ^ this should raise E_DEPRECATED

I'm trying to trigger a PHP Deprecated: Call-time pass-by-reference has been deprecated message with this snippet foo(&$bar) but for some reason it's not being raised on my local install.

I've passed it around to several other environments running various versions of php, different os's etc. and gotten different results:

EXPECTED:

mike@server:~$ php -d error_reporting=-1 -d display_errors=1 -r 'function foo(&$bar) {return $bar->title . ".";} $bar = new stdClass(); $bar->title = "foobar"; print foo(&$bar) . PHP_EOL . PHP_VERSION . PHP_EOL;'
PHP Deprecated:  Call-time pass-by-reference has been deprecated in Command line code on line 1
foobar.
5.3.5-1ubuntu7.2

IN MY ENVIRONMENT:

mike@local:~$ php -d error_reporting=-1 -d display_errors=1 -r 'function foo(&$bar) {return $bar->title . ".";} $bar = new stdClass(); $bar->title = "foobar"; print foo(&$bar) . PHP_EOL . PHP_VERSION . PHP_EOL;'
foobar.
5.3.5-1ubuntu7.2

What could be causing this?

Update:

I did the following to verify that deprecated errors are still being thrown in my environment:

mike@local:~$ php -d error_reporting=-1 -d display_errors=1 -r 'eregi("test", "test");'

Deprecated: Function eregi() is deprecated in Command line code on line 1

By any chance, is your allow_call_time_pass_reference setting enabled in php.ini?

; This directive allows you to enable and disable warnings which PHP will issue
; if you pass a value by reference at function call time. Passing values by
; reference at function call time is a deprecated feature which will be removed
; from PHP at some point in the near future. The acceptable method for passing a
; value by reference to a function is by declaring the reference in the functions
; definition, not at call time. This directive does not disable this feature, it
; only determines whether PHP will warn you about it or not. These warnings
; should enabled in development environments only.
; Default Value: On (Suppress warnings)
; Development Value: Off (Issue warnings)
; Production Value: Off (Issue warnings)
; http://www.php.net/manual/en/ini.core.php#ini.allow-call-time-pass-reference
allow_call_time_pass_reference = Off

Especially note:

; Default Value: On (Suppress warnings)

Passing to a function by reference has been deprecated for quite some time (I believe since PHP 5 was introduced?) and is why you're getting the warning. Simply calling foo($bar) will pass the parameter by reference since you've stated that in the function definition.

The fact that you're getting different results means that there's either a different in the php.ini file or the error reporting number is off (I believe it changes between versions).