array_slice confused about negative length

Why is the second array below empty? It seems array_splice cannot grok negative length, despite its docs.

<?php
$array
= array('a' => '1');

// GOOD
print_r(array_slice($array, 010));

// WTF. Why empty array?
print_r(array_slice($array, 0,  -10));
?>

Array
(
    [a] => 1
)
Array
(
)

Comments

It does work, but differently

As commenting was inoperative due to a site issue, I wrote my comment as a blog post.

In short, it does work as designed and specified, but it may not perhaps be what you would intuitively expect (i.e. counting back 10 elements starting at the start point). Instead, it counts forward from the start point, until 10 elements before the end point (which in this case lies well before the start point, even outside the array), which explains why the empty array is returned.

Thanks for sharing. i really

Thanks for sharing. i really appreciate it that you shared with us such a informative post... Honeywell Humidifier Filters

You have got some great posts

You have got some great posts in your blog. Keep up with the good work.
Playa den bossa apartments

Is almost every post on the

Is almost every post on the site from people who can't read the docs correctly. Come on.

The author was expecting to work as the negative offset does, not the negative count:

array_slice($array, -1, 10);

Generally I do not post on

Generally I do not post on blogs, but I would like to say that this post really forced me to do so, Excellent post!
divorce forms

Ein Fertigteilhaus im

Ein Fertigteilhaus im Test.
Das Bleaching testen.
Einen Ratenkredit Vergleich machen.
Wie Gold kaufen gesehen wird.
Wie das Imbisswagen funktioniert.
Eine Online Fett-Absaugung testen.
das Bleaching durchführen.
Wie Seniorenpflege aussehen kann.
Ein Dokumentenmanagement Kosten einsehen.
Wie Depressionen Hilfen aussehen.
Die Treppenlift Kosten testen.

Wie Kachelofen Kosten aussehen
Eine Nasen-Korrektur Kosten testen.
Wie Narben korrigieren funktionieren wird.

There are extensive materials

There are extensive materials on the web that provide a through and broad look on Muay Thai. Muay Thai movies and documentaries are also an excellent source of training and cultural material.

source: muay thai thailand

Die private

Die private Krankenversicherung Test abschliessen.
Den PKV-Test machen.
Eine Kreditkarte kostenfrei im Web testen.
Wie eine PKV funktioniert.

Unshrinking is nicely act and

Unshrinking is nicely act and it contains numerous enforcement things for me. I am settlings to aid your unnerving way of lancinating the performing. Now it backward unsubdivided for me to mercantilism and obligate the hypothecate. Thanks for coitus the job.
Job Descriptions

The speech execute our ethos

The speech execute our ethos to someone distinguish polished knowledge and aim to act grouping foreclose and mentation nearly the oversize deliver. Arrange you
InsideYourRV.com

I used to be more than happy

I used to be more than happy to seek out this internet-site.I wanted to thanks in your time for this glorious read!! I positively enjoying each little bit of it and I have you bookmarked to check out new stuff you weblog post honda accord / Honda Civic

Wie sich Patienten in der PKV

Wie sich Patienten in der PKV behandelt fühlen.

Thesis writers Its not the

Thesis writers
Its not the case that reader must be completely agreed with author's views about article. So this is what happened with me, anyways its a good effort, I appreciate it. Thanks

new york glass ny shower door

Saree Its not the case that

Saree
Its not the case that reader must be completely agreed with author's views about article. So this is what happened with me, anyways its a good effort, I appreciate it. Thanks

Nice to be visiting your blog

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.
Honeywell Thermostats

love to all of mankind

hi this is a car for salegreat site.

I really like the way the

I really like the way the writer presented his views in this blog. flowers germany delivery

The post is written in very a

The post is written in very a good manner and it entails many useful information for me.airport parking I am happy to find your distinguished way of writing the post.QAA approved Now you make it easy for me to understand and implement the concept.gatwick meet and greet Thank you for the post.The title part of the post made me come here and see what it is about.Sushi Recipes I love the it and would love to share it with my other friend. Sushi RecipesI wonder if you can put sharing button on it, that will be easy to bring more people to read you. gatwick car parking

Good post

Really this is an unknown and different information for me because I am not working on this field. You have taught me a wonderful information. I like this article very much. Thanks for sharing.
Domain name purchase India

Trying to wish my luck with PHP

I am trying to work my way to become a PHP develop and this site helps me a lot. For now, I am pushing electric pallet truck to help my studies.

As a MLM network marketing

As a MLM network marketing trainer and consultant, I know the importance of incorporating a 90 day marketing plan of action into a business, especially multi-level programs. In order to attain immediate momentum in your new business, this step is the most important of them all. So how is this marketing plan developed, and what pillars of marketing are necessary for ultimate success?

Strength vs. Weakness

The first components to consider with a 90 day marketing plan are your strengths and great PhuketResults marketing. Are you an intermediate online marketer, a beginner, or advanced? Are you a good writer? Do you feel shy being on video? Are you a good speaker? These are great questions to ask yourself before outlining a plan of action. I have personally found my strengths to be in three major areas of marketing. These include article marketing, blogging, and video marketing. The key is to have at least 3-5 pillars of marketing circulating on a daily basis. Being a MLM network marketing training coach, I always emphasize the beauty of marketing pillars.

awesome

Very interesting post... something really informative... I wish to read something like this again... we keep coming back to your blog..
State Divorce

These include article

These include article marketing, blogging, and video marketing. The key is to have at least 3-5 pillars of marketing circulating on a daily basis. Being a MLM network marketing training coach, I always emphasize the beauty of marketing pillars.
stylish look

Black diamond strands for

Black diamond strands for what amounts to basically doing nothing but traversing a binary tree, the overhead from making the recursive function call accounts for about 70% (!!!) of total execution time.