Solve Fatalerror: Call-timepass-by-referencehasbee

Source: Internet
Author: User
This error was encountered today when PHP5.4.15 was used: Fatalerror: The Call-timepass-by-referencehasbeenremovedinoptlampstack-5.4.15-0appslixiphphtdocsfunction.inconline161 generated this error because it was used in PHP function statements to reference variables. For example: foo ($ varia

Today I encountered this error when using PHP 5.4.15: Fatal error: Call-time pass-by-reference has been removed in/opt/lampstack-5.4.15-0/apps/lixiphp/htdocs/function. inc on line 161 produces this error because it is used in PHP function statements to reference variables. For example: foo ($ varia

This error is reported when PHP 5.4.15 is used today:

Fatal error: Call-time pass-by-reference has been removed in/Opt/lampstack-5.4.15-0/apps/lixiphp/htdocs/function. incOn line161

This error occurs because & is used in PHP function statements to reference variables. For example:

Foo (& $ variable );

In fact, the usage will be prompted in PHP 5.3, but the previous only prompts Deprecated.

In a simple sentence, you do not need to pass reference variables when calling a function.

Correct usage
Reference variables are not required in function statements.
myFunc($var);//Call myFuncfunction myFunc(&$arg) { do something... }???? 
Incorrect usage
myFunc(&$arg);//Call myFunc function myFunc($arg) { do something... }? 
Disable Error display
error_reporting(0); ini_set('display_errors', 'off');

Runtime Environment:

(...)
Read the rest of the solution Fatal error: Call-time pass-by-reference has been removed (9 words)

©Lixiphp for LixiPHP, 2013. | Permalink | No comment | Add to del. icio. us
Post tags: PHP 5.4, reference. reference

Feed enhanced by Better Feed from Ozh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.