"maybe ref" issue for current() and others
| Bug #38808 | "maybe ref" issue for current() and others | ||||
|---|---|---|---|---|---|
| Submitted: | 2006-09-13 14:50 UTC | Modified: | 2006-09-26 11:26 UTC | ||
| From: | dev at ioncube dot com | Assigned: | dmitry (profile) | ||
| Status: | Closed | Package: | Variables related | ||
| PHP Version: | 5.1.6 | OS: | Any | ||
| Private report: | No | CVE-ID: | None | ||
[2006-09-13 14:50 UTC] dev at ioncube dot com
Description: ------------ Minor issue; the implementation of "maybe reference" parameters since 5.1.0 (and still present in 5.2RC2) can cause unexpected results. Reproduce code: --------------- <?php $b = array(1=>'one', 2=>'two'); $a =& $b; var_dump(current($a)); next($a); $f = "current"; var_dump($f($a)); ?> Expected result: ---------------- string(3) "one" string(3) "two" Actual result: -------------- string(3) "one" string(3) "one"
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-09-14 10:55 UTC] tony2001@php.net
[2006-09-14 11:25 UTC] dev at ioncube dot com