Bug #44287 [Fbk->Opn]: mysql_fetch_object calls __construct too late
| From: | uw@php.net | Date: | Wed, 05 Jan 2011 16:28:32 +0000 |
| Subject: | Bug #44287 [Fbk->Opn]: mysql_fetch_object calls __construct too late | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157616@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=44287&edit=1
ID: 44287
Updated by: uw@php.net
Reported by: jaap dot taal at gmail dot com
Summary: mysql_fetch_object calls __construct too late
-Status: Feedback
+Status: Open
Type: Bug
Package: MySQL related
Operating System: *
-PHP Version: 5.2.5
+PHP Version: Any
Assigned To: mysql
Block user comment: N
Private report: N
New Comment:
Any version affected. Its questionable if we should change this and
break BC.
Previous Comments:
------------------------------------------------------------------------
[2010-11-02 17:32:10] felipe@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2008-11-10 01:00:06] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2008-11-02 13:35:01] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2008-03-25 13:30:23] jaap dot taal at gmail dot com
Note that moving the initialization of the id field from the constructor
to the declaration fixes this problem, i.e.:
class tbl_content {
var $id = null;
var $content;
function tbl_content() {
// $this->id = null;
}
}
However I still think that, from an object oriented perspective, the
constructor should be called first thing after creating an object. The
implementation of the mysql_fetch_object is wrong.
------------------------------------------------------------------------
[2008-03-25 13:23:57] jaap dot taal at gmail dot com
The constructor of the object initializes the id variable to be null
(which is needed in other cases).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=44287
--
Edit this bug report at http://bugs.php.net/bug.php?id=44287&edit=1