note 54315 deleted from functions.arguments by cmb
| From: | cmb@php.net | Date: | Sun, 10 Nov 2019 12:59:15 +0000 |
| Subject: | note 54315 deleted from functions.arguments by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213020@lists.php.net to get a copy of this message | ||
Note Submitter: balint , at ./ atres &*( ath !# cx
----
(in reply to benk at NOSPAM dot icarz dot com / 24-Jun-2005 04:21)
I could make use of this assignment, as below, to have a permanently existing, but changing data
block (because it is used by many other classes), where the order or the refreshed contents are
needed for the others: (DB init done by one, an other changed the DB, and thereafter all others need
to use the other DB without creating new instances, or creating a log array in one, and we would
like to append the new debug strings to the array, atmany places.)
class xyz {
var argN = array();
function xyz($argN) {
$this->argN = &$argN;
}
function etc($text) {
array_push($this->argN, $text);
}
}
class abc {
var argM = array();
function abc($argM) {
$this->argM = &$argM;
}
function etc($text) {
array_push($this->argM, $text);
}
}
$messages=array("one", "two");
$x = new xyz(&$messages);
$x->etc("test");
$a = new abc(&$messages);
$a->etc("tset");
...