/hphp/test/slow/ext_array/array_shift.php
PHP | 35 lines | 29 code | 6 blank | 0 comment | 0 complexity | 89679742c9deabcfc5983c9bb748af8d MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- function a() {
- $input = darray["a" => 1, "b" => 2];
- array_shift(inout $input);
- var_dump($input);
- }
- function b() {
- $input = darray["a" => 1, 23 => 2];
- array_shift(inout $input);
- var_dump($input);
- }
- function c() {
- $input = darray["a" => 1, -23 => 2];
- array_shift(inout $input);
- var_dump($input);
- }
- function d() {
- $input = varray["orange", "banana", "apple", "raspberry"];
- $fruit = array_shift(inout $input);
- var_dump($input);
- var_dump($fruit);
- }
- <<__EntryPoint>>
- function main_array_shift() {
- a();
- b();
- c();
- d();
- }