Doc #80804 [Opn->Dup]: debug_zval_dump example does not compile (Parse error: syntax error is shown)

From: Date: Wed, 03 Mar 2021 14:00:25 +0000
Subject: Doc #80804 [Opn->Dup]: debug_zval_dump example does not compile (Parse error: syntax error is shown)
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18614@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80804&edit=1 ID: 80804 Updated by: cmb@php.net Reported by: forkik at gmail dot com Summary: debug_zval_dump example does not compile (Parse error: syntax error is shown) -Status: Open +Status: Duplicate Type: Documentation Problem Package: *General Issues PHP Version: 8.0Git-2021-02-26 (Git) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Duplicate of bug #72283. Previous Comments: ------------------------------------------------------------------------ [2021-02-27 21:22:04] requinix@php.net Discussion: https://externals.io/message/113298 ------------------------------------------------------------------------ [2021-02-26 16:47:42] requinix@php.net As pointed out in the comments, the example requires call-time pass-by-reference which was removed from PHP a while back. The unfortunate truth is that debug_zval_dump is essentially useless now... ------------------------------------------------------------------------ [2021-02-26 16:42:01] forkik at gmail dot com Description: ------------ --- From manual page: https://php.net/function.debug-zval-dump --- Test script: --------------- <?php $var1 = 'Hello World'; $var2 = ''; $var2 =& $var1; debug_zval_dump(&$var1); ?> Actual result: -------------- Parse error: syntax error, unexpected token "&" in /tmp/tester.php on line 7 Checked at https://extendsclass.com/php.html with PHP versions: 8.0.0 and 7.4.8 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80804&edit=1

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