php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9091 the Contructor of a class is called after! the end of a script
Submitted: 2001-02-03 17:53 UTC Modified: 2002-09-30 19:13 UTC
From: sauer1 at big-web dot de Assigned:
Status: Not a bug Package: Other
PHP Version: 3.0.16 OS: Unix (Apache/1.3.14)
Private report: No CVE-ID: None
 [2001-02-03 17:53 UTC] sauer1 at big-web dot de
I builded a class and in the constructor of the class i made a entry in a Database. The entry contains among other values the actual time.

Every time i call a script in whitch a instance of this class is made i get two entries in the database. I wondered why and added outputs to see when and how often the constructor is called. But in the script-output i saw that the contructor is called only one time. 
As i output the time() at the very end of my script i saw that the second entry was made after that time!! I thinkt in normal case that is not possible.

I dont know if this is a bug, but i think this is not the normal behavior. On my own machine the same script produces only one entry in the database.

Perhaps the constructor is called instead of the destructor.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-30 19:13 UTC] hholzgra@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


hard to tell without sample code

but sounds more like proxy or browser reload problem

btw: there are no desctructors in php 3 and 4
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 30 22:01:28 2024 UTC