Doc #80804 [Opn]: debug_zval_dump example does not compile (Parse error: syntax error is shown)
| From: | requinix@php.net | Date: | Fri, 26 Feb 2021 16:47:42 +0000 |
| Subject: | Doc #80804 [Opn]: 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-18602@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: requinix@php.net
Reported by: forkik at gmail dot com
-Summary: Example does not compile (Parse error: syntax error
is shown)
+Summary: debug_zval_dump example does not compile (Parse
error: syntax error is shown)
Status: Open
Type: Documentation Problem
-Package: Documentation problem
+Package: *General Issues
PHP Version: 8.0Git-2021-02-26 (Git)
Block user comment: N
Private report: N
New Comment:
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...
Previous Comments:
------------------------------------------------------------------------
[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