php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80804 debug_zval_dump example does not compile (Parse error: syntax error is shown)
Submitted: 2021-02-26 16:42 UTC Modified: 2021-03-03 14:00 UTC
From: forkik at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: *General Issues
PHP Version: 8.0Git-2021-02-26 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: forkik at gmail dot com
New email:
PHP Version: OS:

 

 [2021-02-26 16:42 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-26 16:47 UTC] requinix@php.net
-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) -Package: Documentation problem +Package: *General Issues
 [2021-02-26 16:47 UTC] 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-27 21:22 UTC] requinix@php.net
Discussion: https://externals.io/message/113298
 [2021-03-03 14:00 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-03-03 14:00 UTC] cmb@php.net
Duplicate of bug #72283.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 18:03:35 2021 UTC