|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-15 16:12 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 15:00:02 2026 UTC |
Description: ------------ When calling a function that expects an argument as a referenced variable, you cannot pass an assignment operation to the function. If doing so, the function will not change the assignment operation by reference. This has worked before PHP 5.1.2. Reproduce code: --------------- <?php function myFunc(&$var) { $var = 'set in function'; } $var = 'set before function'; myFunc($var = 'set in function call'); var_dump($var); ?> Expected result: ---------------- PHP lower than 5.1.2 reported "set in function", which is the expected behaviour. Actual result: -------------- PHP 5.1.2 actually reports "set in function call", which is not the expected behaviour and thus a BC break. I guess this change is a side-effect of recent "return by reference" problems that were addressed in PHP 4.4 already. I personally do not use code above, but other PHP applications like phpMyAdmin do (did). So at least having this documented in the PHP5 ChangeLog as a BC break would've been nice - just in case this change is "by intention".