nickl- - 2012-09-11

You have a point there but I don't think next_sibling and prev_sibling should be changed, they are quite precise in what you'd expect from them.

That said I can see a use, in line with our $e->children($idx) I would imagine we would find useful a $e->siblings($idx) method but if you think about it that doesn't make sense either, right?

Why don't you use:
Instead which does exactly what you need, can already be done and has no ambiguity attached, do you agree?

I was really keen for this idea but after writing out a solution it didn't make sense anymore. Just as $e->next_child() won't make sense because it's first_child not next_child unless it follows some iterator pattern perhaps. I'm really torn on this now.Maybe we should look at DomDocument or jQuery for examples?

I will see if I can roll us something like that