CakeFest 2025 Madrid: The Official CakePHP Conference

Voting

: max(eight, one)?
(Example: nine)

The Note You're Voting On

jlshor at buffalo dot edu
8 years ago
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?

<< Back to user notes page

To Top