If php5.4 is used for reference, an error is returned. if php5.4 is used for reference, an error is returned. If php5.4 is used for reference, an error is reported. if php5.4 is used for reference, an error is reported. if php5.4 is used for reference, an error is returned. For your reference, refer to the following for details: Error analysis when using php5.4 in the php5.3 series, and error when using php5.4.
This example analyzes the error message returned when php5.4 is referenced. We will share this with you for your reference. The details are as follows:
There is no problem in transferring references from php5.3 series and earlier versions. after php5.4 is upgraded, an error is reported for all references.
Fatal error: Call-time pass-by-reference has been removed in F: \ work \ wamp \ www \ test. php on line 6. Let's take a look at the example below.
Example 1: Recursive Reference transfer. in php 5.3 and later versions, test results
<?phpfunction test($aa,&$bb){ if($aa < $bb){ echo $bb."
"; $bb--; test($aa,&$bb); }}$aa = 3;$bb = 6;test($aa,&$bb);?>
The running result is as follows:
6
5
4
Php 5.4 won't work. I tested it with php 5.4.11. Fatal error: Call-time pass-by-reference has been removed in F: \ work \ wamp \ www \ test. php on line 6 is reported.
For example 2, php5.4.11, the above test, only test transfer reference
<? Phpfunction test ($ aa, & $ bb) {if ($ aa <$ bb) {$ bb --; echo $ bb ."
"; // Test ($ aa, & $ bb) ;}$ aa = 3; $ bb = 6; test ($ aa, $ bb); // php5.4, in php5.3 and earlier versions, the input result is 5 // test ($ aa, & $ bb); // in php5.3, the input result is 5. in php5.4 and later versions, the following error occurs: call-time pass-by-reference...?>
After php5.4, you can define "&". when you call "&", an error is returned. This call is strange.
Example 3: php5.4 and Recursive Reference transfer
<?phpfunction test($aa,&$bb){ if($aa < $bb){ $bb--; echo $bb."
"; test($aa,$bb); }}$aa = 3;$bb = 6;test($aa,$bb);?>
Php5.2, php5.3, and php5.4 can all be run. the running result is as follows:
5
4
3
It seems that the upgrade from 5.3 to 5.4 is a bit difficult. if you do not know the change, the upgrade will be very depressing.