note 81826 added to function.ArrayObject-construct
| From: | german dot rumm at gmail dot com | Date: | Fri, 14 Mar 2008 18:37:47 +0000 |
| Subject: | note 81826 added to function.ArrayObject-construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137072@lists.php.net to get a copy of this message | ||
BTW, if you need to change array later, use exchangeArray() method. Good to know when you are
writing a class that extends ArrayObject()
AFAIK, exchangeArray() doesn't return anything.
<?php
$a = array('one', 'two', 'three');
$ao = new ArrayObject($a);
foreach ($ao as $element) {
echo $element . ' '; // one two three
}
$b = array('four', 'five', 'six');
$ao->exchangeArray($b); // returns null
foreach ($ao as $element) {
echo $element . ' '; // four five six
}
?>
----
Server IP: 195.222.16.153
Probable Submitter: 88.196.56.232
----
Manual Page -- http://www.php.net/manual/en/function.ArrayObject-construct.php
Edit -- https://master.php.net/note/edit/81826
Del: integrated -- https://master.php.net/note/delete/81826/integrated
Del: useless -- https://master.php.net/note/delete/81826/useless
Del: bad code -- https://master.php.net/note/delete/81826/bad+code
Del: spam -- https://master.php.net/note/delete/81826/spam
Del: non-english -- https://master.php.net/note/delete/81826/non-english
Del: in docs -- https://master.php.net/note/delete/81826/in+docs
Del: other reasons-- https://master.php.net/note/delete/81826
Reject -- https://master.php.net/note/reject/81826
Search -- https://master.php.net/manage/user-notes.php