note 64835 added to language.oop
| From: | cyrus at uw dot hu | Date: | Fri, 21 Apr 2006 13:59:25 +0000 |
| Subject: | note 64835 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-108929@lists.php.net to get a copy of this message | ||
Hi!
its an example... function in function with class :)
<?
class exmpl{
var $things;
var $thing;
function add($id, $db) {
$this->things[$id] += $db;
}
function vizsgal($id){
if($this->things[$id] == 1){
$this->thing[$id] = "its one";
}else{
$this->thing[$id] = "its zero";
}// else end
}// else end
function kiir2($id){
$this->vizsgal($id);
$out = $this->thing[$id];
return $out;
}// func end
}
$test = new exmpl;
$test->add("1", 1); // $thing[1] = 1
$test->add("2", 1); // $thing[2] = 1
$test->add("3", 0); // $thing[3] = 0
$x = $test->kiir2(1);
print $x;
?>
// kiir2(1) => its one ---> $thing[1] = 1
// kiir2(2) => its one ----> $thing[2] = 1
// kiir2(3) => its zero ----> $thing[3] = 0
//
its just a simple easy sample...
----
Server IP: 195.228.154.4
Probable Submitter: 85.90.160.153
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/language.oop.php
Edit -- http://master.php.net/note/edit/64835
Del: integrated -- http://master.php.net/note/delete/64835/integrated
Del: useless -- http://master.php.net/note/delete/64835/useless
Del: bad code -- http://master.php.net/note/delete/64835/bad+code
Del: spam -- http://master.php.net/note/delete/64835/spam
Del: non-english -- http://master.php.net/note/delete/64835/non-english
Del: in docs -- http://master.php.net/note/delete/64835/in+docs
Del: other reasons-- http://master.php.net/note/delete/64835
Reject -- http://master.php.net/note/reject/64835
Search -- http://master.php.net/manage/user-notes.php