xref: /PHP-5.3/ext/mbstring/tests/mb_ereg1.phpt (revision 1fa1bd7a)
1--TEST--
2mb_ereg() and invalid arguments
3--SKIPIF--
4<?php if (!function_exists("mb_ereg")) print "skip"; ?>
5--FILE--
6<?php
7
8$a = array(
9	array(1,2,3),
10	array("", "", ""),
11	array(array(), 1, ""),
12	array(1, array(), ""),
13	array(1, "", array()),
14	);
15
16foreach ($a as $args) {
17	var_dump(mb_ereg($args[0], $args[1], $args[2]));
18	var_dump($args);
19}
20?>
21===DONE===
22--EXPECTF--
23bool(false)
24array(3) {
25  [0]=>
26  int(1)
27  [1]=>
28  int(2)
29  [2]=>
30  int(3)
31}
32
33Warning: mb_ereg(): empty pattern in %s on line %d
34bool(false)
35array(3) {
36  [0]=>
37  string(0) ""
38  [1]=>
39  string(0) ""
40  [2]=>
41  string(0) ""
42}
43
44Notice: Array to string conversion in %s on line %d
45bool(false)
46array(3) {
47  [0]=>
48  array(0) {
49  }
50  [1]=>
51  int(1)
52  [2]=>
53  string(0) ""
54}
55
56Warning: mb_ereg() expects parameter 2 to be string, array given in %s on line %d
57bool(false)
58array(3) {
59  [0]=>
60  int(1)
61  [1]=>
62  array(0) {
63  }
64  [2]=>
65  string(0) ""
66}
67bool(false)
68array(3) {
69  [0]=>
70  int(1)
71  [1]=>
72  string(0) ""
73  [2]=>
74  array(0) {
75  }
76}
77===DONE===
78