Edit report at http://bugs.php.net/bug.php?id=44287&edit=1
ID: 44287 Updated by: ka...@php.net Reported by: jaap dot taal at gmail dot com Summary: mysql_fetch_object calls __construct too late Status: Assigned Type: Bug Package: MySQL related Operating System: * PHP Version: Any Assigned To: mysql Block user comment: N Private report: N New Comment: I think we should fix this behaviour in trunk and make a note about the change in the upgrading files so its highlighted in the manual once released. Previous Comments: ------------------------------------------------------------------------ [2011-01-05 17:28:32] u...@php.net Any version affected. Its questionable if we should change this and break BC. ------------------------------------------------------------------------ [2010-11-02 17:32:10] fel...@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] j...@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. ------------------------------------------------------------------------ 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