xref: /PHP-7.4/ext/mbstring/tests/mb_ereg3.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// Note: This test is identical to mb_ereg2.phpt, but using deprecated mbereg_* aliases.
12// Deleted it once the deprecated aliases have been removed.
13
14$a = -1; $b = -1; $c = -1;
15mbereg($a, $b, $c);
16var_dump($a, $b, $c);
17
18mberegi($a, $b, $c);
19var_dump($a, $b, $c);
20
21mbereg_search_init($a, $b, $c);
22var_dump($a, $b, $c);
23
24echo "Done\n";
25?>
26--EXPECTF--
27Deprecated: Function mbereg() is deprecated in %s on line %d
28int(-1)
29int(-1)
30array(1) {
31  [0]=>
32  string(2) "-1"
33}
34
35Deprecated: Function mberegi() is deprecated in %s on line %d
36int(-1)
37int(-1)
38array(1) {
39  [0]=>
40  string(2) "-1"
41}
42
43Deprecated: Function mbereg_search_init() is deprecated in %s on line %d
44
45Warning: mbereg_search_init() expects parameter 3 to be string, array given in %s on line %d
46int(-1)
47int(-1)
48array(1) {
49  [0]=>
50  string(2) "-1"
51}
52Done
53