note 120295 added to arrayobject.getarraycopy
| From: | jlshor at buffalo dot edu | Date: | Wed, 07 Dec 2016 20:53:23 +0000 |
| Subject: | note 120295 added to arrayobject.getarraycopy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-208271@lists.php.net to get a copy of this message | ||
Is there a difference between casting to an array and using this function?
For instance, if we have:
$arrayObject = new ArrayObject([1, 2, 3]);
Is there a difference between these:
$array = (array) $arrayObject;
vs
$array = $arrayObject->getArrayCopy();
If not, is there any scenario where they would produce different results, or do they produce the
result in different ways?
----
Server IP: 72.52.91.14
Probable Submitter: 173.192.119.71
----
Manual Page -- http://php.net/manual/en/arrayobject.getarraycopy.php
Edit -- https://master.php.net/note/edit/120295
Del: integrated -- https://master.php.net/note/delete/120295/integrated
Del: useless -- https://master.php.net/note/delete/120295/useless
Del: bad code -- https://master.php.net/note/delete/120295/bad+code
Del: spam -- https://master.php.net/note/delete/120295/spam
Del: non-english -- https://master.php.net/note/delete/120295/non-english
Del: in docs -- https://master.php.net/note/delete/120295/in+docs
Del: other reasons-- https://master.php.net/note/delete/120295
Reject -- https://master.php.net/note/reject/120295
Search -- https://master.php.net/manage/user-notes.php