ID:               48354
 Updated by:       [email protected]
 Reported By:      php_net at foq dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: debian etch
 PHP Version:      5.2.9
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




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

[2009-05-21 12:57:50] php_net at foq dot nl

photo() {

has to be 

function photo() {


I wrote this code as example by hand without testing because my code
library is very huge. So that is not the main problem. The PHP code
executes without any syntax errors.

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

[2009-05-21 12:54:24] php_net at foq dot nl

Description:
------------
I am using a base class and a lot of classes which extend that base
class. When i add class variables in the base class i can use those in
the extending class. All goed well. But when i set variables from the
base class constructor then the extended class does not get these new
values. I tested, and the base class constructor is not executed.

Reproduce code:
---------------
class base {
    var $mysql_link = null;
    var $test = "hello";

    function base() {
      $this->test = "helloolleh";
      $this->mysql_link = mysql_connect("host", "user", "pass");
      if(!$this->mysql_link)
        exit("mysql connection failed.");
    }
}

class photo extends base {
      photo() {
        print "photo constructor is working!\n";
        print "But the base class not: '".$this->test."'\n";
        mysql_query("Select foo from bar", $this->mysql_link) or
die(mysql_error());
      }
}

$p = new photo();

Expected result:
----------------
photo constructor is working!
helloolleh
Error in query

Actual result:
--------------
 // nothing
hello
mysql: not a valid resource identifier


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


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

Reply via email to