php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4818 var_dump() does not keep cursor in arrays
Submitted: 2000-06-05 08:31 UTC Modified: 2000-06-09 17:22 UTC
From: waldschrott at kiffen dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 Release OS: win2000
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: waldschrott at kiffen dot de
New email:
PHP Version: OS:

 

 [2000-06-05 08:31 UTC] waldschrott at kiffen dot de
var_dump() should not touch the cursors in arrays, it should work with a copy of this arrays, it should not manipulate them directly, performance is not needed using var_dump() - I think.
One has to reset() every array after using var_dump(), it this is expected behaviour, it should be documented.

Expected result: ab[dumped stuff]c
Current result: ab[dumped stuff]

<?php
$t=array('a','b','c','d');
print reset($t);
print next($t);
var_dump($t);
print next($t);
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-09 17:22 UTC] zeev at cvs dot php dot net
Fixed, thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC