note 72076 added to language.oop5.basic
| From: | aeternuslibertas at gmail dot com | Date: | Mon, 01 Jan 2007 07:29:54 +0000 |
| Subject: | note 72076 added to language.oop5.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121161@lists.php.net to get a copy of this message | ||
in php 5 when defining a variable withing a class the $var statement is outdated and instead one
should use, public, private or protected...
like this ......
<?php
//php5
//class definition- object oriented programming
class oop_example{
public $my_variable;
public function my_function(){
echo $this->my_variable;
}
}
$my_object= new oop_example;
$my_object->my_variable="Hello World";
$my_object->my_function();
//the above code results in...
//hello world
?>
----
Server IP: 66.163.161.117
Probable Submitter: 69.219.173.215
----
Manual Page -- http://www.php.net/manual/en/language.oop5.basic.php
Edit -- https://master.php.net/note/edit/72076
Del: integrated -- https://master.php.net/note/delete/72076/integrated
Del: useless -- https://master.php.net/note/delete/72076/useless
Del: bad code -- https://master.php.net/note/delete/72076/bad+code
Del: spam -- https://master.php.net/note/delete/72076/spam
Del: non-english -- https://master.php.net/note/delete/72076/non-english
Del: in docs -- https://master.php.net/note/delete/72076/in+docs
Del: other reasons-- https://master.php.net/note/delete/72076
Reject -- https://master.php.net/note/reject/72076
Search -- https://master.php.net/manage/user-notes.php