PHP Conference China 2020

# pht\Vector::shift

(PECL pht >= 0.0.1)

pht\Vector::shiftShifts a value from the vector

### Description

public pht\Vector::shift ( void ) : mixed

This method shifts a value from the front of a vector (in linear time). Shifting a value from an empty vector will result in an Error exception.

### Parameters

This function has no parameters.

### Return Values

The value from the front of the vector.

### Examples

Example #1 Shifting a value from a vector

``` <?phpuse pht\Vector;\$vector = new Vector();\$vector->push(1);\$vector[] = 2;var_dump(\$vector->shift()); ```

The above example will output:

```int(1)
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.60945153,"math_prob":0.851747,"size":475,"snap":"2020-34-2020-40","text_gpt3_token_len":131,"char_repetition_ratio":0.19745223,"word_repetition_ratio":0.027027028,"special_character_ratio":0.28,"punctuation_ratio":0.15151516,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99415576,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-22T17:54:43Z\",\"WARC-Record-ID\":\"<urn:uuid:96577138-ef44-4486-ab6d-518b62c0ce71>\",\"Content-Length\":\"20946\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4f384f3d-2507-48e1-bc9c-218ac10879fd>\",\"WARC-Concurrent-To\":\"<urn:uuid:ebc58afd-4371-496a-b40f-7c5a4e924a3a>\",\"WARC-IP-Address\":\"195.54.192.44\",\"WARC-Target-URI\":\"http://php.rinet.ru/manual/en/pht-vector.shift.php\",\"WARC-Payload-Digest\":\"sha1:222A5USVTL7ARLNUPUGX4RK2NKLVO4YP\",\"WARC-Block-Digest\":\"sha1:NWDOWDBJVWSICUZR64THHEWPHLE5TKSA\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400206329.28_warc_CC-MAIN-20200922161302-20200922191302-00172.warc.gz\"}"}