php5.4 quoted times wrong problem analysis, php5.4 quoted times wrong
In this paper, the author analyzes the php5.4 of quoted times. Share to everyone for your reference, as follows:
php5.3 Series version and previous version, reference no problem, after upgrading to php5.4, the place of reference, full error
Fatal error:call-time pass-by-reference have been removed in F:\work\wamp\www\test\test.php on line 6. take a look at the following example.
Example 1, recursive reference, PHP 5.3 and version, test results
<?phpfunction Test ($aa,& $bb) { if ($aa < $BB) { echo $bb. "
"; $BB--; Test ($aa,& $bb);} } $AA = 3; $bb = 6;test ($aa,& $bb);? >
The operation results are as follows
6
5
4
PHP 5.4 is not going to work, I was tested with PHP 5.4.11. Reported Fatal error:call-time pass-by-reference have been removed in F:\work\wamp\www\test\test.phpon line 6.
Example 2,php5.4.11 above test, only test pass reference
<?phpfunction Test ($aa,& $bb) { if ($aa < $BB) { $bb--; echo $BB. "
"; Test ($aa,& $bb);} } $AA = 3; $bb = 6;test ($aa, $BB); php5.4,php5.3 and previous versions, the input result is 5//test ($aa,& $bb); php5.3 input results are 5,php5.4 and later, error fatal Error:call-time pass-by-reference ....?>
After php5.4, the definition can have &, when the call with & will be error. This call feels strange.
Example 3,php5.4 and recursive reference
<?phpfunction Test ($aa,& $bb) { if ($aa < $BB) { $bb--; echo $BB. "
"; Test ($AA, $BB);} } $AA = 3; $bb = 6;test ($aa, $BB);? >
php5.2,php5.3,php5.4 can be run, running results:
5
4
3
Feel this 5.3 liters to 5.4 a little pit dad, if do not know change, upgrade is very depressed.
Read more about PHP error and exception related content readers can view this site topic: "PHP error and Exception handling method Summary"
I hope this article is helpful to you in PHP programming.
Articles you may be interested in:
- How to upgrade the php5.3 version to php5.4 or php5.5
- php5.4 above version GBK encoding htmlspecialchars output is empty problem Resolution summary
- PHP5.4 and Xdebug Full records under Windows compilation
- php5.4 The following versions of JSON do not support the solution of non-escaping content Chinese
- Note: php5.4 removed the Session_unregister function
- Install apache2.2.22 Configuration php5.4 (procedure)
- Summary of changes of Json_encode Chinese transcoding in PHP5.4
- Some errors that occur after PHP upgrade to 5.3+, such as Ereg (); Ereg_replace (); Function error
- Discover why PHP scripts don't cause errors
- PHP Empty function Error Solving method
- PHP start times wrong simple solution
- How to resolve PHP startup error
http://www.bkjia.com/PHPjc/1094747.html www.bkjia.com true http://www.bkjia.com/PHPjc/1094747.html techarticle php5.4 quoted times wrong problem analysis, php5.4 quoted times wrong This paper analyzes php5.4 quoted times the wrong problem. Share to everyone for your reference, as follows: php5.3 series version ...