note 100844 added to language.oop5.cloning
| From: | gratcypalma at gmail dot com | Date: | Wed, 10 Nov 2010 16:12:51 +0000 |
| Subject: | note 100844 added to language.oop5.cloning | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173921@lists.php.net to get a copy of this message | ||
this is my simple method, use class_alias function
<?php
class Y {
function __construct($a) {
$this -> a = $a;
}
function __destruct() {
echo $this -> a;
}
}
$mam = new Y('Foo');
class_alias('Y', 'bar'); // clone class use class_alias function
$m = new bar('Bar');
?>
----
Server IP: 69.147.83.197
Probable Submitter: 122.144.3.3
----
Manual Page -- http://www.php.net/manual/en/language.oop5.cloning.php
Edit -- https://master.php.net/note/edit/100844
Del: integrated -- https://master.php.net/note/delete/100844/integrated
Del: useless -- https://master.php.net/note/delete/100844/useless
Del: bad code -- https://master.php.net/note/delete/100844/bad+code
Del: spam -- https://master.php.net/note/delete/100844/spam
Del: non-english -- https://master.php.net/note/delete/100844/non-english
Del: in docs -- https://master.php.net/note/delete/100844/in+docs
Del: other reasons-- https://master.php.net/note/delete/100844
Reject -- https://master.php.net/note/reject/100844
Search -- https://master.php.net/manage/user-notes.php