From: deadman_great at mail dot ru
Operating system: RH Redora, core 2
PHP version: 5.0.4
PHP Bug Type: Class/Object related
Bug description: __construct() cause __destruct() call
Description:
------------
Destructor called after constructor.
My configure string:
./configure --prefix=/usr/local --with-apache2=../httpd-2.0.53
--with-apxs2=/usr/local/apache2/bin/apxs --with-mod_charset
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd
--with-jpeg-dir=/usr/local --with-png-dir=/usr/local
--with-freetype-dir=/usr/local --with-zlib --enable-memory-limit
--enable-exif --with-ttf --enable-gd-native-ttf --with-openssl=/usr/local
--with-iconv --with-curl=/usr/local --enable-ftp --enable-sockets
--enable-maintainer-zts
Reproduce code:
---------------
<?
class Engine
{
function __construct ()
{
echo '[CONSTRUCTOR]';
}
function __destruct ()
{
echo '[DESTRUCTOR]';
}
}
echo '[BEFORE]';
$egn = new Engine();
echo '[AFTER]';
?>
Expected result:
----------------
[BEFORE][CONSTRUCTOR][AFTER][DESTRUCTOR]
Actual result:
--------------
[BEFORE][CONSTRUCTOR][DESTRUCTOR][AFTER][DESTRUCTOR]
--
Edit bug report at http://bugs.php.net/?id=33925&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33925&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33925&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33925&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33925&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33925&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33925&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33925&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33925&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33925&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33925&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33925&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33925&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33925&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33925&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33925&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33925&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33925&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33925&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33925&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33925&r=mysqlcfg