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
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-09 17:22 UTC] zeev at cvs dot php dot net
Fixed, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 13 15:01:33 2024 UTC