Doc #72283 [Ver->Csd]: Invalid example on debug_zval_dump

From: Date: Wed, 03 Mar 2021 14:35:09 +0000
Subject: Doc #72283 [Ver->Csd]: Invalid example on debug_zval_dump
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18615@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72283&edit=1 ID: 72283 Updated by: cmb@php.net Reported by: fernando at null-life dot com Summary: Invalid example on debug_zval_dump -Status: Verified +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: * PHP Version: 5.6.22 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This has just been fixed: <https://github.com/php/doc-en/commit/d08d2e887fdc229f16748df96450c9b68c9a3076>. Previous Comments: ------------------------------------------------------------------------ [2021-03-03 14:00:25] cmb@php.net Related To: Bug #80804 ------------------------------------------------------------------------ [2020-04-29 10:18:19] kulakov74 at yandex dot ru I confirm the issue, the example on the manual page https://www.php.net/manual/en/function.debug-zval-dump.php 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. ------------------------------------------------------------------------ [2017-03-21 04:36:55] requinix@php.net Related To: Bug #74279 ------------------------------------------------------------------------ [2016-12-30 15:32:37] cmb@php.net 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 <http://marc.info/?l=php-internals&m=143778859216287&w=2>ff. ------------------------------------------------------------------------ [2016-05-28 17:46:59] fernando at null-life dot com Description: ------------ --- From manual page: http://www.php.net/function.debug-zval-dump --- 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: --------------- <?php $var1 = 'Hello World'; $var2 = ''; $var2 =& $var1; debug_zval_dump(&$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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72283&edit=1

« previous php.doc.bugs (#18615) next »