note 111039 added to arrayobject.getarraycopy
| From: | james at rodenkirch dot com | Date: | Tue, 08 Jan 2013 20:46:10 +0000 |
| Subject: | note 111039 added to arrayobject.getarraycopy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192847@lists.php.net to get a copy of this message | ||
Made a small change to your code. The param in the method was never used.
/**
* method to recursively convert ArrayObject to array
*
* @return array
*/
public function getArray() {
$data = array_map( function($item){
if (is_object($item)) {
return $item->getArray(true);
} else {
return $item;
}
}, $this->getArrayCopy() );
return $data;
}
----
Server IP: 69.147.83.199
Probable Submitter: 23.25.58.164
----
Manual Page -- http://php.net/manual/en/arrayobject.getarraycopy.php
Edit -- https://master.php.net/note/edit/111039
Del: integrated -- https://master.php.net/note/delete/111039/integrated
Del: useless -- https://master.php.net/note/delete/111039/useless
Del: bad code -- https://master.php.net/note/delete/111039/bad+code
Del: spam -- https://master.php.net/note/delete/111039/spam
Del: non-english -- https://master.php.net/note/delete/111039/non-english
Del: in docs -- https://master.php.net/note/delete/111039/in+docs
Del: other reasons-- https://master.php.net/note/delete/111039
Reject -- https://master.php.net/note/reject/111039
Search -- https://master.php.net/manage/user-notes.php