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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 22:01:29 2024 UTC