note 117536 added to splfixedarray.offsetexists
| From: | depoemarc at swap dot fn dot ln dot googlemail dot com | Date: | Thu, 25 Jun 2015 14:47:03 +0000 |
| Subject: | note 117536 added to splfixedarray.offsetexists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202952@lists.php.net to get a copy of this message | ||
It should be noted that offsetExists behaves like "offsetIsSet" rather than
"offsetIsValid":
<?php
$arr = new SplFixedArray(3);
var_dump($arr->offsetExists(1)); // false
$arr[1] = 42; // $arr->offsetSet(1, 42);
var_dump($arr->offsetExists(1)); // true
$arr[1] = null; // $arr->offsetSet(1, null);
var_dump($arr->offsetExists(1)); // true
unset($arr[1]); // $arr->offsetUnset(1);
var_dump($arr->offsetExists(1)); // false
var_dump($arr);
/*
object(SplFixedArray)[1]
null
null
null
*/
?>
----
Server IP: 72.52.91.14
Probable Submitter: 24.47.48.21
----
Manual Page -- http://php.net/manual/en/splfixedarray.offsetexists.php
Edit -- https://master.php.net/note/edit/117536
Del: integrated -- https://master.php.net/note/delete/117536/integrated
Del: useless -- https://master.php.net/note/delete/117536/useless
Del: bad code -- https://master.php.net/note/delete/117536/bad+code
Del: spam -- https://master.php.net/note/delete/117536/spam
Del: non-english -- https://master.php.net/note/delete/117536/non-english
Del: in docs -- https://master.php.net/note/delete/117536/in+docs
Del: other reasons-- https://master.php.net/note/delete/117536
Reject -- https://master.php.net/note/reject/117536
Search -- https://master.php.net/manage/user-notes.php