#33798 [Com]: Inovoking Parent Constructor Does Work

From: Date: Thu, 21 Jul 2005 07:36:54 +0000
Subject: #33798 [Com]: Inovoking Parent Constructor Does Work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82249@lists.php.net to get a copy of this message
ID: 33798 Comment by: stochnagara at hotmail dot com Reported By: localhost dot 80 at gmail dot com Status: Open Bug Type: Scripting Engine problem Operating System: Mac OSX 10.4 Tiger PHP Version: 5.0.4 New Comment: Use __construct instead of _construct Previous Comments: ------------------------------------------------------------------------ [2005-07-21 09:04:07] localhost dot 80 at gmail dot com Description: ------------ Every Time a create a class and use a _construct() to pass arguments it does not accept any Reproduce code: --------------- <?php class book{ private $title; private $isbn; private $copies; public function _construct($isbn){ $this->setIsbn($isbn); $this->getTitle(); $this->getNumberCopies(); } public function setIsbn($isbn){ $this->isbn = $isbn; } public function getTitle(){ $this->title = "Practical Python"; print("Title: " . $this->title . "<br />"); } public function getNumberCopies(){ $this->copies = "5"; print("Number copies available: " . $this->copies . "<br />"); } } $book = new book("1590590066"); ?> Expected result: ---------------- Nothing Actual result: -------------- nothing ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33798&edit=1

« previous php.bugs (#82249) next »