|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72283 Invalid example on debug_zval_dump
Submitted: 2016-05-28 17:46 UTC Modified: 2021-03-03 14:35 UTC
From: fernando at null-life dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.6.22 OS: *
Private report: No CVE-ID: None
 [2016-05-28 17:46 UTC] fernando at null-life dot com
From manual page:

First example is invalid now because call-time pass by reference is removed.

Fatal error: Call-time pass-by-reference has been removed in /Users/fmunozs/dev/php-fuzz/phuzzer/x.php on line 7

Test script:
$var1 = 'Hello World';
$var2 = '';

$var2 =& $var1;


Expected result:
Working example

Actual result:
Fatal error: Call-time pass-by-reference has been removed in /Users/fmunozs/dev/php-fuzz/phuzzer/x.php on line 7


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 15:32 UTC]
-Status: Open +Status: Verified
 [2016-12-30 15:32 UTC]
Not only is the first example invalid as of PHP 5.4.0, but also
the third example is broken as of PHP 7.0.0, and there appear more
issues, see
 [2020-04-29 10:18 UTC] kulakov74 at yandex dot ru
I confirm the issue, the example on the manual page is incorrect, PHP 7.4.5 now displays
Parse error: syntax error, unexpected '&' 

And indeed, the function itself seems of little use. If I make a real reference, it does not display refcount=2. For strings, refcount is always 1, for integers it's not displayed at all.
 [2021-03-03 14:35 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 23 18:03:33 2021 UTC