File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array / bug41686.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:03 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
Bug #41686 (Omitting length param in array_slice not possible)
--FILE--
<?php
$a = array(1,2,3);
$b = array('a'=>1,'b'=>1,'c'=>2);

var_dump(
		array_slice($a, 1), 
		array_slice($a, 1, 2, TRUE),
		array_slice($a, 1, NULL, TRUE), 
		array_slice($b, 1), 
		array_slice($b, 1, 2, TRUE), 
		array_slice($b, 1, NULL, TRUE)
);

echo "Done\n";
?>
--EXPECT--	
array(2) {
  [0]=>
  int(2)
  [1]=>
  int(3)
}
array(2) {
  [1]=>
  int(2)
  [2]=>
  int(3)
}
array(2) {
  [1]=>
  int(2)
  [2]=>
  int(3)
}
array(2) {
  ["b"]=>
  int(1)
  ["c"]=>
  int(2)
}
array(2) {
  ["b"]=>
  int(1)
  ["c"]=>
  int(2)
}
array(2) {
  ["b"]=>
  int(1)
  ["c"]=>
  int(2)
}
Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>