From:             [EMAIL PROTECTED]
Operating system: windows
PHP version:      4.0.4pl1
PHP Bug Type:     Documentation problem
Bug description:  array_slice - something to be mentioned in the documentation


i just lost two hours on debugging a problem i wouldn't have encountered,
if the documentation
on the array_slice-method would be a bit more precisely.
maybe you can pronouce, that the 'offset', that is passed as the second
argument, is not an
offset as it is used as the arrays index, but as the internal pointer of
the array.

$a      = array();
$a[1]   = 'second';
$a[0]   = 'first';
$b      = array_slice( $a, 1 );
echo join( ', ', $b );

With something like this, i would exspect an output of:
In fact i get 
because first has been added later. this is logical, as php-arrays are
arrays only. But its a quite surprising result if you're familiar with
languages as
java, perl or c.

In general, i just want to add, that php is an excellent language for
programming, but it also has some strange things  (e.g. that a non
full call to strpos returns false instead of -1 etc.)


Edit bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to