Voting

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

The Note You're Voting On

Jason
9 years ago
It's worth noting that the PHP devs *did* fix the issue brought up in Sam's comment in 2013 (per the comment thread in his link here: https://bugs.php.net/bug.php?id=34783#1366088374), since at least PHP 5.3.8.

So, you *can* (and in most cases should) overload offsetGet with reference syntax to get expected functionality:

<?php
class myArrayType extends ArrayAccess {

public function &
offsetGet($index) {
// ...
}

}
?>

<< Back to user notes page

To Top