|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67683 var_dump() makes the following codes execute twice
Submitted: 2014-07-25 11:11 UTC Modified: 2014-07-26 01:45 UTC
From: enadiz at foxmail dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 5.5.15 OS: Linux 3.13.0-24-generic #Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
5 + 47 = ?
Subscribe to this entry?

 [2014-07-25 11:11 UTC] enadiz at foxmail dot com
The example A runs correctly .It's output on browse is like this
: int(0) test
and the output in file "test.txt" is

The example B doesn't runs correctly .It's output on browse is 
: int(0) test 
    which with no problem
but the output in file "test.txt" is like that
    it means that all the codes executed twice except the line contains "echo".I try replaced "file_put_contents " to other operation likes mysql's insert ,it  still executed twice and the database inserted two records;

Test script:
<?php    //example A
echo 'test';
file_put_contents("test.txt",time()."\r\n", FILE_APPEND);

<?php   // example B which some codes execute twice
echo 'test';
file_put_contents("test.txt",time()."\r\n", FILE_APPEND);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-25 16:34 UTC]
-Status: Open +Status: Feedback
 [2014-07-25 16:34 UTC]
If you're only seeing the "int(0) test" once then the script is only executing once. It may have executed previously, like if you forgot that test.txt is being appended to, or the browser may have executed it twice (Chrome sometimes does this), but PHP itself is not doing it.

What if you dump $_SERVER["REQUEST_TIME_FLOAT"] to the file? Does it put the same number or two different numbers? What do your server access logs show?
 [2014-07-26 01:45 UTC] enadiz at foxmail dot com
-Status: Feedback +Status: Closed
 [2014-07-26 01:45 UTC] enadiz at foxmail dot com
It is not php's problem ,because of that the Chrome would reload the page when var_dump executed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 13:01:30 2024 UTC