Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Zend/tests/017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ string(5) "array"
int(%d)
string(5) "array"
int(%d)

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
bool(false)
string(5) "array"
int(%d)
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/type_declarations/scalar_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ string(%d) "%d"
string(3) "NAN"

*** Trying bool(true)
E_DEPRECATED: Implicit bool to string coercion is deprecated on line 16
string(1) "1"

*** Trying bool(false)
E_DEPRECATED: Implicit bool to string coercion is deprecated on line 16
string(0) ""

*** Trying NULL
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/type_declarations/scalar_return_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ string(10) "2147483647"
*** Trying float(NAN)
string(3) "NAN"
*** Trying bool(true)
E_DEPRECATED: Implicit bool to string coercion is deprecated on line %d
string(1) "1"
*** Trying bool(false)
E_DEPRECATED: Implicit bool to string coercion is deprecated on line %d
string(0) ""
*** Trying NULL
*** Caught {closure}(): Return value must be of type string, null returned in %s on line %d
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ string(19) "9223372036854775807"
*** Trying float(NAN)
string(3) "NAN"
*** Trying bool(true)
E_DEPRECATED: Implicit bool to string coercion is deprecated on line 16
string(1) "1"
*** Trying bool(false)
E_DEPRECATED: Implicit bool to string coercion is deprecated on line 16
string(0) ""
*** Trying NULL
*** Caught {closure}(): Return value must be of type string, null returned in %s on line %d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ INF => "INF"
"42x" => "42x"
"x" => "x"
"" => ""
true => "1"
false => ""
true => "1" (Implicit bool to string coercion is deprecated)
false => "" (Implicit bool to string coercion is deprecated)
null => Argument ... must be of type array|string, null given
[] => []
new stdClass => Argument ... must be of type array|string, stdClass given
Expand Down
3 changes: 3 additions & 0 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **des
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("string", arg_num)) {
return 0;
}
if (UNEXPECTED(Z_TYPE_P(arg) == IS_TRUE || Z_TYPE_P(arg) == IS_FALSE)) {
zend_error(E_DEPRECATED, "Implicit bool to string coercion is deprecated");
}
convert_to_string(arg);
*dest = Z_STR_P(arg);
} else if (UNEXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
Expand Down
7 changes: 7 additions & 0 deletions appveyor/test_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,11 @@ set EXIT_CODE=%errorlevel%

appveyor PushArtifact %TEST_PHP_JUNIT%

if %EXIT_CODE% GEQ 1 (
git checkout .
nmake run ARGS="scripts\dev\bless_tests.php ."
git diff > bless_tests.patch
appveyor PushArtifact bless_tests.patch
)

exit /b %EXIT_CODE%
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ gettext

echo "Done\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Implicit bool to string coercion is deprecated in %s on line %d

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
bool(false)
string(5) "UTF-8"
Done
--CREDITS--
Florian Holzhauer fh-pt@fholzhauer.de
PHP Testfest Berlin 2009-05-09
4 changes: 4 additions & 0 deletions ext/iconv/tests/bug48147.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ bool(false)
string(10) "aa%C3%B8aa"

Notice: iconv(): Detected an incomplete multibyte character in input string in %s on line %d

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(0) ""
string(8) "%C3%B8aa"

Notice: iconv(): Detected an incomplete multibyte character in input string in %s on line %d

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(0) ""
2 changes: 2 additions & 0 deletions ext/iconv/tests/iconv_mime_decode.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ do_regression_test();
(32) "Subject: Prüfung PrüfungkůÔńÓlet"
(31) "Subject: PrüfungPrüfungkůÔńÓlet"
2: iconv_mime_decode(): Malformed string
8192: Implicit bool to string coercion is deprecated
(0) ""
(27) "From: サンプル文字列サンプル文字列日本語テキスト"
(31) "Subject: PrüfungPrüfungkůÔńÓlet"
(32) "Subject: Prüfung PrüfungkůÔńÓlet"
(100) "Subject: =?ISO-8859-1?Q?Pr=FCfung?==?ISO-8859-1*de_DE?Q?Pr=FCfung?==?ISO-8859-2?Q?k=F9=D4=F1=D3let?="
2: iconv_mime_decode(): Malformed string
8192: Implicit bool to string coercion is deprecated
(0) ""
(27) "From: サンプル文字列サンプル文字列日本語テキスト"
(31) "Subject: PrüfungPrüfungkůÔńÓlet"
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/tests/iconv_stream_filter.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fclose($fp);
$fp = fopen(__DIR__.'/iconv_stream_filter.txt', 'rb');
stream_filter_append($fp, 'string.rot13'); // this will make conversion fail.
stream_filter_append($fp, 'convert.iconv.ISO-2022-JP/EUC-JP');
var_dump(bin2hex(@fread($fp, 10)) != "a4b3a4f3a4cba4c1a4cf");
var_dump(bin2hex((string) @fread($fp, 10)) != "a4b3a4f3a4cba4c1a4cf");
var_dump(bin2hex(fread($fp, 5)) != "69636f6e76");
var_dump(bin2hex(fread($fp, 1)) != "0a");
fclose($fp);
Expand Down
9 changes: 8 additions & 1 deletion ext/intl/tests/locale_bug66289.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@ $availableLocales = array(Locale::getDefault());
var_dump(locale_lookup($availableLocales, false, true));

?>
--EXPECT--
--EXPECTF--
Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(5) "fr_fr"

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(5) "en_us"

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(5) "fr_fr"

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(5) "de_de"
2 changes: 1 addition & 1 deletion ext/intl/tests/locale_get_display_name5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function ut_main()
$res_str .= "locale='$locale'\n";
foreach( $disp_locales as $disp_locale )
{
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
$scr = (string) ut_loc_get_display_name( $locale ,$disp_locale );
$scr = str_replace(array('(', ')'), '#', $scr);
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
$res_str .= "\n";
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/tests/locale_get_display_name7.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function ut_main()
$res_str .= "locale='$locale'\n";
foreach( $disp_locales as $disp_locale )
{
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
$scr = str_replace(array('(', ')'), '#', $scr);
$scr = (string) ut_loc_get_display_name($locale, $disp_locale);
$scr = str_replace(array('(', ')'), '#', $scr);
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
$res_str .= "\n";
}
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/tests/locale_get_display_name8.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function ut_main()
$res_str .= "locale='$locale'\n";
foreach( $disp_locales as $disp_locale )
{
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
$scr = (string) ut_loc_get_display_name( $locale ,$disp_locale );
$scr = str_replace(array('(', ')'), '#', $scr);
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
$res_str .= "\n";
Expand Down
5 changes: 4 additions & 1 deletion ext/json/tests/bug69187.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ var_dump(json_last_error());
json_decode("\"\x00\"");
var_dump(json_last_error());
?>
--EXPECT--
--EXPECTF--
Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
NULL
int(4)
NULL
Expand All @@ -35,6 +36,8 @@ int(0)
int(0)
int(1)
int(0)

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
int(1)
int(0)
int(5)
Expand Down
10 changes: 9 additions & 1 deletion ext/mbstring/tests/bug43994.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,26 @@ foreach($inputs as $input) {
$iterator++;
};
?>
--EXPECT--
--EXPECTF--
-- Iteration 1 --
Without $regs arg:

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_ereg(): Argument #1 ($pattern) must not be empty
With $regs arg:

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_ereg(): Argument #1 ($pattern) must not be empty
NULL

-- Iteration 2 --
Without $regs arg:

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_ereg(): Argument #1 ($pattern) must not be empty
With $regs arg:

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_ereg(): Argument #1 ($pattern) must not be empty
NULL

Expand Down
10 changes: 9 additions & 1 deletion ext/mbstring/tests/bug43998.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ foreach($inputs as $input) {
}

?>
--EXPECT--
--EXPECTF--
-- Iteration 1 --
mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "12345" given
mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "12345" given
Expand All @@ -39,11 +39,19 @@ mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "1.23456789E-
mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "1.23456789E-9" given

-- Iteration 3 --

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "1" given

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "1" given

-- Iteration 4 --

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "" given

-- Iteration 5 --
Expand Down
10 changes: 9 additions & 1 deletion ext/mbstring/tests/mb_ereg_replace_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ foreach($inputs as $input) {

echo "Done";
?>
--EXPECT--
--EXPECTF--
*** Testing mb_ereg_replace() : usage variations ***

-- Iteration 1 --
Expand Down Expand Up @@ -108,15 +108,23 @@ string(10) "string_val"
string(10) "string_val"

-- Iteration 10 --

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(10) "string_val"

-- Iteration 11 --

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val"

-- Iteration 12 --

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(10) "string_val"

-- Iteration 13 --

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(120) "string_valsstring_valtstring_valrstring_valistring_valnstring_valgstring_val_string_valvstring_valastring_vallstring_val"

-- Iteration 14 --
Expand Down
2 changes: 2 additions & 0 deletions ext/mbstring/tests/mbregex_stack_limit2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ echo 'OK';
?>
--EXPECTF--
Warning: mb_ereg_replace(): mbregex search failure in php_mbereg_replace_exec(): match-stack limit over in %s on line %d

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
string(0) ""
OK
2 changes: 2 additions & 0 deletions ext/mysqli/tests/mysqli_debug_mysqlnd_control_string.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,6 @@ if (!$IS_MYSQLND)
?>
--EXPECTF--
[083][control string 'n:O,%smysqli_debug_phpt.trace'] Trace file has not been written.

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
done%s
5 changes: 4 additions & 1 deletion ext/mysqli/tests/mysqli_prepare_no_object.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ require_once('skipifconnectfailure.inc');
<?php
require_once("clean_table.inc");
?>
--EXPECT--
--EXPECTF--
Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
a) [1065] Query was empty
b) [1065] Query was empty

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
c) [1065] Query was empty
c) [1065] Query was empty
done!
4 changes: 3 additions & 1 deletion ext/openssl/tests/bug38261.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ try {
}

