summaryrefslogtreecommitdiff
path: root/ext/pcre
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-01 13:20:42 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-02 10:34:08 +0200
commit2f92957fd3d8d87e73013c016e479451db0c6a1e (patch)
treeca7d2d34038d7e1fb0e511962ad0db5e57390c63 /ext/pcre
parent2041c9abf5fdaa9d0e632e5e6e4f3488159c9bfe (diff)
downloadphp-git-2f92957fd3d8d87e73013c016e479451db0c6a1e.tar.gz
Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
Diffstat (limited to 'ext/pcre')
-rw-r--r--ext/pcre/tests/bug44925.phpt4
-rw-r--r--ext/pcre/tests/preg_grep_error1.phpt3
-rw-r--r--ext/pcre/tests/preg_match_all_error1.phpt3
-rw-r--r--ext/pcre/tests/preg_match_all_error2.phpt3
-rw-r--r--ext/pcre/tests/preg_match_error1.phpt3
-rw-r--r--ext/pcre/tests/preg_match_error2.phpt3
-rw-r--r--ext/pcre/tests/preg_replace_callback2.phpt2
-rw-r--r--ext/pcre/tests/preg_replace_callback_error1.phpt9
-rw-r--r--ext/pcre/tests/preg_replace_error1.phpt3
-rw-r--r--ext/pcre/tests/preg_replace_error2.phpt3
-rw-r--r--ext/pcre/tests/preg_split_error1.phpt3
11 files changed, 15 insertions, 24 deletions
diff --git a/ext/pcre/tests/bug44925.phpt b/ext/pcre/tests/bug44925.phpt
index f6e0db4253..c495331b4b 100644
--- a/ext/pcre/tests/bug44925.phpt
+++ b/ext/pcre/tests/bug44925.phpt
@@ -45,11 +45,11 @@ array(9) {
&string(1) "b"
}
-Notice: Array to string conversion in %sbug44925.php on line 9
+Warning: Array to string conversion in %s on line %d
array(0) {
}
-Notice: Array to string conversion in %sbug44925.php on line 11
+Warning: Array to string conversion in %s on line %d
array(7) {
[0]=>
string(1) "1"
diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt
index 79fcb98897..1bf23bb640 100644
--- a/ext/pcre/tests/preg_grep_error1.phpt
+++ b/ext/pcre/tests/preg_grep_error1.phpt
@@ -6,7 +6,6 @@ Test preg_grep() function : error conditions - bad regular expressions
* proto array preg_grep(string regex, array input [, int flags])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_grep reacts to being passed bad regexes
*/
@@ -19,7 +18,7 @@ $values = array('abcdef', //Regex without delimiter
);
$array = array(123, 'abc', 'test');
foreach($values as $value) {
- print "\nArg value is $value\n";
+ @print "\nArg value is $value\n";
try {
var_dump(preg_grep($value, $array));
} catch (TypeError $e) {
diff --git a/ext/pcre/tests/preg_match_all_error1.phpt b/ext/pcre/tests/preg_match_all_error1.phpt
index bd0f28c8c4..6a5a0055a9 100644
--- a/ext/pcre/tests/preg_match_all_error1.phpt
+++ b/ext/pcre/tests/preg_match_all_error1.phpt
@@ -6,7 +6,6 @@ Test preg_match_all() function : error conditions - bad regular expressions
* proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_match_all reacts to being passed the wrong type of regex argument
*/
@@ -19,7 +18,7 @@ $regex_array = array('abcdef', //Regex without delimiter
);
$subject = 'test';
foreach($regex_array as $regex_value) {
- print "\nArg value is $regex_value\n";
+ @print "\nArg value is $regex_value\n";
try {
var_dump(preg_match_all($regex_value, $subject, $matches1));
} catch (TypeError $e) {
diff --git a/ext/pcre/tests/preg_match_all_error2.phpt b/ext/pcre/tests/preg_match_all_error2.phpt
index 8c52b73076..29762739c4 100644
--- a/ext/pcre/tests/preg_match_all_error2.phpt
+++ b/ext/pcre/tests/preg_match_all_error2.phpt
@@ -6,7 +6,6 @@ Test preg_match_all() function : error conditions - wrong arg types
* proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_match_all reacts to being passed the wrong type of input argument
*/
@@ -14,7 +13,7 @@ echo "*** Testing preg_match_all() : error conditions ***\n";
$regex = '/[a-zA-Z]/';
$input = array(array('this is', 'a subarray'), 'test',);
foreach($input as $value) {
- print "\nArg value is: $value\n";
+ @print "\nArg value is: $value\n";
try {
var_dump(preg_match_all($regex, $value, $matches));
} catch (TypeError $e) {
diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt
index 23d6829c48..2f1b39d67f 100644
--- a/ext/pcre/tests/preg_match_error1.phpt
+++ b/ext/pcre/tests/preg_match_error1.phpt
@@ -6,7 +6,6 @@ Test preg_match() function : error conditions - bad regular expressions
* proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_match reacts to being passed the wrong type of regex argument
*/
@@ -19,7 +18,7 @@ $regex_array = array('abcdef', //Regex without delimiter
);
$subject = 'this is a test';
foreach($regex_array as $regex_value) {
- print "\nArg value is $regex_value\n";
+ @print "\nArg value is $regex_value\n";
try {
var_dump(preg_match($regex_value, $subject));
} catch (TypeError $e) {
diff --git a/ext/pcre/tests/preg_match_error2.phpt b/ext/pcre/tests/preg_match_error2.phpt
index 9530983e81..18a42c6445 100644
--- a/ext/pcre/tests/preg_match_error2.phpt
+++ b/ext/pcre/tests/preg_match_error2.phpt
@@ -6,7 +6,6 @@ Test preg_match() function : error conditions - wrong arg types
* proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_match reacts to being passed the wrong type of subject argument
*/
@@ -14,7 +13,7 @@ echo "*** Testing preg_match() : error conditions ***\n";
$regex = '/[a-zA-Z]/';
$input = array('this is a string', array('this is', 'a subarray'),);
foreach($input as $value) {
- print "\nArg value is: $value\n";
+ @print "\nArg value is: $value\n";
try {
var_dump(preg_match($regex, $value));
} catch (TypeError $e) {
diff --git a/ext/pcre/tests/preg_replace_callback2.phpt b/ext/pcre/tests/preg_replace_callback2.phpt
index 1fe78d59ee..6dab1a0cf2 100644
--- a/ext/pcre/tests/preg_replace_callback2.phpt
+++ b/ext/pcre/tests/preg_replace_callback2.phpt
@@ -31,7 +31,7 @@ array(3) {
string(9) "'aa' 'bb'"
}
-Notice: Array to string conversion in %spreg_replace_callback2.php on line 17
+Warning: Array to string conversion in %s on line %d
array(1) {
[0]=>
string(7) "'A'rray"
diff --git a/ext/pcre/tests/preg_replace_callback_error1.phpt b/ext/pcre/tests/preg_replace_callback_error1.phpt
index 313064eab8..cf069692e8 100644
--- a/ext/pcre/tests/preg_replace_callback_error1.phpt
+++ b/ext/pcre/tests/preg_replace_callback_error1.phpt
@@ -6,7 +6,6 @@ Test preg_replace_callback() function : error
* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_replace_callback reacts to being passed the wrong type of regex argument
*/
@@ -15,7 +14,7 @@ $regex_array = array('abcdef', //Regex without delimiters
'/[a-zA-Z]', //Regex without closing delimiter
'[a-zA-Z]/', //Regex without opening delimiter
'/[a-zA-Z]/F', array('[a-z]', //Array of Regexes
-'[A-Z]', '[0-9]'), '/[a-zA-Z]/'); //Regex string
+'[A-Z]', '[0-9]'), '/[0-9]/'); //Regex string
$replacement = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
function integer_word($matches) {
global $replacement;
@@ -23,7 +22,7 @@ function integer_word($matches) {
}
$subject = 'number 1.';
foreach($regex_array as $regex_value) {
- print "\nArg value is $regex_value\n";
+ @print "\nArg value is $regex_value\n";
var_dump(preg_replace_callback($regex_value, 'integer_word', $subject));
}
?>
@@ -54,6 +53,6 @@ NULL
Arg value is Array
string(9) "number 1."
-Arg value is /[a-zA-Z]/
-string(3) " 1."
+Arg value is /[0-9]/
+string(11) "number one."
===Done===
diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt
index 780556956a..669a5c6c4e 100644
--- a/ext/pcre/tests/preg_replace_error1.phpt
+++ b/ext/pcre/tests/preg_replace_error1.phpt
@@ -6,7 +6,6 @@ Test preg_replace() function : error - bad regular expressions
* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_replace reacts to being passed the wrong type of regex argument
*/
@@ -20,7 +19,7 @@ $regex_array = array('abcdef', //Regex without delimiter
$replace = 1;
$subject = 'a';
foreach($regex_array as $regex_value) {
- print "\nArg value is $regex_value\n";
+ @print "\nArg value is $regex_value\n";
var_dump(preg_replace($regex_value, $replace, $subject));
}
$regex_value = new stdclass(); //Object
diff --git a/ext/pcre/tests/preg_replace_error2.phpt b/ext/pcre/tests/preg_replace_error2.phpt
index 0a3ba3bb46..eeff2fae54 100644
--- a/ext/pcre/tests/preg_replace_error2.phpt
+++ b/ext/pcre/tests/preg_replace_error2.phpt
@@ -6,7 +6,6 @@ Test preg_replace() function : error conditions - wrong arg types
* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_replace reacts to being passed the wrong type of replacement argument
*/
@@ -15,7 +14,7 @@ $regex = '/[a-zA-Z]/';
$replace = array('this is a string', array('this is', 'a subarray'),);
$subject = 'test';
foreach($replace as $value) {
- print "\nArg value is: $value\n";
+ @print "\nArg value is: $value\n";
try {
var_dump(preg_replace($regex, $value, $subject));
} catch (TypeError $e) {
diff --git a/ext/pcre/tests/preg_split_error1.phpt b/ext/pcre/tests/preg_split_error1.phpt
index 1c1e3ec646..b69caf1aed 100644
--- a/ext/pcre/tests/preg_split_error1.phpt
+++ b/ext/pcre/tests/preg_split_error1.phpt
@@ -6,7 +6,6 @@ Test preg_split() function : error conditions - bad regular expressions
* proto array preg_split(string pattern, string subject [, int limit [, int flags]])
* Function is implemented in ext/pcre/php_pcre.c
*/
-error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_split reacts to being passed the wrong type of regex argument
*/
@@ -19,7 +18,7 @@ $regex_array = array('abcdef', //Regex without delimiter
);
$subject = '1 2 a 3 4 b 5 6';
foreach($regex_array as $regex_value) {
- print "\nArg value is $regex_value\n";
+ @print "\nArg value is $regex_value\n";
try {
var_dump(preg_split($regex_value, $subject));
} catch (TypeError $e) {