note 113046 added to language.oop5.overloading
| From: | YousefIsmaeilCliprz | Date: | Thu, 22 Aug 2013 08:21:25 +0000 |
| Subject: | note 113046 added to language.oop5.overloading | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196048@lists.php.net to get a copy of this message | ||
Set a property outside object :
Yes we can
<?php
/**
* Example to Set and Get a property outside object
*
* @author Yousef Ismaeil Cliprz[At]Gmail[Dot]com
*/
class Apple {
/**
* Device name
*
* @var string
* @access public
*/
public $device;
}
// Create object
$apple = new Apple();
// Set device name
$apple->device = 'iPhone';
// set a new property
$apple->version = '4s'; // 4s for example
// Get the Apple::$device property and the new property Apple::$version
echo ("This is Apple {$apple->device} version {$apple->version}");
?>
----
Server IP: 69.147.83.199
Probable Submitter: 37.231.222.186
----
Manual Page -- http://php.net/manual/en/language.oop5.overloading.php
Edit -- https://master.php.net/note/edit/113046
Del: integrated -- https://master.php.net/note/delete/113046/integrated
Del: useless -- https://master.php.net/note/delete/113046/useless
Del: bad code -- https://master.php.net/note/delete/113046/bad+code
Del: spam -- https://master.php.net/note/delete/113046/spam
Del: non-english -- https://master.php.net/note/delete/113046/non-english
Del: in docs -- https://master.php.net/note/delete/113046/in+docs
Del: other reasons-- https://master.php.net/note/delete/113046
Reject -- https://master.php.net/note/reject/113046
Search -- https://master.php.net/manage/user-notes.php