array_has_more

From: Date: Fri, 04 Jul 2003 01:56:31 +0000
Subject: array_has_more
Groups: php.internals 
Request: Send a blank email to internals+get-3236@lists.php.net to get a copy of this message
Hello internals, during my todays work i was again reminded that still one array function is missing namely array_has_more. This function will return true if there are more elements in an array and false if not. The real problem is that next() doesn't work with false. A diff against PHP 5 is attached. If noone objects i'll commit this later on friday. Examle: <?php $ar = array(2,1,false,0); $i = 0; function show() { global $ar, $i; echo "loop: ";var_dump($i++); echo "curr: ";var_dump(current($ar)); echo "more: ";var_dump(array_has_more($ar)); echo "curr: ";var_dump(current($ar)); echo "next: ";var_dump(next($ar)); echo "\n"; } show(); show(); show(); show(); show(); show(); ?> -- Best regards, Marcus mailto:helly@php.net

« previous php.internals (#3236) next »