mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
513b76794b
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.
28 lines
549 B
PHP
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
|