note 54745 deleted from language.oop5.decon by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 01:30:50 +0000 |
| Subject: | note 54745 deleted from language.oop5.decon by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133499@lists.php.net to get a copy of this message | ||
Note Submitter: nayyar at ossp dot com dot pk
----
This might help you understanding __construct() function.
<?
class submit
{
var $val1;
var $val2;
function __construct()
{
$this->val1 = 7;
$this->val2 = 9;
}
function sum()
{
return $this->val1 + $this->val2;
}
}
$tt = new submit;
$tt->val1 = 7;
$tt->val2 = 7;
$result = $tt->sum();
echo $result;
?>