note 104068 added to language.oop5

From: Date: Fri, 20 May 2011 17:10:17 +0000
Subject: note 104068 added to language.oop5
Groups: php.notes 
Request: Send a blank email to php-notes+get-179913@lists.php.net to get a copy of this message
<?php class myName { public $data_member1='myValue1';// without defining any func we can call it . public $data_member2='myValue2';// but with PUBLIC only. public function useMe($dataStore){ echo $this->data=$dataStore;//now we are accessing data for object. } } $object1 = new myName();// we are creating obj. $object2 = new myName();// each obj allocates different space in memory. echo $object1->data_member1."<br/>";// we called it without any func. echo $object2->data_member2."<br/>";//we called it without any func. $object1->useMe("this is the output through func");// here through func we are calling it. ?> ---- Server IP: 69.147.83.197 Probable Submitter: 124.125.65.192 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.php Edit -- https://master.php.net/note/edit/104068 Del: integrated -- https://master.php.net/note/delete/104068/integrated Del: useless -- https://master.php.net/note/delete/104068/useless Del: bad code -- https://master.php.net/note/delete/104068/bad+code Del: spam -- https://master.php.net/note/delete/104068/spam Del: non-english -- https://master.php.net/note/delete/104068/non-english Del: in docs -- https://master.php.net/note/delete/104068/in+docs Del: other reasons-- https://master.php.net/note/delete/104068 Reject -- https://master.php.net/note/reject/104068 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179913) next »