downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ArrayAccess::offsetUnset> <ArrayAccess::offsetGet
[edit] Last updated: Fri, 30 Nov 2012

view this page in

ArrayAccess::offsetSet

(PHP 5 >= 5.0.0)

ArrayAccess::offsetSetOffset to set

Opis

abstract public void ArrayAccess::offsetSet ( mixed $offset , mixed $value )

Assigns a value to the specified offset.

Parametry

offset

The offset to assign the value to.

value

The value to set.

Zwracane wartości

Nie jest zwracana żadna wartość.

Notatki

Informacja:

The offset parameter will be set to NULL if another value is not available, like in the following example.

<?php
$arrayaccess
[] = "first value";
$arrayaccess[] = "second value";
print_r($arrayaccess);
?>

Powyższy przykład wyświetli:

Array
(
    [0] => first value
    [1] => second value
)

Informacja:

This function is not called in assignments by reference and otherwise indirect changes to array dimensions overloaded with ArrayAccess (indirect in the sense they are made not by changing the dimension directly, but by changing a sub-dimension or sub-property or assigning the array dimension by reference to another variable). Instead, ArrayAccess::offsetGet() is called. The operation will only be successful if that method returns by reference, which is only possible since PHP 5.3.4.



add a note add a note User Contributed Notes ArrayAccess::offsetSet - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites