Hello Andi,
Friday, July 4, 2003, 10:18:41 PM, you wrote:
AG> At 07:00 PM 4/7/2003 +0200, Marcus B�rger wrote:
>>Hello Andi,
>>
>>damn, yeah, it was already to early in the morning when i sent the mail, i
>>somehow didn't notice that i was trying to send a '.tx' file :-(
AG> What you are saying is that differentiating between a null value from
AG> next() and not having more elements is impossible without such a function?
AG> (I just want to be sure I understand what your motivation is).
AG> I don't really have a problem with array_has_more() the only problem is the
AG> name is not consistent with the other methods but on the other hand we
AG> don't allow new functions which don't follow the naming conventions.
AG> Catch-22? :)
AG> Andi
Yes and yes (but the problem is with false). Hm a new name, don't know. you
you have a better idea than mine? First i thought about more but that itsn't
really good. Then i went for has_more but new array functions should have
prefix 'array_' so it became 'array_has_more'.
marcus
>>Friday, July 4, 2003, 11:55:01 AM, you wrote:
>>
>>AG> You forgot to attach the diff :)
>>
>>AG> Andi
>>
>>AG> At 03:56 AM 4/7/2003 +0200, Marcus B�rger wrote:
>> >>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:[EMAIL PROTECTED]
>> >>--
>> >>PHP Internals - PHP Runtime Development Mailing List
>> >>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>>--
>>Best regards,
>> Marcus mailto:[EMAIL PROTECTED]
--
Best regards,
Marcus mailto:[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php