xref: /PHP-7.3/ext/mbstring/tests/mb_ereg2.phpt (revision 782352c5)
1--TEST--
2mb_ereg() returning matches
3--SKIPIF--
4<?php
5if (!extension_loaded('mbstring')) die('skip mbstring not enabled');
6if (!function_exists("mb_ereg")) print "skip mb_ereg() not available";
7?>
8--FILE--
9<?php
10
11$a = -1; $b = -1; $c = -1;
12mb_ereg($a, $b, $c);
13var_dump($a, $b, $c);
14
15mb_eregi($a, $b, $c);
16var_dump($a, $b, $c);
17
18mb_ereg_search_init($a, $b, $c);
19var_dump($a, $b, $c);
20
21echo "Done\n";
22?>
23--EXPECTF--
24int(-1)
25int(-1)
26array(1) {
27  [0]=>
28  string(2) "-1"
29}
30int(-1)
31int(-1)
32array(1) {
33  [0]=>
34  string(2) "-1"
35}
36
37Warning: mb_ereg_search_init() expects parameter 3 to be string, array given in %s on line %d
38int(-1)
39int(-1)
40array(1) {
41  [0]=>
42  string(2) "-1"
43}
44Done
45