Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6796109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:25:39+00:00 2026-05-26T18:25:39+00:00

I’m encountering a consistency issue with an E_DEPRECATED message. I have the following snippet

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:25:40+00:00Added an answer on May 26, 2026 at 6:25 pm

    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)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.