note 113052 added to language.oop5.decon

From: Date: Thu, 22 Aug 2013 21:06:23 +0000
Subject: note 113052 added to language.oop5.decon
Groups: php.notes 
Request: Send a blank email to php-notes+get-196054@lists.php.net to get a copy of this message
<?php /** * a funny example Mobile class * * @author Yousef Ismaeil Cliprz[At]gmail[Dot]com */ class Mobile { /** * Some device properties * * @var string * @access public */ public $deviceName,$deviceVersion,$deviceColor; /** * Set some values for Mobile::properties * * @param string device name * @param string device version * @param string device color */ public function __construct ($name,$version,$color) { $this->deviceName = $name; $this->deviceVersion = $version; $this->deviceColor = $color; echo "The ".__CLASS__." class is stratup.<br /><br />"; } /** * Some Output * * @access public */ public function printOut () { echo 'I have a '.$this->deviceName .' version '.$this->deviceVersion .' my device color is : '.$this->deviceColor; } /** * Umm only for example we will remove Mobile::$deviceName Hum not unset only to check how __destruct working * * @access public */ public function __destruct () { $this->deviceName = 'Removed'; echo '<br /><br />Dumpping Mobile::deviceName to make sure its removed, Olay :'; var_dump($this->deviceName); echo "<br />The ".__CLASS__." class is shutdown."; } } // Oh ya instance $mob = new Mobile('iPhone','5','Black'); // print output $mob->printOut(); ?> The Mobile class is stratup. I have a iPhone version 5 my device color is : Black Dumpping Mobile::deviceName to make sure its removed, Olay : string 'Removed' (length=7) The Mobile class is shutdown. ---- Server IP: 69.147.83.199 Probable Submitter: 94.129.82.143 ---- Manual Page -- http://php.net/manual/en/language.oop5.decon.php Edit -- https://master.php.net/note/edit/113052 Del: integrated -- https://master.php.net/note/delete/113052/integrated Del: useless -- https://master.php.net/note/delete/113052/useless Del: bad code -- https://master.php.net/note/delete/113052/bad+code Del: spam -- https://master.php.net/note/delete/113052/spam Del: non-english -- https://master.php.net/note/delete/113052/non-english Del: in docs -- https://master.php.net/note/delete/113052/in+docs Del: other reasons-- https://master.php.net/note/delete/113052 Reject -- https://master.php.net/note/reject/113052 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196054) next »