From:             valentiny510 at yahoo dot es
Operating system: Secret :)
PHP version:      5.4.19
Package:          Class/Object related
Bug Type:         Feature/Change Request
Bug description:__destruct act different when instantiate class with/out var

Description:
------------
When the class is instantiated with a variable is working like one
espect...
but the issue come when you want to miss the variable, because you don't
use it or whatever reason..

Can be possible to act the same way both times ?

Examples below..

Test script:
---------------
<?php
class Html
{
    function __construct( ) { echo "Header\n"; }
    function __construct( ) { echo "\nFooter"; }
}

# without variable
new Html;
<p>Some html here...</p>

# with $html var...
$html = new Html;
<p>Some html here...</p>


Expected result:
----------------
Header
Some html here...
Footer

Header
Some html here...
Footer


Actual result:
--------------
Header
Footer <-- This is the problem...
Some html here...

Header
Some html here...
Footer


-- 
Edit bug report at https://bugs.php.net/bug.php?id=65664&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65664&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65664&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65664&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65664&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65664&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65664&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65664&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65664&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65664&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65664&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65664&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65664&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65664&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65664&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65664&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65664&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65664&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65664&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65664&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65664&r=mysqlcfg

Reply via email to