php-src/Zend/tests/006.phpt
Nikita Popov 513b76794b Make zpp failures always throw, independent of strict_types
Previously zend_parse_parameters (and FastZPP) would handle invalid
arguments depending on strict_types: With strict_types=1, a TypeError
is thrown, with strict_types=0 a warning is thrown and (usually) NULL
is returned. Additionally, some functions (constructors always and
other methods sometimes) opt-it to throwing regardless of strict_types.

This commit changes zpp to always generate a TypeError exception in
PHP 8.
2019-03-11 11:32:20 +01:00

28 lines
549 B
PHP

--TEST--
strncasecmp() tests
--FILE--
<?php
var_dump(strncasecmp("", "", -1));
var_dump(strncasecmp("aef", "dfsgbdf", 0));
var_dump(strncasecmp("aef", "dfsgbdf", 10));
var_dump(strncasecmp("qwe", "qwer", 3));
var_dump(strncasecmp("qwerty", "QweRty", 6));
var_dump(strncasecmp("qwErtY", "qwer", 7));
var_dump(strncasecmp("q123", "Q123", 3));
var_dump(strncasecmp("01", "01", 1000));
echo "Done\n";
?>
--EXPECTF--
Warning: Length must be greater than or equal to 0 in %s on line %d
bool(false)
int(0)
int(-3)
int(0)
int(0)
int(2)
int(0)
int(0)
Done