?>
--EXPECT--
--EXPECTF--
bool(false)
bool(false)
openssl_x509_parse(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given

Deprecated: Implicit bool to string coercion is deprecated in %s on line %d
bool(false)
openssl_x509_parse(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, stdClass given
3 changes: 2 additions & 1 deletion ext/pdo/tests/bug_38394.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pdo
<?php
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'sqlite2', strlen('sqlite2'))) die('skip not relevant for pdo_sqlite2 driver');
$dsn = (string) getenv('PDOTEST_DSN');
if (!strncasecmp($dsn, 'sqlite2', strlen('sqlite2'))) die('skip not relevant for pdo_sqlite2 driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
Expand Down
11 changes: 6 additions & 5 deletions ext/pdo/tests/bug_43130.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ pdo
<?php
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'sqlite', strlen('sqlite'))) die('skip not relevant for sqlite driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'pgsql', strlen('pgsql'))) die('skip not relevant for pgsql driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip not relevant for oci driver - Hyphen is not legal for bind names in Oracle DB');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'firebird', strlen('firebird'))) die('skip not relevant for firebird driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'odbc', strlen('odbc'))) die('skip not relevant for odbc driver');
$dsn = (string) getenv('PDOTEST_DSN');
if (!strncasecmp($dsn, 'sqlite', strlen('sqlite'))) die('skip not relevant for sqlite driver');
if (!strncasecmp($dsn, 'pgsql', strlen('pgsql'))) die('skip not relevant for pgsql driver');
if (!strncasecmp($dsn, 'oci', strlen('oci'))) die('skip not relevant for oci driver - Hyphen is not legal for bind names in Oracle DB');
if (!strncasecmp($dsn, 'firebird', strlen('firebird'))) die('skip not relevant for firebird driver');
if (!strncasecmp($dsn, 'odbc', strlen('odbc'))) die('skip not relevant for odbc driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
Expand Down
3 changes: 2 additions & 1 deletion ext/pdo/tests/bug_44861.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ if (false == $dir) die('skip no driver');
$allowed = array('oci', 'pgsql');
$ok = false;
foreach ($allowed as $driver) {
if (!strncasecmp(getenv('PDOTEST_DSN'), $driver, strlen($driver))) {
$dsn = (string) getenv('PDOTEST_DSN');
if (!strncasecmp($dsn, $driver, strlen($driver))) {
$ok = true;
}
}
Expand Down
3 changes: 2 additions & 1 deletion ext/pdo/tests/bug_69356.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pdo
<?php
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip query not supported');
$dsn = (string) getenv('PDOTEST_DSN');
if (!strncasecmp($dsn, 'oci', strlen('oci'))) die('skip query not supported');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
Expand Down
7 changes: 4 additions & 3 deletions ext/pdo/tests/bug_71885.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ pdo
<?php
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'pgsql', strlen('pgsql'))) die('skip not relevant for pgsql driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip not relevant for OCI driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'odbc', strlen('odbc'))) die('skip inconsistent error message with odbc');
$dsn = (string) getenv('PDOTEST_DSN');
if (!strncasecmp($dsn, 'pgsql', strlen('pgsql'))) die('skip not relevant for pgsql driver');
if (!strncasecmp($dsn, 'oci', strlen('oci'))) die('skip not relevant for OCI driver');
if (!strncasecmp($dsn, 'odbc', strlen('odbc'))) die('skip inconsistent error message with odbc');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
Expand Down
3 changes: 2 additions & 1 deletion ext/pdo/tests/pdo_016.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ pdo
<?php
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))) die('skip not relevant for oci driver - cannot reexecute after closing cursors without reparse');
$dsn = (string) getenv('PDOTEST_DSN');
if (!strncasecmp($dsn, 'oci', strlen('oci'))) die('skip not relevant for oci driver - cannot reexecute after closing cursors without reparse');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
Expand Down
Loading