ID:               33397
 Updated by:       [EMAIL PROTECTED]
 Reported By:      nikolaeff at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux
 PHP Version:      4.3.11
 New Comment:

No, you're wrong.



Previous Comments:
------------------------------------------------------------------------

[2005-06-19 06:57:11] nikolaeff at gmail dot com

Description:
------------
Guess that $site->config shouldn't became reference after it passed to
method by reference. Am i right ?


Reproduce code:
---------------
class Config {}

class Database {
    function Database(&$config) {} /* here */
}

class Site {
    var $config;
    var $db;
    function Site() {
        $this->config = new Config();
        /* turns $this->config to a reference: */
        $this->db     = new Database($this->config); 
    }
}

$site = new Site();
var_dump($site);


Expected result:
----------------
object(site)(2) {
  ["config"]=>
  object(config)(0) {
  }
  ["db"]=>
  object(database)(0) {
  }
}


Actual result:
--------------
object(site)(2) {
  ["config"]=>
  &object(config)(0) {
  }
  ["db"]=>
  object(database)(0) {
  }
}



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33397&edit=1

Reply via email to