<?php
$html = <<<EOD
<div style="text-align: center;" class="navigation">
<span class="pagination">
<span>« novější</span> |
<span>1</span> |
<a href="?listType=&sort=&page=1">2</a> |
<a href="?listType=&sort=&page=2">3</a> |
<a href="?listType=&sort=&page=3">4</a> |
<a href="?listType=&sort=&page=1">starší »</a>
</span>
</div>
EOD;
$dom = PHPQuery::newDocument($html);
var_dump($dom->find('.navigation > .pagination > *')->eq(-2)->text());
var_dump($dom->find('.navigation > .pagination > *:last-child(2)')->text());
string(0) ""
string(11) "starší »"
$dom = PHPQuery::newDocument($html);
$elems = $dom->find('.navigation > .pagination > *');
if( $elems->length ) {
$penult = $elems->length - ($elems->length > 2 ? 2 : 1);
var_dump($elems->eq($penult)->text());
}