File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / ereg / tests / split_variation_004.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:54 2012 UTC (12 years, 5 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--
Test split() function : usage variations  - out-of-range values for limit
--FILE--
<?php
/* Prototype  : proto array split(string pattern, string string [, int limit])
 * Description: Split string into array by regular expression 
 * Source code: ext/standard/reg.c
 * Alias to functions: 
 */

function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
	echo "Error: $err_no - $err_msg, $filename($linenum)\n";
}
set_error_handler('test_error_handler');
echo "*** Testing split() : usage variations ***\n";

$pattern = '[[:space:]]';
$string = '1 2 3 4 5';
var_dump(split($pattern, $string, 0));
var_dump(split($pattern, $string, -10));
var_dump(split($pattern, $string, 10E20));


echo "Done";
?>
--EXPECTF--
*** Testing split() : usage variations ***
Error: 8192 - Function split() is deprecated, %s(16)
array(1) {
  [0]=>
  string(9) "1 2 3 4 5"
}
Error: 8192 - Function split() is deprecated, %s(17)
array(1) {
  [0]=>
  string(9) "1 2 3 4 5"
}
Error: 8192 - Function split() is deprecated, %s(18)
array(1) {
  [0]=>
  string(9) "1 2 3 4 5"
}
Done

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