diff --git a/.travis.yml b/.travis.yml index dc2affa8996e3..34d2f2b74a271 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,7 @@ jobs: arch: amd64 - env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1 arch: arm64 + if: type = cron - env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 S390X=1 arch: s390x if: type = cron diff --git a/NEWS b/NEWS index c4926322db961..b5f816a055e57 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,30 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.0.0RC1 +?? ??? ????, PHP 8.0.0rc2 + + +01 Oct 2020, PHP 8.0.0rc1 - CLI: . Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara) + - Core: . Fixed bug #80109 (Cannot skip arguments when extended debug is enabled). (Nikita) +- ODBC: + . Fixed bug #22986 (odbc_connect() may reuse persistent connection). (cmb) + +- PDO_Firebird: + . Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis) + +- SPL: + . SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad) + +- Zlib: + . Fixed bug #78792 (zlib.output_compression disabled by Content-Type: image/). + (cmb) + 17 Sep 2020, PHP 8.0.0beta4 - Core: diff --git a/UPGRADING b/UPGRADING index 58a29ec81ccc1..05c8eef1e9ec9 100644 --- a/UPGRADING +++ b/UPGRADING @@ -254,6 +254,8 @@ PHP 8.0 UPGRADE NOTES __wakeup(): void RFC: https://wiki.php.net/rfc/magic-methods-signature + . call_user_func_array() array keys will now be interpreted as parameter names, + instead of being silently ignored. - COM: . Removed the ability to import case-insensitive constants from type @@ -325,6 +327,10 @@ PHP 8.0 UPGRADE NOTES . iconv() implementations which do not properly set errno in case of errors are no longer supported. +- IMAP: + . The unused default_host argument of imap_headerinfo() has been removed. + . The imap_header() function which is an alias of imap_headerinfo() has been removed. + - Intl: . The deprecated constant INTL_IDNA_VARIANT_2003 has been removed. RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003 @@ -335,6 +341,8 @@ PHP 8.0 UPGRADE NOTES - LDAP: . The deprecated function ldap_sort has been removed. + . The deprecated function ldap_control_paged_result has been removed. + . The deprecated function ldap_control_paged_result_response has been removed. . The interface of ldap_set_rebind_proc has changed; the $callback parameter does not accept empty string anymore; null value shall be used instead. @@ -387,6 +395,10 @@ PHP 8.0 UPGRADE NOTES . Several alias functions have been marked as deprecated. . oci_internal_debug() and its alias ociinternaldebug() have been removed. +- ODBC: + . odbc_connect() no longer reuses persistent connections. + . The unused flags parameter of odbc_exec() has been removed. + - OpenSSL: . openssl_x509_read() and openssl_csr_sign() will now return an OpenSSLCertificate object rather than a resource. Return value checks using @@ -431,6 +443,8 @@ PHP 8.0 UPGRADE NOTES . The deprecated pg_lo_import() and pg_lo_export() signature that passes the connection as the last argument is no longer supported. The connection should be passed as first argument instead. + . pg_fetch_all() will now return an empty array instead of false for result + sets with zero rows. - Phar: . Metadata associated with a phar will no longer be automatically unserialized, @@ -496,6 +510,12 @@ PHP 8.0 UPGRADE NOTES . spl_autoload_register() will now always throw a TypeError on invalid arguments, therefore the second argument $do_throw is ignored and a notice will be emitted if it is set to false. + . SplFixedArray is now an IteratorAggregate and not an Iterator. + SplFixedArray::rewind(), ::current(), ::key(), ::next(), and ::valid() + have been removed. In their place, SplFixedArray::getIterator() has been + added. Any code which uses explicit iteration over SplFixedArray must now + obtain an Iterator through SplFixedArray::getIterator(). This means that + SplFixedArray is now safe to use in nested loops. - Standard: . assert() will no longer evaluate string arguments, instead they will be @@ -644,6 +664,8 @@ PHP 8.0 UPGRADE NOTES . deflate_init() will now return a DeflateContext object rather than a resource. Return value checks using is_resource() should be replaced with checks for `false`. + . zlib.output_compression is no longer automatically disabled for + Content-Type: image/*. ======================================== 2. New Features @@ -792,7 +814,7 @@ PHP 8.0 UPGRADE NOTES values rather than int. - Zip: - . Extension updated to version 1.19.0 + . Extension updated to version 1.19.1 . New ZipArchive::lastId property to get index value of last added entry. . Error can be checked after an archive is closed using ZipArchive::status, ZipArchive::statusSys properties or ZipArchive::getStatusString() method. @@ -844,6 +866,7 @@ PHP 8.0 UPGRADE NOTES - PGSQL / PDO PGSQL: . The constant PG_VERSION_STR has now the same value as PG_VERSION, and thus is deprecated. + . Function aliases in the pgsql extension have been deprecated. - Zip: . Using empty file as ZipArchive is deprecated. Libzip 1.6.0 diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index ebced18ff3279..c15cbef3b118c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -373,6 +373,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES - zend_get_op_array_extension_handle() 10. Argument zend_extension to const char* in Zend Engine 4.0: - zend_get_resource_handle() + 11. Argument const char * to HMODULE in Zend Engine 4.0: + - php_win32_image_compatible() + 12. const char * argument dropped in Zend Engine 4.0: + - php_win32_crt_compatible() u. Instead of overwriting zend_error_cb extensions with debugging, monitoring use-cases catching Errors/Exceptions are strongly encouraged to use @@ -436,6 +440,14 @@ PHP 8.0 INTERNALS UPGRADE NOTES 2. The PHP_CHECK_GCC_ARG() m4 macro has been removed in favor of AX_CHECK_COMPILE_FLAG(). + 3. The 6th argument of PHP_ADD_SOURCES_X has been removed. + + 4. The 'special-flags' (3rd) argument of PHP_ADD_SOURCES_X are + now appended instead of prepended to previous compiler flags. + This means compiler flags passed to PHP_NEW_EXTENSION and PHP_ADD_SOURCES + are now appended, this allows to disable compiler flags set by Zend/Zend.m4 + (e.g. disable certain compiler flags enabled by -Wextra) + c. Windows build system changes - The configuration option --enable-crt-debug has been removed. The VC diff --git a/Zend/tests/008.phpt b/Zend/tests/008.phpt index aa2dbb8d33a17..1057c82b95242 100644 --- a/Zend/tests/008.phpt +++ b/Zend/tests/008.phpt @@ -32,13 +32,13 @@ echo "Done\n"; --EXPECTF-- TypeError: define(): Argument #1 ($constant_name) must be of type string, array given -Notice: Constant TRUE already defined in %s on line %d +Warning: Constant TRUE already defined in %s on line %d bool(false) bool(true) bool(true) bool(true) -Notice: Constant test const already defined in %s on line %d +Warning: Constant test const already defined in %s on line %d bool(false) bool(true) bool(true) diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt index 16c060389d34e..ddf38e96f4e8c 100644 --- a/Zend/tests/009.phpt +++ b/Zend/tests/009.phpt @@ -26,7 +26,11 @@ $f2 = new foo2; $f1->bar(); $f2->bar(); -var_dump(get_class()); +try { + var_dump(get_class()); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} try { var_dump(get_class("qwerty")); } catch (TypeError $e) { @@ -40,12 +44,10 @@ $f1->testNull(); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(3) "foo" string(3) "foo" - -Warning: get_class() called without object from outside a class in %s on line %d -bool(false) +get_class() without arguments must be called from within a class get_class(): Argument #1 ($object) must be of type object, string given string(3) "foo" string(4) "foo2" diff --git a/Zend/tests/015.phpt b/Zend/tests/015.phpt index 8c4dd62d397a3..d492590bcd920 100644 --- a/Zend/tests/015.phpt +++ b/Zend/tests/015.phpt @@ -23,8 +23,8 @@ var_dump(trigger_error("error", E_USER_DEPRECATED)); --EXPECTF-- Notice: error in %s on line %d bool(true) -trigger_error(): Argument #2 ($error_type) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED -trigger_error(): Argument #2 ($error_type) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED +trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED +trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED Warning: error in %s on line %d bool(true) diff --git a/Zend/tests/ErrorException_construct.phpt b/Zend/tests/ErrorException_construct.phpt new file mode 100644 index 0000000000000..7304af3da05d5 --- /dev/null +++ b/Zend/tests/ErrorException_construct.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test default value handling of ErrorException::__construct() +--FILE-- +getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +$e = new ErrorException("Second", 0, E_ERROR, null); +var_dump($e->getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +$e = new ErrorException("Third", 0, E_ERROR, null, null); +var_dump($e->getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +$e = new ErrorException("Forth", 0, E_ERROR, null, 123); +var_dump($e->getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +$e = new ErrorException("Fifth", 0, E_ERROR, "abc.php"); +var_dump($e->getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +$e = new ErrorException("Sixth", 0, E_ERROR, "abc.php", null); +var_dump($e->getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +$e = new ErrorException("Seventh", 0, E_ERROR, "abc.php", 123); +var_dump($e->getMessage()); +var_dump($e->getFile()); +var_dump($e->getLine()); + +?> +--EXPECTF-- +string(0) "" +string(%d) "%sErrorException_construct.php" +int(3) +string(6) "Second" +string(%d) "%sErrorException_construct.php" +int(8) +string(5) "Third" +string(%d) "%sErrorException_construct.php" +int(13) +string(5) "Forth" +string(%d) "%sErrorException_construct.php" +int(123) +string(5) "Fifth" +string(7) "abc.php" +int(0) +string(5) "Sixth" +string(7) "abc.php" +int(0) +string(7) "Seventh" +string(7) "abc.php" +int(123) diff --git a/Zend/tests/attributes/004_name_resolution.phpt b/Zend/tests/attributes/004_name_resolution.phpt index 6f266908b5c08..aececca0d46c2 100644 --- a/Zend/tests/attributes/004_name_resolution.phpt +++ b/Zend/tests/attributes/004_name_resolution.phpt @@ -2,12 +2,15 @@ Resolve attribute names --FILE-- $attribute->getName(), 'args' => $attribute->getArguments()]; + +namespace { + function dump_attributes($attributes) { + $arr = []; + foreach ($attributes as $attribute) { + $arr[] = ['name' => $attribute->getName(), 'args' => $attribute->getArguments()]; + } + var_dump($arr); } - var_dump($arr); } namespace Doctrine\ORM\Mapping { diff --git a/Zend/tests/attributes/005_objects.phpt b/Zend/tests/attributes/005_objects.phpt index 62b14181efd2e..db0107500c8ca 100644 --- a/Zend/tests/attributes/005_objects.phpt +++ b/Zend/tests/attributes/005_objects.phpt @@ -96,16 +96,16 @@ try { } ?> ---EXPECT-- +--EXPECTF-- string(2) "A1" string(4) "test" int(50) string(7) "ERROR 1" -string(81) "Too few arguments to function A1::__construct(), 0 passed and at least 1 expected" +string(%d) "Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected" string(7) "ERROR 2" -string(74) "A1::__construct(): Argument #1 ($name) must be of type string, array given" +string(%d) "A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36" string(7) "ERROR 3" string(30) "Attribute class "A2" not found" diff --git a/Zend/tests/attributes/014_class_const_group.phpt b/Zend/tests/attributes/014_class_const_group.phpt index 9f01d013a7de1..726483a2dcffe 100644 --- a/Zend/tests/attributes/014_class_const_group.phpt +++ b/Zend/tests/attributes/014_class_const_group.phpt @@ -1,14 +1,36 @@ --TEST-- -Attributes cannot be applied to groups of class constants. +Attributes can be applied to groups of class constants --FILE-- getAttributes()[0]; +var_dump($ra1->getName(), $ra1->getArguments()); +$rp2 = new ReflectionClassConstant('C', 'B'); +$ra2 = $rp2->getAttributes()[0]; +var_dump($ra2->getName(), $ra2->getArguments()); + ?> ---EXPECTF-- -Fatal error: Cannot apply attributes to a group of constants in %s +--EXPECT-- +string(1) "A" +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} +string(1) "A" +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} diff --git a/Zend/tests/attributes/015_property_group.phpt b/Zend/tests/attributes/015_property_group.phpt index b84ded8c38d6d..a448cb80d63cd 100644 --- a/Zend/tests/attributes/015_property_group.phpt +++ b/Zend/tests/attributes/015_property_group.phpt @@ -1,14 +1,36 @@ --TEST-- -Attributes cannot be applied to groups of properties. +Attributes can be applied to groups of properties --FILE-- getAttributes()[0]; +var_dump($ra1->getName(), $ra1->getArguments()); +$rp2 = new ReflectionProperty('C', 'y'); +$ra2 = $rp2->getAttributes()[0]; +var_dump($ra2->getName(), $ra2->getArguments()); + ?> ---EXPECTF-- -Fatal error: Cannot apply attributes to a group of properties in %s +--EXPECT-- +string(1) "A" +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} +string(1) "A" +array(2) { + [0]=> + int(1) + [1]=> + int(2) +} diff --git a/Zend/tests/attributes/029_reflect_internal_symbols.phpt b/Zend/tests/attributes/029_reflect_internal_symbols.phpt new file mode 100644 index 0000000000000..d4dc29a0bb997 --- /dev/null +++ b/Zend/tests/attributes/029_reflect_internal_symbols.phpt @@ -0,0 +1,32 @@ +--TEST-- +Reflect attributes on different kinds of internal symbols +--FILE-- +getAttributes()); + +$rc = new ReflectionClass('DateTime'); +var_dump($rc->getAttributes()); + +$rm = $rc->getMethod('__construct'); +var_dump($rm->getAttributes()); + +$rcc = $rc->getReflectionConstant('ATOM'); +var_dump($rcc->getAttributes()); + +$rp = new ReflectionProperty('Exception', 'message'); +var_dump($rp->getAttributes()); + +?> +--EXPECT-- +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} +array(0) { +} diff --git a/Zend/tests/attributes/030_strict_types.inc b/Zend/tests/attributes/030_strict_types.inc new file mode 100644 index 0000000000000..d9494e4fce9fc --- /dev/null +++ b/Zend/tests/attributes/030_strict_types.inc @@ -0,0 +1,5 @@ +getAttributes()[0]->newInstance()); +var_dump((new ReflectionClass(TestStrict::class))->getAttributes()[0]->newInstance()); + +?> +--EXPECTF-- +object(MyAttribute)#1 (1) { + ["value"]=> + int(42) +} + +Fatal error: Uncaught TypeError: MyAttribute::__construct(): Argument #1 ($value) must be of type int, string given, called in %s030_strict_types.inc on line 4 and defined in %s030_strict_types.php:5 +Stack trace: +#0 %s030_strict_types.inc(4): MyAttribute->__construct('42') +#1 %s(%d): ReflectionAttribute->newInstance() +#2 {main} + thrown in %s on line %d diff --git a/Zend/tests/attributes/031_backtrace.phpt b/Zend/tests/attributes/031_backtrace.phpt new file mode 100644 index 0000000000000..b0374e67e2fc8 --- /dev/null +++ b/Zend/tests/attributes/031_backtrace.phpt @@ -0,0 +1,97 @@ +--TEST-- +Backtrace during attribute instance creation +--FILE-- +getTrace()); + } +} + +#[MyAttribute] +class Test {} + +(new ReflectionClass(Test::class))->getAttributes()[0]->newInstance(); + +?> +--EXPECTF-- +#0 MyAttribute->__construct() called at [%s031_backtrace.php:12] +#1 ReflectionAttribute->newInstance() called at [%s:%d] +array(2) { + [0]=> + array(7) { + ["file"]=> + string(%d) "%s031_backtrace.php" + ["line"]=> + int(12) + ["function"]=> + string(11) "__construct" + ["class"]=> + string(11) "MyAttribute" + ["object"]=> + object(MyAttribute)#1 (0) { + } + ["type"]=> + string(2) "->" + ["args"]=> + array(0) { + } + } + [1]=> + array(7) { + ["file"]=> + string(%d) "%s" + ["line"]=> + int(%d) + ["function"]=> + string(11) "newInstance" + ["class"]=> + string(19) "ReflectionAttribute" + ["object"]=> + object(ReflectionAttribute)#2 (0) { + } + ["type"]=> + string(2) "->" + ["args"]=> + array(0) { + } + } +} +array(2) { + [0]=> + array(6) { + ["file"]=> + string(%d) "%s031_backtrace.php" + ["line"]=> + int(12) + ["function"]=> + string(11) "__construct" + ["class"]=> + string(11) "MyAttribute" + ["type"]=> + string(2) "->" + ["args"]=> + array(0) { + } + } + [1]=> + array(6) { + ["file"]=> + string(%d) "%s" + ["line"]=> + int(%d) + ["function"]=> + string(11) "newInstance" + ["class"]=> + string(19) "ReflectionAttribute" + ["type"]=> + string(2) "->" + ["args"]=> + array(0) { + } + } +} diff --git a/Zend/tests/bug33999.phpt b/Zend/tests/bug33999.phpt index 7460815441beb..2b03c3124a3c3 100644 --- a/Zend/tests/bug33999.phpt +++ b/Zend/tests/bug33999.phpt @@ -23,8 +23,8 @@ object(Foo)#1 (1) { string(3) "bat" } -Notice: Object of class Foo could not be converted to int in %sbug33999.php on line 9 +Warning: Object of class Foo could not be converted to int in %s on line %d int(1) -Notice: Object of class Foo could not be converted to float in %sbug33999.php on line 12 +Warning: Object of class Foo could not be converted to float in %s on line %d float(1) diff --git a/Zend/tests/bug47054.phpt b/Zend/tests/bug47054.phpt index f607365bdcf8b..eca13e00af518 100644 --- a/Zend/tests/bug47054.phpt +++ b/Zend/tests/bug47054.phpt @@ -22,12 +22,8 @@ C::s(); $c = new C(); $c->s(); -get_called_class(); - ?> ---EXPECTF-- +--EXPECT-- Called class: D Called class: C Called class: C - -Warning: get_called_class() called from outside a class in %s on line %d diff --git a/Zend/tests/bug53305.phpt b/Zend/tests/bug53305.phpt index c922ac6338823..c76b582e244a9 100644 --- a/Zend/tests/bug53305.phpt +++ b/Zend/tests/bug53305.phpt @@ -14,6 +14,6 @@ var_dump(constant('__COMPILER_HALT_OFFSET__1'.chr(0))); ?> --EXPECTF-- -Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d +Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d int(1) int(4) diff --git a/Zend/tests/bug70914.phpt b/Zend/tests/bug70914.phpt index b8a1c91d36338..d1f42793129c0 100644 --- a/Zend/tests/bug70914.phpt +++ b/Zend/tests/bug70914.phpt @@ -18,4 +18,4 @@ try { } ?> --EXPECT-- -PDOStatement::fetchObject(): Argument #1 ($class_name) must be a valid class name, %Z given +PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given diff --git a/Zend/tests/bug75290.phpt b/Zend/tests/bug75290.phpt index 3b28e621d2c4c..9d9d1a05619c1 100644 --- a/Zend/tests/bug75290.phpt +++ b/Zend/tests/bug75290.phpt @@ -12,7 +12,7 @@ var_dump(function ($someThing) {}); object(Closure)#2 (1) { ["parameter"]=> array(1) { - ["$number"]=> + ["$num"]=> string(10) "" } } diff --git a/Zend/tests/bug79783.phpt b/Zend/tests/bug79783.phpt index 74d2672e02a00..6accb0c284de9 100644 --- a/Zend/tests/bug79783.phpt +++ b/Zend/tests/bug79783.phpt @@ -5,7 +5,7 @@ Bug #79783: Segfault in php_str_replace_common str_replace("a", "b", "c", strlen("d")); ?> --EXPECTF-- -Fatal error: Uncaught Error: str_replace(): Argument #4 ($replace_count) cannot be passed by reference in %s:%d +Fatal error: Uncaught Error: str_replace(): Argument #4 ($count) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/bug79897.phpt b/Zend/tests/bug79897.phpt index 19869538a4652..201a89f73920d 100644 --- a/Zend/tests/bug79897.phpt +++ b/Zend/tests/bug79897.phpt @@ -12,21 +12,27 @@ class B { class A { public function __construct( - #[B(12)] public $b + #[B(12, X)] public $b ) { } } +const X = 42; + var_dump((new ReflectionParameter(['A', '__construct'], 'b'))->getAttributes()[0]->getArguments()); var_dump((new ReflectionProperty('A', 'b'))->getAttributes()[0]->getArguments()); ?> --EXPECT-- -array(1) { +array(2) { [0]=> int(12) + [1]=> + int(42) } -array(1) { +array(2) { [0]=> int(12) + [1]=> + int(42) } diff --git a/Zend/tests/bug79979.phpt b/Zend/tests/bug79979.phpt index d655a0edce577..753b2abdb5f77 100644 --- a/Zend/tests/bug79979.phpt +++ b/Zend/tests/bug79979.phpt @@ -6,17 +6,17 @@ Bug #79979 (passing value to by-ref param via CUF(A) crashes) namespace Foo; call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]); -call_user_func_array("str_replace", ["a", "b", "c", "replace_count" => new \stdClass]); +call_user_func_array("str_replace", ["a", "b", "c", "count" => new \stdClass]); \call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]); -\call_user_func_array("str_replace", ["a", "b", "c", "replace_count" => new \stdClass]); +\call_user_func_array("str_replace", ["a", "b", "c", "count" => new \stdClass]); ?> --EXPECTF-- -Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d +Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d -Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d +Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d -Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d +Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d -Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d +Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d diff --git a/Zend/tests/call_user_func_001.phpt b/Zend/tests/call_user_func_001.phpt index 34234271b36b9..9497d305e2cda 100644 --- a/Zend/tests/call_user_func_001.phpt +++ b/Zend/tests/call_user_func_001.phpt @@ -37,5 +37,5 @@ namespace testing { ?> --EXPECT-- string(6) "foobar" -call_user_func(): Argument #1 ($function) must be a valid callback, cannot access private method testing\foo::priv() -call_user_func(): Argument #1 ($function) must be a valid callback, cannot access protected method testing\foo::prot() +call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv() +call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot() diff --git a/Zend/tests/cast_to_double.phpt b/Zend/tests/cast_to_double.phpt index 58286436bd29b..2972fbbe8027a 100644 --- a/Zend/tests/cast_to_double.phpt +++ b/Zend/tests/cast_to_double.phpt @@ -52,6 +52,6 @@ float(1) float(0) float(%f) -Notice: Object of class test could not be converted to float in %s on line %d +Warning: Object of class test could not be converted to float in %s on line %d float(1) Done diff --git a/Zend/tests/cast_to_int.phpt b/Zend/tests/cast_to_int.phpt index 5dbab23fd2df2..6451c4a2f7208 100644 --- a/Zend/tests/cast_to_int.phpt +++ b/Zend/tests/cast_to_int.phpt @@ -50,6 +50,6 @@ int(1) int(0) int(%d) -Notice: Object of class test could not be converted to int in %s on line %d +Warning: Object of class test could not be converted to int in %s on line %d int(1) Done diff --git a/Zend/tests/closure_040.phpt b/Zend/tests/closure_040.phpt index a18ae2640e018..436c99939b1ee 100644 --- a/Zend/tests/closure_040.phpt +++ b/Zend/tests/closure_040.phpt @@ -24,14 +24,16 @@ $a = new A(20); $ca = $a->getIncrementor(); $cas = $a->getStaticIncrementor(); -$ca->bindTo($a, array()); +try { + $ca->bindTo($a, array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} $cas->bindTo($a, 'A'); ?> --EXPECTF-- -Warning: Array to string conversion in %s on line %d - -Warning: Class "Array" not found in %s on line %d +Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given Warning: Cannot bind an instance to a static closure in %s on line %d diff --git a/Zend/tests/constants_001.phpt b/Zend/tests/constants_001.phpt index 8419eb6613de0..7b274d6fd9c3a 100644 --- a/Zend/tests/constants_001.phpt +++ b/Zend/tests/constants_001.phpt @@ -17,7 +17,7 @@ var_dump(constant('1foo')); ?> --EXPECTF-- -Notice: Constant 1 already defined in %s on line %d +Warning: Constant 1 already defined in %s on line %d int(2) int(2) int(2) diff --git a/Zend/tests/constants_004.phpt b/Zend/tests/constants_004.phpt index 69369aa3d9631..e981415361253 100644 --- a/Zend/tests/constants_004.phpt +++ b/Zend/tests/constants_004.phpt @@ -10,4 +10,4 @@ const foo = 2; ?> --EXPECTF-- -Notice: Constant foo\foo already defined in %s on line %d +Warning: Constant foo\foo already defined in %s on line %d diff --git a/Zend/tests/constants_008.phpt b/Zend/tests/constants_008.phpt index 6a8f00edec235..17c6904579caf 100644 --- a/Zend/tests/constants_008.phpt +++ b/Zend/tests/constants_008.phpt @@ -13,5 +13,5 @@ if (defined('a')) { ?> --EXPECTF-- -Notice: Constant a already defined in %s on line %d +Warning: Constant a already defined in %s on line %d 2 diff --git a/Zend/tests/exception_handler_004.phpt b/Zend/tests/exception_handler_004.phpt index 9b2ae6933ac0c..a9f9e77a59d90 100644 --- a/Zend/tests/exception_handler_004.phpt +++ b/Zend/tests/exception_handler_004.phpt @@ -16,5 +16,5 @@ try { ?> --EXPECT-- -set_exception_handler(): Argument #1 ($exception_handler) must be a valid callback or null, function "fo" not found or invalid function name -set_exception_handler(): Argument #1 ($exception_handler) must be a valid callback or null, class "" not found +set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name +set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found diff --git a/Zend/tests/function_outside_namespace.phpt b/Zend/tests/function_outside_namespace.phpt new file mode 100644 index 0000000000000..f63fb9f56ab27 --- /dev/null +++ b/Zend/tests/function_outside_namespace.phpt @@ -0,0 +1,12 @@ +--TEST-- +Function declaration should not be allowed before namespace declaration +--FILE-- + +--EXPECTF-- +Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %s on line %d diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt index 2eacfd0d359ea..b88902d841c18 100644 --- a/Zend/tests/generators/errors/count_error.phpt +++ b/Zend/tests/generators/errors/count_error.phpt @@ -9,10 +9,10 @@ $gen = gen(); try { count($gen); -} catch (Exception $e) { - echo $e; +} catch (\TypeError $e) { + echo $e->getMessage(), PHP_EOL; } ?> ---EXPECTF-- -Warning: count(): Argument #1 ($var) must be of type Countable|array, Generator given in %s on line %d +--EXPECT-- +count(): Argument #1 ($var) must be of type Countable|array, Generator given diff --git a/Zend/tests/get_called_class_001.phpt b/Zend/tests/get_called_class_001.phpt index 7012ae8129fe5..caa6d154d9c59 100644 --- a/Zend/tests/get_called_class_001.phpt +++ b/Zend/tests/get_called_class_001.phpt @@ -3,9 +3,12 @@ Calling get_called_class() outside a class --FILE-- getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: get_called_class() called from outside a class in %s on line %d -bool(false) +--EXPECT-- +get_called_class() must be called from within a class diff --git a/Zend/tests/get_class_vars_001.phpt b/Zend/tests/get_class_vars_001.phpt index a5939ccd5f1d0..84f502610ecaf 100644 --- a/Zend/tests/get_class_vars_001.phpt +++ b/Zend/tests/get_class_vars_001.phpt @@ -19,6 +19,12 @@ class B extends A { var_dump(get_class_vars('A')); var_dump(get_class_vars('B')); +try { + get_class_vars("Unknown"); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + ?> --EXPECT-- array(1) { @@ -31,3 +37,4 @@ array(2) { ["aa"]=> int(4) } +get_class_vars(): Argument #1 ($class) must be a valid class name, Unknown given diff --git a/Zend/tests/halt_compiler3.phpt b/Zend/tests/halt_compiler3.phpt index f0a5323e66fee..ff25b13333639 100644 --- a/Zend/tests/halt_compiler3.phpt +++ b/Zend/tests/halt_compiler3.phpt @@ -5,4 +5,4 @@ __HALT_COMPILER(); bad define() of __COMPILER_HALT_OFFSET__ 1 define ('__COMPILER_HALT_OFFSET__', 1); ?> --EXPECTF-- -Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d +Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d diff --git a/Zend/tests/halt_compiler4.phpt b/Zend/tests/halt_compiler4.phpt index 53a4fc76f9ef8..bb96f25ed96b7 100644 --- a/Zend/tests/halt_compiler4.phpt +++ b/Zend/tests/halt_compiler4.phpt @@ -7,4 +7,4 @@ __HALT_COMPILER(); ?> ==DONE== --EXPECTF-- -Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d +Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt index 36481dccce7c1..f14c63af5de79 100644 --- a/Zend/tests/offset_string.phpt +++ b/Zend/tests/offset_string.phpt @@ -69,7 +69,7 @@ Warning: String offset cast occurred in %s on line %d string(1) "S" Cannot access offset of type resource on string -Notice: Object of class stdClass could not be converted to int in %s on line %d +Warning: Object of class stdClass could not be converted to int in %s on line %d Cannot access offset of type stdClass on string Cannot access offset of type array on string Done diff --git a/Zend/tests/settype_double.phpt b/Zend/tests/settype_double.phpt index d5b2f0e42ea94..6bbe773d0c2c9 100644 --- a/Zend/tests/settype_double.phpt +++ b/Zend/tests/settype_double.phpt @@ -52,6 +52,6 @@ float(1) float(0) float(%f) -Notice: Object of class test could not be converted to float in %s on line %d +Warning: Object of class test could not be converted to float in %s on line %d float(1) Done diff --git a/Zend/tests/settype_int.phpt b/Zend/tests/settype_int.phpt index 9dac9c5b8f2b9..e5eb098a67f56 100644 --- a/Zend/tests/settype_int.phpt +++ b/Zend/tests/settype_int.phpt @@ -50,6 +50,6 @@ int(1) int(0) int(%d) -Notice: Object of class test could not be converted to int in %s on line %d +Warning: Object of class test could not be converted to int in %s on line %d int(1) Done diff --git a/Zend/tests/type_declarations/confusable_type_warning.phpt b/Zend/tests/type_declarations/confusable_type_warning.phpt index e0202cee066e0..44bd173451948 100644 --- a/Zend/tests/type_declarations/confusable_type_warning.phpt +++ b/Zend/tests/type_declarations/confusable_type_warning.phpt @@ -3,10 +3,12 @@ Warnings for confusable types --FILE-- function_name = zend_string_init_interned(ptr->fname, fname_len, 1); internal_function->scope = scope; internal_function->prototype = NULL; + internal_function->attributes = NULL; if (ptr->flags) { if (!(ptr->flags & ZEND_ACC_PPP_MASK)) { if (ptr->flags != ZEND_ACC_DEPRECATED && scope) { @@ -4396,7 +4397,7 @@ static zend_result get_default_via_ast(zval *default_value_zval, const char *def } zend_ast_list *statement_list = zend_ast_get_list(ast); - zend_ast *const_expression_ast = statement_list->child[0]; + zend_ast **const_expr_ast_ptr = &statement_list->child[0]; zend_arena *original_ast_arena = CG(ast_arena); uint32_t original_compiler_options = CG(compiler_options); @@ -4405,7 +4406,7 @@ static zend_result get_default_via_ast(zval *default_value_zval, const char *def /* Disable constant substitution, to make getDefaultValueConstant() work. */ CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION; zend_file_context_begin(&original_file_context); - zend_const_expr_to_zval(default_value_zval, const_expression_ast); + zend_const_expr_to_zval(default_value_zval, const_expr_ast_ptr); CG(ast_arena) = original_ast_arena; CG(compiler_options) = original_compiler_options; zend_file_context_end(&original_file_context); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index da9a57d5c66dd..0b6808b678836 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -638,12 +638,9 @@ END_EXTERN_C() #if ZEND_DEBUG #define CHECK_ZVAL_STRING(str) \ - if (ZSTR_VAL(str)[ZSTR_LEN(str)] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s)", ZSTR_VAL(str)); } -#define CHECK_ZVAL_STRING_REL(str) \ - if (ZSTR_VAL(str)[ZSTR_LEN(str)] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s) (source: %s:%d)", ZSTR_VAL(str) ZEND_FILE_LINE_RELAY_CC); } + ZEND_ASSERT(ZSTR_VAL(str)[ZSTR_LEN(str)] == '\0' && "String is not null-terminated"); #else #define CHECK_ZVAL_STRING(z) -#define CHECK_ZVAL_STRING_REL(z) #endif #define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p))) diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c index af5baa6ce07d1..29a2f4a732546 100644 --- a/Zend/zend_attributes.c +++ b/Zend/zend_attributes.c @@ -175,38 +175,29 @@ ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attrib return 0; } -static zend_always_inline void free_attribute(zend_attribute *attr, bool persistent) +static void attr_free(zval *v) { - uint32_t i; + zend_attribute *attr = Z_PTR_P(v); zend_string_release(attr->name); zend_string_release(attr->lcname); - for (i = 0; i < attr->argc; i++) { + for (uint32_t i = 0; i < attr->argc; i++) { if (attr->args[i].name) { zend_string_release(attr->args[i].name); } zval_ptr_dtor(&attr->args[i].value); } - pefree(attr, persistent); -} - -static void attr_free(zval *v) -{ - free_attribute((zend_attribute *) Z_PTR_P(v), 0); + pefree(attr, attr->flags & ZEND_ATTRIBUTE_PERSISTENT); } -static void attr_pfree(zval *v) -{ - free_attribute((zend_attribute *) Z_PTR_P(v), 1); -} - -ZEND_API zend_attribute *zend_add_attribute(HashTable **attributes, zend_bool persistent, uint32_t offset, zend_string *name, uint32_t argc) +ZEND_API zend_attribute *zend_add_attribute(HashTable **attributes, zend_string *name, uint32_t argc, uint32_t flags, uint32_t offset, uint32_t lineno) { + bool persistent = flags & ZEND_ATTRIBUTE_PERSISTENT; if (*attributes == NULL) { *attributes = pemalloc(sizeof(HashTable), persistent); - zend_hash_init(*attributes, 8, NULL, persistent ? attr_pfree : attr_free, persistent); + zend_hash_init(*attributes, 8, NULL, attr_free, persistent); } zend_attribute *attr = pemalloc(ZEND_ATTRIBUTE_SIZE(argc), persistent); @@ -218,6 +209,8 @@ ZEND_API zend_attribute *zend_add_attribute(HashTable **attributes, zend_bool pe } attr->lcname = zend_string_tolower_ex(attr->name, persistent); + attr->flags = flags; + attr->lineno = lineno; attr->offset = offset; attr->argc = argc; diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h index 6a60b06665a8f..d19b7e470dc17 100644 --- a/Zend/zend_attributes.h +++ b/Zend/zend_attributes.h @@ -30,6 +30,10 @@ #define ZEND_ATTRIBUTE_IS_REPEATABLE (1<<6) #define ZEND_ATTRIBUTE_FLAGS ((1<<7) - 1) +/* Flags for zend_attribute.flags */ +#define ZEND_ATTRIBUTE_PERSISTENT (1<<0) +#define ZEND_ATTRIBUTE_STRICT_TYPES (1<<1) + #define ZEND_ATTRIBUTE_SIZE(argc) \ (sizeof(zend_attribute) + sizeof(zend_attribute_arg) * (argc) - sizeof(zend_attribute_arg)) @@ -45,6 +49,8 @@ typedef struct { typedef struct _zend_attribute { zend_string *name; zend_string *lcname; + uint32_t flags; + uint32_t lineno; /* Parameter offsets start at 1, everything else uses 0. */ uint32_t offset; uint32_t argc; @@ -71,33 +77,40 @@ ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attrib ZEND_API zend_internal_attribute *zend_internal_attribute_register(zend_class_entry *ce, uint32_t flags); ZEND_API zend_internal_attribute *zend_internal_attribute_get(zend_string *lcname); -ZEND_API zend_attribute *zend_add_attribute(HashTable **attributes, zend_bool persistent, uint32_t offset, zend_string *name, uint32_t argc); +ZEND_API zend_attribute *zend_add_attribute( + HashTable **attributes, zend_string *name, uint32_t argc, + uint32_t flags, uint32_t offset, uint32_t lineno); END_EXTERN_C() static zend_always_inline zend_attribute *zend_add_class_attribute(zend_class_entry *ce, zend_string *name, uint32_t argc) { - return zend_add_attribute(&ce->attributes, ce->type != ZEND_USER_CLASS, 0, name, argc); + uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&ce->attributes, name, argc, flags, 0, 0); } static zend_always_inline zend_attribute *zend_add_function_attribute(zend_function *func, zend_string *name, uint32_t argc) { - return zend_add_attribute(&func->common.attributes, func->common.type != ZEND_USER_FUNCTION, 0, name, argc); + uint32_t flags = func->common.type != ZEND_USER_FUNCTION ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&func->common.attributes, name, argc, flags, 0, 0); } static zend_always_inline zend_attribute *zend_add_parameter_attribute(zend_function *func, uint32_t offset, zend_string *name, uint32_t argc) { - return zend_add_attribute(&func->common.attributes, func->common.type != ZEND_USER_FUNCTION, offset + 1, name, argc); + uint32_t flags = func->common.type != ZEND_USER_FUNCTION ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&func->common.attributes, name, argc, flags, offset + 1, 0); } static zend_always_inline zend_attribute *zend_add_property_attribute(zend_class_entry *ce, zend_property_info *info, zend_string *name, uint32_t argc) { - return zend_add_attribute(&info->attributes, ce->type != ZEND_USER_CLASS, 0, name, argc); + uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&info->attributes, name, argc, flags, 0, 0); } static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend_class_entry *ce, zend_class_constant *c, zend_string *name, uint32_t argc) { - return zend_add_attribute(&c->attributes, ce->type != ZEND_USER_CLASS, 0, name, argc); + uint32_t flags = ce->type != ZEND_USER_CLASS ? ZEND_ATTRIBUTE_PERSISTENT : 0; + return zend_add_attribute(&c->attributes, name, argc, flags, 0, 0); } void zend_register_attribute_ce(void); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index fbc7d1332907c..5ec365c920599 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -747,27 +747,22 @@ static void add_class_vars(zend_class_entry *scope, zend_class_entry *ce, bool s /* {{{ Returns an array of default properties of the class. */ ZEND_FUNCTION(get_class_vars) { - zend_string *class_name; - zend_class_entry *ce, *scope; + zend_class_entry *ce = NULL, *scope; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &class_name) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce) == FAILURE) { RETURN_THROWS(); } - ce = zend_lookup_class(class_name); - if (!ce) { - RETURN_FALSE; - } else { - array_init(return_value); - if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) { - if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { - return; - } + array_init(return_value); + if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) { + if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { + return; } - scope = zend_get_executed_scope(); - add_class_vars(scope, ce, 0, return_value); - add_class_vars(scope, ce, 1, return_value); } + + scope = zend_get_executed_scope(); + add_class_vars(scope, ce, 0, return_value); + add_class_vars(scope, ce, 1, return_value); } /* }}} */ @@ -1786,13 +1781,12 @@ ZEND_FUNCTION(debug_print_backtrace) } else { /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */ zend_bool build_filename_arg = 1; + uint32_t include_kind = 0; + if (ptr->func && ZEND_USER_CODE(ptr->func->common.type) && ptr->opline->opcode == ZEND_INCLUDE_OR_EVAL) { + include_kind = ptr->opline->extended_value; + } - if (!ptr->func || !ZEND_USER_CODE(ptr->func->common.type) || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) { - /* can happen when calling eval from a custom sapi */ - function_name = "unknown"; - build_filename_arg = 0; - } else - switch (ptr->opline->extended_value) { + switch (include_kind) { case ZEND_EVAL: function_name = "eval"; build_filename_arg = 0; @@ -1810,8 +1804,11 @@ ZEND_FUNCTION(debug_print_backtrace) function_name = "require_once"; break; default: - /* this can actually happen if you use debug_backtrace() in your error_handler and - * you're in the top-scope */ + /* Skip dummy frame unless it is needed to preserve filename/lineno info. */ + if (!filename) { + goto skip_frame; + } + function_name = "unknown"; build_filename_arg = 0; break; @@ -1862,10 +1859,12 @@ ZEND_FUNCTION(debug_print_backtrace) ZEND_PUTS(")\n"); } } + ++indent; + +skip_frame: include_filename = filename; call = skip; ptr = skip->prev_execute_data; - ++indent; } } @@ -2014,13 +2013,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */ zend_bool build_filename_arg = 1; zend_string *pseudo_function_name; + uint32_t include_kind = 0; + if (ptr->func && ZEND_USER_CODE(ptr->func->common.type) && ptr->opline->opcode == ZEND_INCLUDE_OR_EVAL) { + include_kind = ptr->opline->extended_value; + } - if (!ptr->func || !ZEND_USER_CODE(ptr->func->common.type) || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) { - /* can happen when calling eval from a custom sapi */ - pseudo_function_name = ZSTR_KNOWN(ZEND_STR_UNKNOWN); - build_filename_arg = 0; - } else - switch (ptr->opline->extended_value) { + switch (include_kind) { case ZEND_EVAL: pseudo_function_name = ZSTR_KNOWN(ZEND_STR_EVAL); build_filename_arg = 0; @@ -2038,8 +2036,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int pseudo_function_name = ZSTR_KNOWN(ZEND_STR_REQUIRE_ONCE); break; default: - /* this can actually happen if you use debug_backtrace() in your error_handler and - * you're in the top-scope */ + /* Skip dummy frame unless it is needed to preserve filename/lineno info. */ + if (!filename) { + zval_ptr_dtor(&stack_frame); + goto skip_frame; + } + pseudo_function_name = ZSTR_KNOWN(ZEND_STR_UNKNOWN); build_filename_arg = 0; break; @@ -2065,8 +2067,8 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &stack_frame); +skip_frame: include_filename = filename; - call = skip; ptr = skip->prev_execute_data; } diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php index 5d5ebcde14a1f..6209967b235e8 100644 --- a/Zend/zend_builtin_functions.stub.php +++ b/Zend/zend_builtin_functions.stub.php @@ -39,7 +39,7 @@ function is_subclass_of(mixed $object_or_class, string $class, bool $allow_strin /** @param object|string $object_or_class */ function is_a(mixed $object_or_class, string $class, bool $allow_string = false): bool {} -function get_class_vars(string $class): array|false {} +function get_class_vars(string $class): array {} function get_object_vars(object $object): array {} @@ -68,18 +68,18 @@ function get_included_files(): array {} /** @alias get_included_files */ function get_required_files(): array {} -function trigger_error(string $message, int $error_type = E_USER_NOTICE): bool {} +function trigger_error(string $message, int $error_level = E_USER_NOTICE): bool {} /** @alias trigger_error */ -function user_error(string $message, int $error_type = E_USER_NOTICE): bool {} +function user_error(string $message, int $error_level = E_USER_NOTICE): bool {} /** @return string|array|object|null */ -function set_error_handler(?callable $error_handler, int $error_types = E_ALL) {} +function set_error_handler(?callable $callback, int $error_levels = E_ALL) {} function restore_error_handler(): bool {} /** @return string|array|object|null */ -function set_exception_handler(?callable $exception_handler) {} +function set_exception_handler(?callable $callback) {} function restore_exception_handler(): bool {} diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index 4b551e3d59c48..d5d2fb9113559 100644 --- a/Zend/zend_builtin_functions_arginfo.h +++ b/Zend/zend_builtin_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 1f644f72600eddbbb01a4c3912a2c9c5fe12188e */ + * Stub hash: 9a77101b93e8584315bf43305830e129d359b033 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -69,7 +69,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_a, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, allow_string, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_class_vars, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_class_vars, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -124,21 +124,21 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trigger_error, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_type, IS_LONG, 0, "E_USER_NOTICE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_level, IS_LONG, 0, "E_USER_NOTICE") ZEND_END_ARG_INFO() #define arginfo_user_error arginfo_trigger_error ZEND_BEGIN_ARG_INFO_EX(arginfo_set_error_handler, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, error_handler, IS_CALLABLE, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_types, IS_LONG, 0, "E_ALL") + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, error_levels, IS_LONG, 0, "E_ALL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_restore_error_handler, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_set_exception_handler, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, exception_handler, IS_CALLABLE, 1) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) ZEND_END_ARG_INFO() #define arginfo_restore_exception_handler arginfo_restore_error_handler diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 86cabf0a10d84..034b0d2d071b8 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -192,30 +192,22 @@ ZEND_METHOD(Closure, call) } /* }}} */ -static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, zval *scope_arg) +static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, zend_object *scope_obj, zend_string *scope_str) { zend_class_entry *ce, *called_scope; zend_closure *closure = (zend_closure *) Z_OBJ_P(zclosure); - if (scope_arg != NULL) { /* scope argument was given */ - if (Z_TYPE_P(scope_arg) == IS_OBJECT) { - ce = Z_OBJCE_P(scope_arg); - } else if (Z_TYPE_P(scope_arg) == IS_NULL) { - ce = NULL; - } else { - zend_string *tmp_class_name; - zend_string *class_name = zval_get_tmp_string(scope_arg, &tmp_class_name); - if (zend_string_equals_literal(class_name, "static")) { - ce = closure->func.common.scope; - } else if ((ce = zend_lookup_class(class_name)) == NULL) { - zend_error(E_WARNING, "Class \"%s\" not found", ZSTR_VAL(class_name)); - zend_tmp_string_release(tmp_class_name); - RETURN_NULL(); - } - zend_tmp_string_release(tmp_class_name); + if (scope_obj) { + ce = scope_obj->ce; + } else if (scope_str) { + if (zend_string_equals(scope_str, ZSTR_KNOWN(ZEND_STR_STATIC))) { + ce = closure->func.common.scope; + } else if ((ce = zend_lookup_class(scope_str)) == NULL) { + zend_error(E_WARNING, "Class \"%s\" not found", ZSTR_VAL(scope_str)); + RETURN_NULL(); } - } else { /* scope argument not given; do not change the scope by default */ - ce = closure->func.common.scope; + } else { + ce = NULL; } if (!zend_valid_closure_binding(closure, newthis, ce)) { @@ -234,25 +226,34 @@ static void do_closure_bind(zval *return_value, zval *zclosure, zval *newthis, z /* {{{ Create a closure from another one and bind to another object and scope */ ZEND_METHOD(Closure, bind) { - zval *newthis, *zclosure, *scope_arg = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oo!|z", &zclosure, zend_ce_closure, &newthis, &scope_arg) == FAILURE) { - RETURN_THROWS(); - } + zval *zclosure, *newthis; + zend_object *scope_obj = NULL; + zend_string *scope_str = ZSTR_KNOWN(ZEND_STR_STATIC); + + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_OBJECT_OF_CLASS(zclosure, zend_ce_closure) + Z_PARAM_OBJECT_OR_NULL(newthis) + Z_PARAM_OPTIONAL + Z_PARAM_OBJ_OR_STR_OR_NULL(scope_obj, scope_str) + ZEND_PARSE_PARAMETERS_END(); - do_closure_bind(return_value, zclosure, newthis, scope_arg); + do_closure_bind(return_value, zclosure, newthis, scope_obj, scope_str); } /* {{{ Create a closure from another one and bind to another object and scope */ ZEND_METHOD(Closure, bindTo) { - zval *newthis, *scope_arg = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!|z", &newthis, &scope_arg) == FAILURE) { - RETURN_THROWS(); - } + zval *newthis; + zend_object *scope_obj = NULL; + zend_string *scope_str = ZSTR_KNOWN(ZEND_STR_STATIC); + + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_OBJECT_OR_NULL(newthis) + Z_PARAM_OPTIONAL + Z_PARAM_OBJ_OR_STR_OR_NULL(scope_obj, scope_str) + ZEND_PARSE_PARAMETERS_END(); - do_closure_bind(return_value, getThis(), newthis, scope_arg); + do_closure_bind(return_value, getThis(), newthis, scope_obj, scope_str); } static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ { diff --git a/Zend/zend_closures.stub.php b/Zend/zend_closures.stub.php index 70e555bff2dc4..906dedc5cfe9e 100644 --- a/Zend/zend_closures.stub.php +++ b/Zend/zend_closures.stub.php @@ -6,13 +6,15 @@ final class Closure { private function __construct() {} - /** @param object|string|null $newScope */ - public static function bind(Closure $closure, ?object $newThis, $newScope = UNKNOWN): ?Closure {} + public static function bind( + Closure $closure, + ?object $newThis, + object|string|null $newScope = "static" + ): ?Closure {} - /** @param object|string|null $newScope */ - public function bindTo(?object $newThis, $newScope = UNKNOWN): ?Closure {} + public function bindTo(?object $newThis, object|string|null $newScope = "static"): ?Closure {} - public function call(object $newThis, mixed ...$arguments): mixed {} + public function call(object $newThis, mixed ...$args): mixed {} public static function fromCallable(callable $callback): Closure {} } diff --git a/Zend/zend_closures_arginfo.h b/Zend/zend_closures_arginfo.h index f09023b132d0f..1ccde0d6dd648 100644 --- a/Zend/zend_closures_arginfo.h +++ b/Zend/zend_closures_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: abbbe7b04323dc44b0675ad58700e996a6d7c43b */ + * Stub hash: 0a2dd53716d30893aa5dd92a9907b2298abb3f70 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Closure___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -7,17 +7,17 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_bind, 0, 2, Closure, 1) ZEND_ARG_OBJ_INFO(0, closure, Closure, 0) ZEND_ARG_TYPE_INFO(0, newThis, IS_OBJECT, 1) - ZEND_ARG_INFO(0, newScope) + ZEND_ARG_TYPE_MASK(0, newScope, MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_NULL, "\"static\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_bindTo, 0, 1, Closure, 1) ZEND_ARG_TYPE_INFO(0, newThis, IS_OBJECT, 1) - ZEND_ARG_INFO(0, newScope) + ZEND_ARG_TYPE_MASK(0, newScope, MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_NULL, "\"static\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Closure_call, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, newThis, IS_OBJECT, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, arguments, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Closure_fromCallable, 0, 1, Closure, 0) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f42542c6b2611..7debd55accf3b 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4596,11 +4596,11 @@ static void zend_compile_static_var_common(zend_string *var_name, zval *value, u void zend_compile_static_var(zend_ast *ast) /* {{{ */ { zend_ast *var_ast = ast->child[0]; - zend_ast *value_ast = ast->child[1]; + zend_ast **value_ast_ptr = &ast->child[1]; zval value_zv; - if (value_ast) { - zend_const_expr_to_zval(&value_zv, value_ast); + if (*value_ast_ptr) { + zend_const_expr_to_zval(&value_zv, value_ast_ptr); } else { ZVAL_NULL(&value_zv); } @@ -5864,20 +5864,19 @@ zend_bool zend_handle_encoding_declaration(zend_ast *ast) /* {{{ */ } /* }}} */ -static zend_result zend_declare_is_first_statement(zend_ast *ast) /* {{{ */ +/* Check whether this is the first statement, not counting declares. */ +static zend_result zend_is_first_statement(zend_ast *ast) /* {{{ */ { uint32_t i = 0; zend_ast_list *file_ast = zend_ast_get_list(CG(ast)); - /* Check to see if this declare is preceded only by declare statements */ while (i < file_ast->children) { if (file_ast->child[i] == ast) { return SUCCESS; } else if (file_ast->child[i] == NULL) { - /* Empty statements are not allowed prior to a declare */ + /* Empty statements count as statements. */ return FAILURE; } else if (file_ast->child[i]->kind != ZEND_AST_DECLARE) { - /* declares can only be preceded by other declares */ return FAILURE; } i++; @@ -5896,28 +5895,28 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */ for (i = 0; i < declares->children; ++i) { zend_ast *declare_ast = declares->child[i]; zend_ast *name_ast = declare_ast->child[0]; - zend_ast *value_ast = declare_ast->child[1]; + zend_ast **value_ast_ptr = &declare_ast->child[1]; zend_string *name = zend_ast_get_str(name_ast); - if (value_ast->kind != ZEND_AST_ZVAL) { + if ((*value_ast_ptr)->kind != ZEND_AST_ZVAL) { zend_error_noreturn(E_COMPILE_ERROR, "declare(%s) value must be a literal", ZSTR_VAL(name)); } if (zend_string_equals_literal_ci(name, "ticks")) { zval value_zv; - zend_const_expr_to_zval(&value_zv, value_ast); + zend_const_expr_to_zval(&value_zv, value_ast_ptr); FC(declarables).ticks = zval_get_long(&value_zv); zval_ptr_dtor_nogc(&value_zv); } else if (zend_string_equals_literal_ci(name, "encoding")) { - if (FAILURE == zend_declare_is_first_statement(ast)) { + if (FAILURE == zend_is_first_statement(ast)) { zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be " "the very first statement in the script"); } } else if (zend_string_equals_literal_ci(name, "strict_types")) { zval value_zv; - if (FAILURE == zend_declare_is_first_statement(ast)) { + if (FAILURE == zend_is_first_statement(ast)) { zend_error_noreturn(E_COMPILE_ERROR, "strict_types declaration must be " "the very first statement in the script"); } @@ -5927,7 +5926,7 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */ "use block mode"); } - zend_const_expr_to_zval(&value_zv, value_ast); + zend_const_expr_to_zval(&value_zv, value_ast_ptr); if (Z_TYPE(value_zv) != IS_LONG || (Z_LVAL(value_zv) != 0 && Z_LVAL(value_zv) != 1)) { zend_error_noreturn(E_COMPILE_ERROR, "strict_types declaration must have 0 or 1 as its value"); @@ -6222,7 +6221,10 @@ static void zend_compile_attributes(HashTable **attributes, zend_ast *ast, uint3 zend_string *name = zend_resolve_class_name_ast(el->child[0]); zend_ast_list *args = el->child[1] ? zend_ast_get_list(el->child[1]) : NULL; - attr = zend_add_attribute(attributes, 0, offset, name, args ? args->children : 0); + uint32_t flags = (CG(active_op_array)->fn_flags & ZEND_ACC_STRICT_TYPES) + ? ZEND_ATTRIBUTE_STRICT_TYPES : 0; + attr = zend_add_attribute( + attributes, name, args ? args->children : 0, flags, offset, el->lineno); zend_string_release(name); /* Populate arguments */ @@ -6231,7 +6233,8 @@ static void zend_compile_attributes(HashTable **attributes, zend_ast *ast, uint3 zend_bool uses_named_args = 0; for (j = 0; j < args->children; j++) { - zend_ast *arg_ast = args->child[j]; + zend_ast **arg_ast_ptr = &args->child[j]; + zend_ast *arg_ast = *arg_ast_ptr; if (arg_ast->kind == ZEND_AST_UNPACK) { zend_error_noreturn(E_COMPILE_ERROR, @@ -6240,7 +6243,7 @@ static void zend_compile_attributes(HashTable **attributes, zend_ast *ast, uint3 if (arg_ast->kind == ZEND_AST_NAMED_ARG) { attr->args[j].name = zend_string_copy(zend_ast_get_str(arg_ast->child[0])); - arg_ast = arg_ast->child[1]; + arg_ast_ptr = &arg_ast->child[1]; uses_named_args = 1; for (uint32_t k = 0; k < j; k++) { @@ -6255,7 +6258,7 @@ static void zend_compile_attributes(HashTable **attributes, zend_ast *ast, uint3 "Cannot use positional argument after named argument"); } - zend_const_expr_to_zval(&attr->args[j].value, arg_ast); + zend_const_expr_to_zval(&attr->args[j].value, arg_ast_ptr); } } } @@ -6322,7 +6325,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall zend_ast *param_ast = list->child[i]; zend_ast *type_ast = param_ast->child[0]; zend_ast *var_ast = param_ast->child[1]; - zend_ast *default_ast = param_ast->child[2]; + zend_ast **default_ast_ptr = ¶m_ast->child[2]; zend_ast *attributes_ast = param_ast->child[3]; zend_ast *doc_comment_ast = param_ast->child[4]; zend_string *name = zval_make_interned_string(zend_ast_get_zval(var_ast)); @@ -6336,12 +6339,6 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall zend_op *opline; zend_arg_info *arg_info; - zend_ast_ref *attributes_copy = NULL; - - if (visibility && attributes_ast) { - attributes_copy = zend_ast_copy(attributes_ast); - } - if (zend_is_auto_global(name)) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", ZSTR_VAL(name)); @@ -6366,17 +6363,17 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall default_node.op_type = IS_UNUSED; op_array->fn_flags |= ZEND_ACC_VARIADIC; - if (default_ast) { + if (*default_ast_ptr) { zend_error_noreturn(E_COMPILE_ERROR, "Variadic parameter cannot have a default value"); } - } else if (default_ast) { + } else if (*default_ast_ptr) { /* we cannot substitute constants here or it will break ReflectionParameter::getDefaultValueConstantName() and ReflectionParameter::isDefaultValueConstant() */ uint32_t cops = CG(compiler_options); CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION; opcode = ZEND_RECV_INIT; default_node.op_type = IS_CONST; - zend_const_expr_to_zval(&default_node.u.constant, default_ast); + zend_const_expr_to_zval(&default_node.u.constant, default_ast_ptr); CG(compiler_options) = cops; if (!optional_param) { @@ -6407,7 +6404,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall } if (type_ast) { - uint32_t default_type = default_ast ? Z_TYPE(default_node.u.constant) : IS_UNDEF; + uint32_t default_type = *default_ast_ptr ? Z_TYPE(default_node.u.constant) : IS_UNDEF; zend_bool force_nullable = default_type == IS_NULL && !visibility; op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS; @@ -6495,8 +6492,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32_t fall scope, name, &default_value, visibility | ZEND_ACC_PROMOTED, doc_comment, type); if (attributes_ast) { zend_compile_attributes( - &prop->attributes, GC_AST(attributes_copy), 0, ZEND_ATTRIBUTE_TARGET_PROPERTY); - zend_ast_ref_destroy(attributes_copy); + &prop->attributes, attributes_ast, 0, ZEND_ATTRIBUTE_TARGET_PROPERTY); } } } @@ -7000,7 +6996,7 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, z zend_property_info *info; zend_ast *prop_ast = list->child[i]; zend_ast *name_ast = prop_ast->child[0]; - zend_ast *value_ast = prop_ast->child[1]; + zend_ast **value_ast_ptr = &prop_ast->child[1]; zend_ast *doc_comment_ast = prop_ast->child[2]; zend_string *name = zval_make_interned_string(zend_ast_get_zval(name_ast)); zend_string *doc_comment = NULL; @@ -7034,8 +7030,8 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags, z ZSTR_VAL(ce->name), ZSTR_VAL(name)); } - if (value_ast) { - zend_const_expr_to_zval(&value_zv, value_ast); + if (*value_ast_ptr) { + zend_const_expr_to_zval(&value_zv, value_ast_ptr); if (ZEND_TYPE_IS_SET(type) && !Z_CONSTANT(value_zv) && !zend_is_valid_default_value(type, &value_zv)) { @@ -7073,11 +7069,6 @@ void zend_compile_prop_group(zend_ast *ast) /* {{{ */ zend_ast *prop_ast = ast->child[1]; zend_ast *attr_ast = ast->child[2]; - if (attr_ast && zend_ast_get_list(prop_ast)->children > 1) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot apply attributes to a group of properties"); - return; - } - zend_compile_prop_decl(prop_ast, type_ast, ast->attr, attr_ast); } /* }}} */ @@ -7109,7 +7100,7 @@ void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_ast *attr zend_class_constant *c; zend_ast *const_ast = list->child[i]; zend_ast *name_ast = const_ast->child[0]; - zend_ast *value_ast = const_ast->child[1]; + zend_ast **value_ast_ptr = &const_ast->child[1]; zend_ast *doc_comment_ast = const_ast->child[2]; zend_string *name = zval_make_interned_string(zend_ast_get_zval(name_ast)); zend_string *doc_comment = doc_comment_ast ? zend_string_copy(zend_ast_get_str(doc_comment_ast)) : NULL; @@ -7119,7 +7110,7 @@ void zend_compile_class_const_decl(zend_ast *ast, uint32_t flags, zend_ast *attr zend_check_const_and_trait_alias_attr(flags, "constant"); } - zend_const_expr_to_zval(&value_zv, value_ast); + zend_const_expr_to_zval(&value_zv, value_ast_ptr); c = zend_declare_class_constant_ex(ce, name, &value_zv, flags, doc_comment); if (attr_ast) { @@ -7134,12 +7125,6 @@ void zend_compile_class_const_group(zend_ast *ast) /* {{{ */ zend_ast *const_ast = ast->child[0]; zend_ast *attr_ast = ast->child[1]; - if (attr_ast && zend_ast_get_list(const_ast)->children > 1) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot apply attributes to a group of constants"); - - return; - } - zend_compile_class_const_decl(const_ast, ast->attr, attr_ast); } /* }}} */ @@ -7620,7 +7605,7 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */ for (i = 0; i < list->children; ++i) { zend_ast *const_ast = list->child[i]; zend_ast *name_ast = const_ast->child[0]; - zend_ast *value_ast = const_ast->child[1]; + zend_ast **value_ast_ptr = &const_ast->child[1]; zend_string *unqualified_name = zend_ast_get_str(name_ast); zend_string *name; @@ -7628,7 +7613,7 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */ zval *value_zv = &value_node.u.constant; value_node.op_type = IS_CONST; - zend_const_expr_to_zval(value_zv, value_ast); + zend_const_expr_to_zval(value_zv, value_ast_ptr); if (zend_get_special_const(ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name))) { zend_error_noreturn(E_COMPILE_ERROR, @@ -7682,20 +7667,11 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */ } } - if (((!with_bracket && !FC(current_namespace)) - || (with_bracket && !FC(has_bracketed_namespaces))) && CG(active_op_array)->last > 0 - ) { - /* ignore ZEND_EXT_STMT and ZEND_TICKS */ - uint32_t num = CG(active_op_array)->last; - while (num > 0 && - (CG(active_op_array)->opcodes[num-1].opcode == ZEND_EXT_STMT || - CG(active_op_array)->opcodes[num-1].opcode == ZEND_TICKS)) { - --num; - } - if (num > 0) { - zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be " - "the very first statement or after any declare call in the script"); - } + zend_bool is_first_namespace = (!with_bracket && !FC(current_namespace)) + || (with_bracket && !FC(has_bracketed_namespaces)); + if (is_first_namespace && FAILURE == zend_is_first_statement(ast)) { + zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be " + "the very first statement or after any declare call in the script"); } if (FC(current_namespace)) { @@ -9304,23 +9280,18 @@ void zend_compile_const_expr(zend_ast **ast_ptr) /* {{{ */ } /* }}} */ -void zend_const_expr_to_zval(zval *result, zend_ast *ast) /* {{{ */ +void zend_const_expr_to_zval(zval *result, zend_ast **ast_ptr) /* {{{ */ { - zend_ast *orig_ast = ast; - zend_eval_const_expr(&ast); - zend_compile_const_expr(&ast); - if (ast->kind == ZEND_AST_ZVAL) { - ZVAL_COPY_VALUE(result, zend_ast_get_zval(ast)); - } else { - ZVAL_AST(result, zend_ast_copy(ast)); - /* destroy the ast here, it might have been replaced */ - zend_ast_destroy(ast); + zend_eval_const_expr(ast_ptr); + zend_compile_const_expr(ast_ptr); + if ((*ast_ptr)->kind != ZEND_AST_ZVAL) { + /* Replace with compiled AST zval representation. */ + zval ast_zv; + ZVAL_AST(&ast_zv, zend_ast_copy(*ast_ptr)); + zend_ast_destroy(*ast_ptr); + *ast_ptr = zend_ast_create_zval(&ast_zv); } - - /* Kill this branch of the original AST, as it was already destroyed. - * It would be nice to find a better solution to this problem in the - * future. */ - orig_ast->kind = 0; + ZVAL_COPY(result, zend_ast_get_zval(*ast_ptr)); } /* }}} */ diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index ab1e0d2401690..b4af5d9e3fa12 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -135,7 +135,7 @@ void zend_compile_stmt(zend_ast *ast); void zend_compile_expr(znode *node, zend_ast *ast); zend_op *zend_compile_var(znode *node, zend_ast *ast, uint32_t type, bool by_ref); void zend_eval_const_expr(zend_ast **ast_ptr); -void zend_const_expr_to_zval(zval *result, zend_ast *ast); +void zend_const_expr_to_zval(zval *result, zend_ast **ast_ptr); typedef int (*user_opcode_handler_t) (zend_execute_data *execute_data); diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 3ad32446ff56c..f289cc5d9160d 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -503,7 +503,7 @@ ZEND_API zend_result zend_register_constant(zend_constant *c) || (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name))) || zend_hash_add_constant(EG(zend_constants), name, c) == NULL ) { - zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name)); + zend_error(E_WARNING, "Constant %s already defined", ZSTR_VAL(name)); zend_string_release(c->name); if (!persistent) { zval_ptr_dtor_nogc(&c->value); diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 1a0b7d581a726..f037f0399a11e 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -92,11 +92,10 @@ void zend_exception_set_previous(zend_object *exception, zend_object *add_previo return; } + ZEND_ASSERT(instanceof_function(add_previous->ce, zend_ce_throwable) + && "Previous execption must implement Throwable"); + ZVAL_OBJ(&pv, add_previous); - if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) { - zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable"); - return; - } ZVAL_OBJ(&zv, exception); ex = &zv; do { @@ -334,10 +333,10 @@ ZEND_METHOD(ErrorException, __construct) { zend_string *message = NULL, *filename = NULL; zend_long code = 0, severity = E_ERROR, lineno; + zend_bool lineno_is_null = 1; zval tmp, *object, *previous = NULL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "|SllSlO!", &message, &code, &severity, &filename, &lineno, &previous, zend_ce_throwable) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|SllS!l!O!", &message, &code, &severity, &filename, &lineno, &lineno_is_null, &previous, zend_ce_throwable) == FAILURE) { RETURN_THROWS(); } @@ -361,15 +360,18 @@ ZEND_METHOD(ErrorException, __construct) ZVAL_LONG(&tmp, severity); zend_update_property_ex(zend_ce_exception, Z_OBJ_P(object), ZSTR_KNOWN(ZEND_STR_SEVERITY), &tmp); - if (argc >= 4) { + if (filename) { ZVAL_STR_COPY(&tmp, filename); zend_update_property_ex(zend_ce_exception, Z_OBJ_P(object), ZSTR_KNOWN(ZEND_STR_FILE), &tmp); zval_ptr_dtor(&tmp); - if (argc < 5) { - lineno = 0; /* invalidate lineno */ - } + } + + if (!lineno_is_null) { ZVAL_LONG(&tmp, lineno); zend_update_property_ex(zend_ce_exception, Z_OBJ_P(object), ZSTR_KNOWN(ZEND_STR_LINE), &tmp); + } else if (filename) { + ZVAL_LONG(&tmp, 0); + zend_update_property_ex(zend_ce_exception, Z_OBJ_P(object), ZSTR_KNOWN(ZEND_STR_LINE), &tmp); } } /* }}} */ @@ -834,16 +836,14 @@ static zend_object *zend_throw_exception_zstr(zend_class_entry *exception_ce, ze { zval ex, tmp; - if (exception_ce) { - if (!instanceof_function(exception_ce, zend_ce_throwable)) { - zend_error(E_NOTICE, "Exceptions must implement Throwable"); - exception_ce = zend_ce_exception; - } - } else { + if (!exception_ce) { exception_ce = zend_ce_exception; } - object_init_ex(&ex, exception_ce); + ZEND_ASSERT(instanceof_function(exception_ce, zend_ce_throwable) + && "Exceptions must implement Throwable"); + + object_init_ex(&ex, exception_ce); if (message) { ZVAL_STR(&tmp, message); diff --git a/Zend/zend_exceptions.stub.php b/Zend/zend_exceptions.stub.php index 9cf55fd38404e..f22fb3eae5497 100644 --- a/Zend/zend_exceptions.stub.php +++ b/Zend/zend_exceptions.stub.php @@ -24,7 +24,7 @@ class Exception implements Throwable { final private function __clone() {} - public function __construct(string $message = UNKNOWN, int $code = 0, ?Throwable $previous = null) {} + public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {} public function __wakeup() {} @@ -48,47 +48,47 @@ public function __toString(): string {} class ErrorException extends Exception { - public function __construct(string $message = UNKNOWN, int $code = 0, int $severity = E_ERROR, string $filename = UNKNOWN, int $lineno = 0, ?Throwable $previous = null) {} + public function __construct(string $message = "", int $code = 0, int $severity = E_ERROR, ?string $filename = null, ?int $line = null, ?Throwable $previous = null) {} final public function getSeverity(): int {} } class Error implements Throwable { - /** @alias Exception::__clone */ + /** @implementation-alias Exception::__clone */ final private function __clone() {} - /** @alias Exception::__construct */ - public function __construct(string $message = UNKNOWN, int $code = 0, ?Throwable $previous = null) {} + /** @implementation-alias Exception::__construct */ + public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {} - /** @alias Exception::__wakeup */ + /** @implementation-alias Exception::__wakeup */ public function __wakeup() {} - /** @alias Exception::getMessage */ + /** @implementation-alias Exception::getMessage */ final public function getMessage(): string {} /** * @return int - * @alias Exception::getCode + * @implementation-alias Exception::getCode */ final public function getCode() {} - /** @alias Exception::getFile */ + /** @implementation-alias Exception::getFile */ final public function getFile(): string {} - /** @alias Exception::getLine */ + /** @implementation-alias Exception::getLine */ final public function getLine(): int {} - /** @alias Exception::getTrace */ + /** @implementation-alias Exception::getTrace */ final public function getTrace(): array {} - /** @alias Exception::getPrevious */ + /** @implementation-alias Exception::getPrevious */ final public function getPrevious(): ?Throwable {} - /** @alias Exception::getTraceAsString */ + /** @implementation-alias Exception::getTraceAsString */ final public function getTraceAsString(): string {} - /** @alias Exception::__toString */ + /** @implementation-alias Exception::__toString */ public function __toString(): string {} } diff --git a/Zend/zend_exceptions_arginfo.h b/Zend/zend_exceptions_arginfo.h index 6a226954a0c8c..e8ea0a59a8a05 100644 --- a/Zend/zend_exceptions_arginfo.h +++ b/Zend/zend_exceptions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7eb20393f4ca314324d9813983124f724189ce8a */ + * Stub hash: bc49b326136997660887b12f0c59f8a57b17ecaf */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -23,7 +23,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_Exception___clone arginfo_class_Throwable_getCode ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Exception___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_LONG, 0, "0") ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, previous, Throwable, 1, "null") ZEND_END_ARG_INFO() @@ -47,11 +47,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_Exception___toString arginfo_class_Throwable_getMessage ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ErrorException___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, severity, IS_LONG, 0, "E_ERROR") - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lineno, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, line, IS_LONG, 1, "null") ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, previous, Throwable, 1, "null") ZEND_END_ARG_INFO() diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 1741182ba3be0..4d4b1ffe09b41 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -41,6 +41,13 @@ zend_result zend_load_extension(const char *path) #endif return FAILURE; } +#ifdef ZEND_WIN32 + char *err; + if (!php_win32_image_compatible(handle, &err)) { + zend_error(E_CORE_WARNING, err); + return FAILURE; + } +#endif return zend_load_extension_handle(handle, path); #else fprintf(stderr, "Extensions are not supported on this platform.\n"); diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index 708a1fe02a465..9f96d3b0fadba 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -44,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi /* The first number is the engine version and the rest is the date (YYYYMMDD). * This way engine 2/3 API no. is always greater than engine 1 API no.. */ -#define ZEND_EXTENSION_API_NO 420200804 +#define ZEND_EXTENSION_API_NO 420200930 typedef struct _zend_extension_version_info { int zend_extension_api_no; diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 1278f08209d67..0d5af66d92354 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -153,19 +153,7 @@ ZEND_API void zend_user_it_get_current_key(zend_object_iterator *_iter, zval *ke { zend_user_iterator *iter = (zend_user_iterator*)_iter; zval *object = &iter->it.data; - zval retval; - - zend_call_method_with_0_params(Z_OBJ_P(object), iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", &retval); - - if (Z_TYPE(retval) != IS_UNDEF) { - ZVAL_COPY_VALUE(key, &retval); - } else { - if (!EG(exception)) { - zend_error(E_WARNING, "Nothing returned from %s::key()", ZSTR_VAL(iter->ce->name)); - } - - ZVAL_LONG(key, 0); - } + zend_call_method_with_0_params(Z_OBJ_P(object), iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", key); } /* }}} */ diff --git a/Zend/zend_list.c b/Zend/zend_list.c index 45ff950b6bfec..bacdd739e6f2e 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -66,12 +66,10 @@ static void zend_resource_dtor(zend_resource *res) res->ptr = NULL; ld = zend_hash_index_find_ptr(&list_destructors, r.type); - if (ld) { - if (ld->list_dtor_ex) { - ld->list_dtor_ex(&r); - } - } else { - zend_error(E_WARNING, "Unknown list entry type (%d)", r.type); + ZEND_ASSERT(ld && "Unknown list entry type"); + + if (ld->list_dtor_ex) { + ld->list_dtor_ex(&r); } } @@ -191,12 +189,10 @@ void plist_entry_destructor(zval *zv) zend_rsrc_list_dtors_entry *ld; ld = zend_hash_index_find_ptr(&list_destructors, res->type); - if (ld) { - if (ld->plist_dtor_ex) { - ld->plist_dtor_ex(res); - } - } else { - zend_error(E_WARNING,"Unknown list entry type (%d)", res->type); + ZEND_ASSERT(ld && "Unknown list entry type"); + + if (ld->plist_dtor_ex) { + ld->plist_dtor_ex(res); } } free(res); diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index ccd77f9eb68fe..30d70bbf53247 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -31,7 +31,7 @@ #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module -#define ZEND_MODULE_API_NO 20200804 +#define ZEND_MODULE_API_NO 20200930 #ifdef ZTS #define USING_ZTS 1 #else diff --git a/Zend/zend_observer.c b/Zend/zend_observer.c index 68cf43ce66248..9c2d1cdf51c4e 100644 --- a/Zend/zend_observer.c +++ b/Zend/zend_observer.c @@ -89,9 +89,10 @@ ZEND_API void zend_observer_shutdown(void) { zend_llist_destroy(&zend_observer_error_callbacks); } -static void zend_observer_fcall_install(zend_function *function) { +static void zend_observer_fcall_install(zend_execute_data *execute_data) { zend_llist_element *element; zend_llist *list = &zend_observers_fcall_list; + zend_function *function = execute_data->func; zend_op_array *op_array = &function->op_array; if (fcall_handlers_arena == NULL) { @@ -105,7 +106,7 @@ static void zend_observer_fcall_install(zend_function *function) { for (element = list->head; element; element = element->next) { zend_observer_fcall_init init; memcpy(&init, element->data, sizeof init); - zend_observer_fcall_handlers handlers = init(function); + zend_observer_fcall_handlers handlers = init(execute_data); if (handlers.begin || handlers.end) { zend_llist_add_element(&handlers_list, &handlers); } @@ -150,7 +151,7 @@ static void ZEND_FASTCALL _zend_observe_fcall_begin(zend_execute_data *execute_d fcall_data = ZEND_OBSERVER_DATA(op_array); if (!fcall_data) { - zend_observer_fcall_install((zend_function *)op_array); + zend_observer_fcall_install(execute_data); fcall_data = ZEND_OBSERVER_DATA(op_array); } diff --git a/Zend/zend_observer.h b/Zend/zend_observer.h index 246a3a61be379..1d20306a17018 100644 --- a/Zend/zend_observer.h +++ b/Zend/zend_observer.h @@ -50,7 +50,7 @@ typedef struct _zend_observer_fcall_handlers { } zend_observer_fcall_handlers; /* If the fn should not be observed then return {NULL, NULL} */ -typedef zend_observer_fcall_handlers (*zend_observer_fcall_init)(zend_function *func); +typedef zend_observer_fcall_handlers (*zend_observer_fcall_init)(zend_execute_data *execute_data); // Call during minit/startup ONLY ZEND_API void zend_observer_fcall_register(zend_observer_fcall_init); diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 0923741723d48..5f9dbe3d3ce01 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -142,7 +142,7 @@ ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len) /* { #define convert_object_to_type(op, dst, ctype) \ ZVAL_UNDEF(dst); \ if (Z_OBJ_HT_P(op)->cast_object(Z_OBJ_P(op), dst, ctype) == FAILURE) { \ - zend_error(E_NOTICE, \ + zend_error(E_WARNING, \ "Object of class %s could not be converted to %s", ZSTR_VAL(Z_OBJCE_P(op)->name),\ zend_get_type_by_const(ctype)); \ } \ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 510595b7c8668..1c06bb42e91c0 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -8883,6 +8883,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) SAVE_OPLINE(); op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); + while (1) { if (Z_TYPE_P(op1) == IS_ARRAY) { count = zend_array_count(Z_ARRVAL_P(op1)); @@ -8911,20 +8912,15 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) break; } - /* If There's no handler and it doesn't implement Countable then add a warning */ - count = 1; + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ } else if ((OP1_TYPE & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { op1 = Z_REFVAL_P(op1); continue; - } else if (Z_TYPE_P(op1) <= IS_NULL) { - if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP1(); - } - count = 0; - } else { - count = 1; + } else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); } - zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); + count = 0; + zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -8940,9 +8936,9 @@ ZEND_VM_COLD_CONST_HANDLER(191, ZEND_GET_CLASS, UNUSED|CONST|TMPVAR|CV, UNUSED) if (OP1_TYPE == IS_UNUSED) { if (UNEXPECTED(!EX(func)->common.scope)) { SAVE_OPLINE(); - zend_error(E_WARNING, "get_class() called without object from outside a class"); - ZVAL_FALSE(EX_VAR(opline->result.var)); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } else { ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); ZEND_VM_NEXT_OPCODE(); @@ -8981,12 +8977,11 @@ ZEND_VM_HANDLER(192, ZEND_GET_CALLED_CLASS, UNUSED, UNUSED) } else if (Z_CE(EX(This))) { ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_CE(EX(This))->name); } else { - ZVAL_FALSE(EX_VAR(opline->result.var)); - if (UNEXPECTED(!EX(func)->common.scope)) { - SAVE_OPLINE(); - zend_error(E_WARNING, "get_called_class() called from outside a class"); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); - } + ZEND_ASSERT(!EX(func)->common.scope); + SAVE_OPLINE(); + zend_throw_error(NULL, "get_called_class() must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index f59c923bd1613..f43fc024b9c31 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -10324,6 +10324,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_ SAVE_OPLINE(); op1 = RT_CONSTANT(opline, opline->op1); + while (1) { if (Z_TYPE_P(op1) == IS_ARRAY) { count = zend_array_count(Z_ARRVAL_P(op1)); @@ -10352,20 +10353,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_ break; } - /* If There's no handler and it doesn't implement Countable then add a warning */ - count = 1; + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ } else if ((IS_CONST & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { op1 = Z_REFVAL_P(op1); continue; - } else if (Z_TYPE_P(op1) <= IS_NULL) { - if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP1(); - } - count = 0; - } else { - count = 1; + } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); } - zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); + count = 0; + zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -10381,9 +10377,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CO if (IS_CONST == IS_UNUSED) { if (UNEXPECTED(!EX(func)->common.scope)) { SAVE_OPLINE(); - zend_error(E_WARNING, "get_class() called without object from outside a class"); - ZVAL_FALSE(EX_VAR(opline->result.var)); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } else { ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); ZEND_VM_NEXT_OPCODE(); @@ -17567,6 +17563,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL SAVE_OPLINE(); op1 = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC); + while (1) { if (Z_TYPE_P(op1) == IS_ARRAY) { count = zend_array_count(Z_ARRVAL_P(op1)); @@ -17595,20 +17592,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL break; } - /* If There's no handler and it doesn't implement Countable then add a warning */ - count = 1; + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { op1 = Z_REFVAL_P(op1); continue; - } else if (Z_TYPE_P(op1) <= IS_NULL) { - if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP1(); - } - count = 0; - } else { - count = 1; + } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); } - zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); + count = 0; + zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -17624,9 +17616,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_H if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED) { if (UNEXPECTED(!EX(func)->common.scope)) { SAVE_OPLINE(); - zend_error(E_WARNING, "get_class() called without object from outside a class"); - ZVAL_FALSE(EX_VAR(opline->result.var)); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } else { ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); ZEND_VM_NEXT_OPCODE(); @@ -35225,9 +35217,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_UNUSED_UNUSED_H if (IS_UNUSED == IS_UNUSED) { if (UNEXPECTED(!EX(func)->common.scope)) { SAVE_OPLINE(); - zend_error(E_WARNING, "get_class() called without object from outside a class"); - ZVAL_FALSE(EX_VAR(opline->result.var)); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } else { ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); ZEND_VM_NEXT_OPCODE(); @@ -35266,12 +35258,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CALLED_CLASS_SPEC_UNUSED_U } else if (Z_CE(EX(This))) { ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_CE(EX(This))->name); } else { - ZVAL_FALSE(EX_VAR(opline->result.var)); - if (UNEXPECTED(!EX(func)->common.scope)) { - SAVE_OPLINE(); - zend_error(E_WARNING, "get_called_class() called from outside a class"); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); - } + ZEND_ASSERT(!EX(func)->common.scope); + SAVE_OPLINE(); + zend_throw_error(NULL, "get_called_class() must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); } @@ -47328,6 +47319,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z SAVE_OPLINE(); op1 = EX_VAR(opline->op1.var); + while (1) { if (Z_TYPE_P(op1) == IS_ARRAY) { count = zend_array_count(Z_ARRVAL_P(op1)); @@ -47356,20 +47348,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z break; } - /* If There's no handler and it doesn't implement Countable then add a warning */ - count = 1; + /* If There's no handler and it doesn't implement Countable then emit a TypeError */ } else if ((IS_CV & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) { op1 = Z_REFVAL_P(op1); continue; - } else if (Z_TYPE_P(op1) <= IS_NULL) { - if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP1(); - } - count = 0; - } else { - count = 1; + } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP1(); } - zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); + count = 0; + zend_type_error("%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -47385,9 +47372,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDL if (IS_CV == IS_UNUSED) { if (UNEXPECTED(!EX(func)->common.scope)) { SAVE_OPLINE(); - zend_error(E_WARNING, "get_class() called without object from outside a class"); - ZVAL_FALSE(EX_VAR(opline->result.var)); - ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); + zend_throw_error(NULL, "get_class() without arguments must be called from within a class"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); } else { ZVAL_STR_COPY(EX_VAR(opline->result.var), EX(func)->common.scope->name); ZEND_VM_NEXT_OPCODE(); diff --git a/build/gen_stub.php b/build/gen_stub.php index de2d3b144b06d..bd8b33759fcdb 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -12,7 +12,7 @@ error_reporting(E_ALL); -function processDirectory(string $dir, bool $forceRegeneration) { +function processDirectory(string $dir, Context $context) { $it = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY @@ -20,12 +20,12 @@ function processDirectory(string $dir, bool $forceRegeneration) { foreach ($it as $file) { $pathName = $file->getPathName(); if (preg_match('/\.stub\.php$/', $pathName)) { - processStubFile($pathName, $forceRegeneration); + processStubFile($pathName, $context); } } } -function processStubFile(string $stubFile, bool $forceRegeneration) { +function processStubFile(string $stubFile, Context $context) { try { if (!file_exists($stubFile)) { throw new Exception("File $stubFile does not exist"); @@ -35,7 +35,7 @@ function processStubFile(string $stubFile, bool $forceRegeneration) { $stubCode = file_get_contents($stubFile); $stubHash = computeStubHash($stubCode); $oldStubHash = extractStubHash($arginfoFile); - if ($stubHash === $oldStubHash && $forceRegeneration === false) { + if ($stubHash === $oldStubHash && $context->forceRegeneration === false) { /* Stub file did not change, do not regenerate. */ return; } @@ -44,6 +44,16 @@ function processStubFile(string $stubFile, bool $forceRegeneration) { $fileInfo = parseStubFile($stubCode); $arginfoCode = generateArgInfoCode($fileInfo, $stubHash); file_put_contents($arginfoFile, $arginfoCode); + + // Collect parameter name statistics. + foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { + foreach ($funcInfo->args as $argInfo) { + if (!isset($context->parameterStats[$argInfo->name])) { + $context->parameterStats[$argInfo->name] = 0; + } + $context->parameterStats[$argInfo->name]++; + } + } } catch (Exception $e) { echo "In $stubFile:\n{$e->getMessage()}\n"; exit(1); @@ -67,6 +77,13 @@ function extractStubHash(string $arginfoFile): ?string { return $matches[1]; } +class Context { + /** @var bool */ + public $forceRegeneration = false; + /** @var array */ + public $parameterStats = []; +} + class SimpleType { /** @var string */ public $name; @@ -362,6 +379,8 @@ class FuncInfo { public $name; /** @var int */ public $flags; + /** @var string|null */ + public $aliasType; /** @var FunctionName|null */ public $alias; /** @var bool */ @@ -378,6 +397,7 @@ class FuncInfo { public function __construct( FunctionName $name, int $flags, + ?string $aliasType, ?FunctionName $alias, bool $isDeprecated, array $args, @@ -387,6 +407,7 @@ public function __construct( ) { $this->name = $name; $this->flags = $flags; + $this->aliasType = $aliasType; $this->alias = $alias; $this->isDeprecated = $isDeprecated; $this->args = $args; @@ -617,6 +638,7 @@ function parseFunctionLike( ): FuncInfo { $comment = $func->getDocComment(); $paramMeta = []; + $aliasType = null; $alias = null; $isDeprecated = false; $haveDocReturnType = false; @@ -631,7 +653,8 @@ function parseFunctionLike( $paramMeta[$varName] = []; } $paramMeta[$varName]['preferRef'] = true; - } else if ($tag->name === 'alias') { + } else if ($tag->name === 'alias' || $tag->name === 'implementation-alias') { + $aliasType = $tag->name; $aliasParts = explode("::", $tag->getValue()); if (count($aliasParts) === 1) { $alias = new FunctionName(null, $aliasParts[0]); @@ -721,6 +744,7 @@ function parseFunctionLike( return new FuncInfo( $name, $flags, + $aliasType, $alias, $isDeprecated, $args, @@ -1124,16 +1148,25 @@ function initPhpParser() { } $optind = null; -$options = getopt("f", ["force-regeneration"], $optind); -$forceRegeneration = isset($options["f"]) || isset($options["force-regeneration"]); -$location = $argv[$optind] ?? "."; +$options = getopt("f", ["force-regeneration", "parameter-stats"], $optind); + +$context = new Context; +$printParameterStats = isset($options["parameter-stats"]); +$context->forceRegeneration = + isset($options["f"]) || isset($options["force-regeneration"]) || $printParameterStats; +$location = $argv[$optind] ?? "."; if (is_file($location)) { // Generate single file. - processStubFile($location, $forceRegeneration); + processStubFile($location, $context); } else if (is_dir($location)) { - processDirectory($location, $forceRegeneration); + processDirectory($location, $context); } else { echo "$location is neither a file nor a directory.\n"; exit(1); } + +if ($printParameterStats) { + arsort($context->parameterStats); + echo json_encode($context->parameterStats, JSON_PRETTY_PRINT), "\n"; +} diff --git a/build/php.m4 b/build/php.m4 index 1f77f38e572f2..b4cf3edcf3fda 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -218,7 +218,7 @@ ifelse($1,shared,[ ]) dnl -dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]]) +dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared]]]) dnl dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the name of the dnl array target-var directly, as well as whether shared objects will be built @@ -251,10 +251,10 @@ dnl Append to the array which has been dynamically chosen at m4 time. dnl Choose the right compiler/flags/etc. for the source-file. case $ac_src in - *.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; - *.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; - *.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;; - *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;; + *.c[)] ac_comp="$b_c_pre $ac_inc $b_c_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.s[)] ac_comp="$b_c_pre $ac_inc $b_c_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.S[)] ac_comp="$b_c_pre $ac_inc $b_c_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;; + *.cpp|*.cc|*.cxx[)] ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta $3 -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;; esac dnl Create a rule for the object/source combo. diff --git a/ext/bcmath/bcmath.stub.php b/ext/bcmath/bcmath.stub.php index 97232b0ed7121..acd63f000e79c 100644 --- a/ext/bcmath/bcmath.stub.php +++ b/ext/bcmath/bcmath.stub.php @@ -2,22 +2,22 @@ /** @generate-function-entries */ -function bcadd(string $left_operand, string $right_operand, ?int $scale = null): string {} +function bcadd(string $num1, string $num2, ?int $scale = null): string {} -function bcsub(string $left_operand, string $right_operand, ?int $scale = null): string {} +function bcsub(string $num1, string $num2, ?int $scale = null): string {} -function bcmul(string $left_operand, string $right_operand, ?int $scale = null): string {} +function bcmul(string $num1, string $num2, ?int $scale = null): string {} -function bcdiv(string $dividend, string $divisor, ?int $scale = null): string {} +function bcdiv(string $num1, string $num2, ?int $scale = null): string {} -function bcmod(string $dividend, string $divisor, ?int $scale = null): string {} +function bcmod(string $num1, string $num2, ?int $scale = null): string {} -function bcpowmod(string $base, string $exponent, string $modulus, ?int $scale = null): string {} +function bcpowmod(string $num, string $exponent, string $modulus, ?int $scale = null): string {} -function bcpow(string $base, string $exponent, ?int $scale = null): string {} +function bcpow(string $num, string $exponent, ?int $scale = null): string {} -function bcsqrt(string $operand, ?int $scale = null): string {} +function bcsqrt(string $num, ?int $scale = null): string {} -function bccomp(string $left_operand, string $right_operand, ?int $scale = null): int {} +function bccomp(string $num1, string $num2, ?int $scale = null): int {} function bcscale(?int $scale = null): int {} diff --git a/ext/bcmath/bcmath_arginfo.h b/ext/bcmath/bcmath_arginfo.h index 83956366a2822..3e0104e04c358 100644 --- a/ext/bcmath/bcmath_arginfo.h +++ b/ext/bcmath/bcmath_arginfo.h @@ -1,9 +1,9 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a1e223f29a06a2292a88c0e90e104cb956f80500 */ + * Stub hash: 0c1e2a6163a5fc0f42bf79bbc530af7c5fd77074 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcadd, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, left_operand, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, right_operand, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num2, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null") ZEND_END_ARG_INFO() @@ -11,35 +11,31 @@ ZEND_END_ARG_INFO() #define arginfo_bcmul arginfo_bcadd -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcdiv, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, dividend, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, divisor, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null") -ZEND_END_ARG_INFO() +#define arginfo_bcdiv arginfo_bcadd -#define arginfo_bcmod arginfo_bcdiv +#define arginfo_bcmod arginfo_bcadd ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcpowmod, 0, 3, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, base, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, exponent, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, modulus, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcpow, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, base, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, exponent, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bcsqrt, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, operand, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bccomp, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, left_operand, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, right_operand, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, num2, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, scale, IS_LONG, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/bcmath/tests/bcsqrt_error1.phpt b/ext/bcmath/tests/bcsqrt_error1.phpt index 83c85183f4080..bdc850f979627 100644 --- a/ext/bcmath/tests/bcsqrt_error1.phpt +++ b/ext/bcmath/tests/bcsqrt_error1.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -bcsqrt(): Argument #1 ($operand) must be greater than or equal to 0 +bcsqrt(): Argument #1 ($num) must be greater than or equal to 0 diff --git a/ext/bcmath/tests/bug75178.phpt b/ext/bcmath/tests/bug75178.phpt index 48044523840cf..9025e61c73bf7 100644 --- a/ext/bcmath/tests/bug75178.phpt +++ b/ext/bcmath/tests/bug75178.phpt @@ -18,5 +18,5 @@ try { } ?> --EXPECT-- -bcpowmod(): Argument #1 ($base) cannot have a fractional part +bcpowmod(): Argument #1 ($num) cannot have a fractional part bcpowmod(): Argument #3 ($modulus) cannot have a fractional part diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt index 9a7f7f0855091..3ff0aedeb5b82 100644 --- a/ext/bz2/tests/002.phpt +++ b/ext/bz2/tests/002.phpt @@ -90,10 +90,10 @@ bool(false) resource(%d) of type (stream) resource(%d) of type (stream) -Warning: fopen(bz_open_002.txt): Failed to open stream: Bad file %s in %s on line %d +Warning: fopen(bz_open_002.txt): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d bzopen(): Argument #1 ($file) must be of type string or file-resource, bool given -Warning: fopen(bz_open_002.txt): Failed to open stream: Bad file %s in %s on line %d +Warning: fopen(bz_open_002.txt): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d bzopen(): Argument #1 ($file) must be of type string or file-resource, bool given Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 45080ba39590a..3282bd9e5043c 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -746,7 +746,8 @@ PHP_FUNCTION(com_event_sink) /* {{{ Print out a PHP class definition for a dispatchable interface */ PHP_FUNCTION(com_print_typeinfo) { - zval *arg1; + zend_object *object_zpp; + zend_string *typelib_name_zpp = NULL; char *ifacename = NULL; char *typelibname = NULL; size_t ifacelen; @@ -754,17 +755,18 @@ PHP_FUNCTION(com_print_typeinfo) php_com_dotnet_object *obj = NULL; ITypeInfo *typeinfo; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z/|s!b", &arg1, &ifacename, - &ifacelen, &wantsink)) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_OBJ_OF_CLASS_OR_STR(object_zpp, php_com_variant_class_entry, typelib_name_zpp) + Z_PARAM_OPTIONAL + Z_PARAM_STRING_OR_NULL(ifacename, ifacelen) + Z_PARAM_BOOL(wantsink) + ZEND_PARSE_PARAMETERS_END(); php_com_initialize(); - if (Z_TYPE_P(arg1) == IS_OBJECT) { - CDNO_FETCH_VERIFY(obj, arg1); + if (object_zpp) { + obj = (php_com_dotnet_object*)object_zpp; } else { - convert_to_string(arg1); - typelibname = Z_STRVAL_P(arg1); + typelibname = ZSTR_VAL(typelib_name_zpp); } typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0); @@ -772,9 +774,9 @@ PHP_FUNCTION(com_print_typeinfo) php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page)); ITypeInfo_Release(typeinfo); RETURN_TRUE; - } else { - zend_error(E_WARNING, "Unable to find typeinfo using the parameters supplied"); } + + php_error_docref(NULL, E_WARNING, "Unable to find typeinfo using the parameters supplied"); RETURN_FALSE; } /* }}} */ diff --git a/ext/com_dotnet/com_extension.stub.php b/ext/com_dotnet/com_extension.stub.php index 9b1edf9d38d23..7d451e5baf525 100644 --- a/ext/com_dotnet/com_extension.stub.php +++ b/ext/com_dotnet/com_extension.stub.php @@ -46,7 +46,7 @@ function variant_cmp(mixed $left, mixed $right, int $lcid = LOCALE_SYSTEM_DEFAUL function variant_date_to_timestamp(variant $variant): ?int {} -function variant_date_from_timestamp(int $timestamp): variant|false {} +function variant_date_from_timestamp(int $timestamp): variant {} function variant_get_type(variant $variant): int {} diff --git a/ext/com_dotnet/com_extension_arginfo.h b/ext/com_dotnet/com_extension_arginfo.h index 3e583c321108b..074cb8575006d 100644 --- a/ext/com_dotnet/com_extension_arginfo.h +++ b/ext/com_dotnet/com_extension_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: f78e9db58131f9d67021eaea4c3d4be75cafe2ac */ + * Stub hash: 637bee9d71fb0d566ce38004eec8bc6f75656837 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, variant, variant, 0) @@ -63,7 +63,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_date_to_timestamp, 0, 1, ZEND_ARG_OBJ_INFO(0, variant, variant, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_variant_date_from_timestamp, 0, 1, variant, MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_variant_date_from_timestamp, 0, 1, variant, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 4ff80d96e9292..fb4af4efec2c4 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -203,18 +203,19 @@ static int com_property_exists(zend_object *object, zend_string *member, int che static int com_dimension_exists(zend_object *object, zval *member, int check_empty) { - php_error_docref(NULL, E_WARNING, "Operation not yet supported on a COM object"); + /* TODO Add support */ + zend_throw_error(NULL, "Cannot check dimension on a COM object"); return 0; } static void com_property_delete(zend_object *object, zend_string *member, void **cache_slot) { - php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object"); + zend_throw_error(NULL, "Cannot delete properties from a COM object"); } static void com_dimension_delete(zend_object *object, zval *offset) { - php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object"); + zend_throw_error(NULL, "Cannot delete dimension from a COM object"); } static HashTable *com_properties_get(zend_object *object) diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c index 6126e958d5a4d..66f885a9056ca 100644 --- a/ext/com_dotnet/com_iterator.c +++ b/ext/com_dotnet/com_iterator.c @@ -149,6 +149,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b obj = CDNO_FETCH(object); if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) { + /* TODO Promote to TypeError? */ php_error_docref(NULL, E_WARNING, "Variant is not an object or array VT=%d", V_VT(&obj->v)); return NULL; } @@ -172,6 +173,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b dims = SafeArrayGetDim(V_ARRAY(&obj->v)); if (dims != 1) { + /* TODO Promote to ValueError? */ php_error_docref(NULL, E_WARNING, "Can only handle single dimension variant arrays (this array has %d)", dims); goto fail; diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c index 24230761c167f..7f1ee3562de66 100644 --- a/ext/com_dotnet/com_misc.c +++ b/ext/com_dotnet/com_misc.c @@ -105,6 +105,7 @@ PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, dims = SafeArrayGetDim(V_ARRAY(array)); if (dims != 1) { + /* TODO Promote to ValueError? */ php_error_docref(NULL, E_WARNING, "Can only handle single dimension variant arrays (this array has %d)", dims); return 0; diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index 56f7fc684653f..a138f796c3798 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -288,18 +288,19 @@ static int saproxy_property_exists(zend_object *object, zend_string *member, int static int saproxy_dimension_exists(zend_object *object, zval *member, int check_empty) { - php_error_docref(NULL, E_WARNING, "Operation not yet supported on a COM object"); + /* TODO Add support */ + zend_throw_error(NULL, "Cannot check dimension on a COM object"); return 0; } static void saproxy_property_delete(zend_object *object, zend_string *member, void **cache_slot) { - php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object"); + zend_throw_error(NULL, "Cannot delete properties from a COM object"); } static void saproxy_dimension_delete(zend_object *object, zval *offset) { - php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object"); + zend_throw_error(NULL, "Cannot delete dimension from a COM object"); } static HashTable *saproxy_properties_get(zend_object *object) diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 4112b0ce06902..a036526d8bed6 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -633,7 +633,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri ret = 1; } else { - zend_error(E_WARNING, "That's not a dispatchable interface!! type kind = %08x", attr->typekind); + zend_throw_error(NULL, "Type kind must be dispatchable, %08x given", attr->typekind); } ITypeInfo_ReleaseTypeAttr(typeinfo, attr); diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 949f3ca1dd5b4..1acae5242412a 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -964,8 +964,8 @@ PHP_FUNCTION(variant_date_from_timestamp) } if (timestamp < 0) { - php_error_docref(NULL, E_WARNING, "Timestamp value must be a positive value."); - RETURN_FALSE; + zend_argument_value_error(1, "must be greater than or equal to 0"); + RETURN_THROWS(); } VariantInit(&res); @@ -975,8 +975,8 @@ PHP_FUNCTION(variant_date_from_timestamp) /* Invalid after 23:59:59, December 31, 3000, UTC */ if (!tmv) { - php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp); - RETURN_FALSE; + zend_argument_value_error(1, "must not go past 23:59:59, December 31, 3000, UTC"); + RETURN_THROWS(); } memset(&systime, 0, sizeof(systime)); diff --git a/ext/com_dotnet/tests/bug72498.phpt b/ext/com_dotnet/tests/bug72498.phpt index e43251bd3c747..b9bd498af31a2 100644 --- a/ext/com_dotnet/tests/bug72498.phpt +++ b/ext/com_dotnet/tests/bug72498.phpt @@ -8,8 +8,12 @@ if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: variant_date_from_timestamp(): Invalid timestamp %d in %sbug72498.php on line %d -bool(false) +--EXPECT-- +variant_date_from_timestamp(): Argument #1 ($timestamp) must not go past 23:59:59, December 31, 3000, UTC diff --git a/ext/curl/curl.stub.php b/ext/curl/curl.stub.php index c2951b1c6aa31..2eba460d6c66a 100644 --- a/ext/curl/curl.stub.php +++ b/ext/curl/curl.stub.php @@ -33,7 +33,7 @@ function curl_multi_setopt(CurlMultiHandle $multi_handle, int $option, mixed $va function curl_exec(CurlHandle $handle): string|bool {} -function curl_file_create(string $filename, ?string $mimetype = null, ?string $postname = null): CURLFile {} +function curl_file_create(string $filename, ?string $mime_type = null, ?string $posted_filename = null): CURLFile {} function curl_getinfo(CurlHandle $handle, ?int $option = null): mixed {} @@ -50,8 +50,8 @@ function curl_multi_exec(CurlMultiHandle $multi_handle, &$still_running): int {} function curl_multi_getcontent(CurlHandle $multi_handle): ?string {} -/** @param int|null $msgs_in_queue */ -function curl_multi_info_read(CurlMultiHandle $multi_handle, &$msgs_in_queue = null): array|false {} +/** @param int $queued_messages */ +function curl_multi_info_read(CurlMultiHandle $multi_handle, &$queued_messages = null): array|false {} function curl_multi_init(): CurlMultiHandle {} @@ -59,10 +59,10 @@ function curl_multi_remove_handle(CurlMultiHandle $multi_handle, CurlHandle $han function curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0): int {} -function curl_multi_strerror(int $error_number): ?string {} +function curl_multi_strerror(int $error_code): ?string {} #if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */ -function curl_pause(CurlHandle $handle, int $bitmask): int {} +function curl_pause(CurlHandle $handle, int $flags): int {} #endif function curl_reset(CurlHandle $handle): void {} @@ -79,8 +79,8 @@ function curl_share_init(): CurlShareHandle {} function curl_share_setopt(CurlShareHandle $share_handle, int $option, mixed $value): bool {} -function curl_share_strerror(int $error_number): ?string {} +function curl_share_strerror(int $error_code): ?string {} -function curl_strerror(int $error_number): ?string {} +function curl_strerror(int $error_code): ?string {} function curl_version(): array|false {} diff --git a/ext/curl/curl_arginfo.h b/ext/curl/curl_arginfo.h index 30f2e839a815a..e213f9d3184e7 100644 --- a/ext/curl/curl_arginfo.h +++ b/ext/curl/curl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ca65615cacfe914f3511007fd393169ffededf34 */ + * Stub hash: afeae538b49eb43a661e5b491da79c17d10c6bfe */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0) @@ -42,8 +42,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_curl_file_create, 0, 1, CURLFile, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mimetype, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, postname, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mime_type, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, posted_filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_getinfo, 0, 1, IS_MIXED, 0) @@ -79,7 +79,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_curl_multi_info_read, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, multi_handle, CurlMultiHandle, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, msgs_in_queue, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, queued_messages, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_curl_multi_init, 0, 0, CurlMultiHandle, 0) @@ -93,13 +93,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_select, 0, 1, IS_LONG ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_multi_strerror, 0, 1, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, error_number, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0) ZEND_END_ARG_INFO() #if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_pause, 0, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0) - ZEND_ARG_TYPE_INFO(0, bitmask, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/curl/curl_file.stub.php b/ext/curl/curl_file.stub.php index 14d775d293776..28a218c69836f 100644 --- a/ext/curl/curl_file.stub.php +++ b/ext/curl/curl_file.stub.php @@ -4,7 +4,7 @@ class CURLFile { - public function __construct(string $filename, ?string $mimetype = null, ?string $postname = null) {} + public function __construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null) {} /** @return string */ public function getFilename() {} @@ -16,8 +16,8 @@ public function getMimeType() {} public function getPostFilename() {} /** @return void */ - public function setMimeType(string $mime) {} + public function setMimeType(string $mime_type) {} /** @return void */ - public function setPostFilename(string $postname) {} + public function setPostFilename(string $posted_filename) {} } diff --git a/ext/curl/curl_file_arginfo.h b/ext/curl/curl_file_arginfo.h index 526bd322f505e..c745d597dab39 100644 --- a/ext/curl/curl_file_arginfo.h +++ b/ext/curl/curl_file_arginfo.h @@ -1,10 +1,10 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2dbca0eed1723e959b2a56d6035239b189f52495 */ + * Stub hash: a81720edab23748f6dce30306f5a5ffc9634da5d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mimetype, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, postname, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mime_type, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, posted_filename, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_getFilename, 0, 0, 0) @@ -15,11 +15,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_CURLFile_getPostFilename arginfo_class_CURLFile_getFilename ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_setMimeType, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mime, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mime_type, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile_setPostFilename, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, postname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, posted_filename, IS_STRING, 0) ZEND_END_ARG_INFO() diff --git a/ext/curl/tests/curl_basic_009.phpt b/ext/curl/tests/curl_basic_009.phpt index 3b36a785409cf..a9aaf4c50f1af 100644 --- a/ext/curl/tests/curl_basic_009.phpt +++ b/ext/curl/tests/curl_basic_009.phpt @@ -7,7 +7,7 @@ TestFest 2009 - AFUP - Perrick Penet --FILE-- ---EXPECTREGEX-- -string\(\d+\) "([^\r\n]*rotocol[^\r\n]+|Could not resolve host: .+)" -int\(\d\) +--EXPECTF-- +string(%d) "%Srotocol%s" +int(1) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 88431a22ea205..8c0f5a62b100c 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -4501,8 +4501,8 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su retformat != SUNFUNCS_RET_STRING && retformat != SUNFUNCS_RET_DOUBLE) { - php_error_docref(NULL, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE"); - RETURN_FALSE; + zend_argument_value_error(2, "must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE"); + RETURN_THROWS(); } altitude = 90 - zenith; diff --git a/ext/date/tests/date_sunrise_and_sunset_error.phpt b/ext/date/tests/date_sunrise_and_sunset_error.phpt new file mode 100644 index 0000000000000..45054390176c6 --- /dev/null +++ b/ext/date/tests/date_sunrise_and_sunset_error.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test error condition of date_sunrise() and date_sunset() +--FILE-- +getMessage() . "\n"; +} + +try { + date_sunset(time(), 4); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} + +?> +--EXPECT-- +date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE +date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE diff --git a/ext/date/tests/microtime_error.phpt b/ext/date/tests/microtime_error.phpt index 32cc64bb9df85..ce13875e67b1a 100644 --- a/ext/date/tests/microtime_error.phpt +++ b/ext/date/tests/microtime_error.phpt @@ -46,11 +46,11 @@ float(%s) int(0) } } -microtime(): Argument #1 ($getAsFloat) must be of type bool, array given +microtime(): Argument #1 ($as_float) must be of type bool, array given --> bad arg: object(stdClass)#%d (0) { } -microtime(): Argument #1 ($getAsFloat) must be of type bool, stdClass given +microtime(): Argument #1 ($as_float) must be of type bool, stdClass given --> bad arg: int(1) float(%s) diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 99178bfe3e9ba..e348f8fc5abaf 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -50,14 +50,14 @@ PHP_METHOD(DOMAttr, __construct) name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { php_dom_throw_error(INVALID_CHARACTER_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } nodep = xmlNewProp(NULL, (xmlChar *) name, (xmlChar *) value); if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } oldnode = dom_object_get_node(intern); diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index ce62377917745..2d6fd8dc05c6c 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -46,7 +46,7 @@ PHP_METHOD(DOMCdataSection, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/comment.c b/ext/dom/comment.c index db2341b72584f..79588f0c87abb 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -46,7 +46,7 @@ PHP_METHOD(DOMComment, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/document.c b/ext/dom/document.c index 6ff1750137187..23bdcae1e0c1a 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -136,7 +136,7 @@ int dom_document_encoding_read(dom_object *obj, zval *retval) return SUCCESS; } -int dom_document_encoding_write(dom_object *obj, zval *newval) +zend_result dom_document_encoding_write(dom_object *obj, zval *newval) { xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj); zend_string *str; @@ -161,7 +161,8 @@ int dom_document_encoding_write(dom_object *obj, zval *newval) } docp->encoding = xmlStrdup((const xmlChar *) ZSTR_VAL(str)); } else { - php_error_docref(NULL, E_WARNING, "Invalid Document Encoding"); + zend_value_error("Invalid document encoding"); + return FAILURE; } zend_string_release_ex(str, 0); @@ -1101,7 +1102,8 @@ PHP_METHOD(DOMDocument, __construct) } intern->document = NULL; if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp) == -1) { - RETURN_FALSE; + /* docp is always non-null so php_libxml_increment_doc_ref() never returns -1 */ + ZEND_UNREACHABLE(); } php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern); } @@ -1195,6 +1197,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so if (mode == DOM_LOAD_FILE) { char *file_dest; if (CHECK_NULL_PATH(source, source_len)) { + zend_value_error("Path to document must not contain any null bytes"); return NULL; } file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN); @@ -1303,8 +1306,8 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { } if (!source_len) { - php_error_docref(NULL, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; + zend_argument_value_error(1, "must not be empty"); + RETURN_THROWS(); } if (ZEND_SIZE_T_INT_OVFL(source_len)) { php_error_docref(NULL, E_WARNING, "Input string is too long"); @@ -1386,8 +1389,8 @@ PHP_METHOD(DOMDocument, save) } if (file_len == 0) { - php_error_docref(NULL, E_WARNING, "Invalid Filename"); - RETURN_FALSE; + zend_argument_value_error(1, "must not be empty"); + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1621,9 +1624,9 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type RETURN_THROWS(); } - if (source_len == 0) { - php_error_docref(NULL, E_WARNING, "Invalid Schema source"); - RETURN_FALSE; + if (!source_len) { + zend_argument_value_error(1, "must not be empty"); + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1631,8 +1634,8 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type switch (type) { case DOM_LOAD_FILE: if (CHECK_NULL_PATH(source, source_len)) { - php_error_docref(NULL, E_WARNING, "Invalid Schema file source"); - RETURN_FALSE; + zend_argument_value_error(1, "must not contain any null bytes"); + RETURN_THROWS(); } valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN); if (!valid_file) { @@ -1722,9 +1725,9 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ RETURN_THROWS(); } - if (source_len == 0) { - php_error_docref(NULL, E_WARNING, "Invalid Schema source"); - RETURN_FALSE; + if (!source_len) { + zend_argument_value_error(1, "must not be empty"); + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1732,8 +1735,8 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ switch (type) { case DOM_LOAD_FILE: if (CHECK_NULL_PATH(source, source_len)) { - php_error_docref(NULL, E_WARNING, "Invalid RelaxNG file source"); - RETURN_FALSE; + zend_argument_value_error(1, "must not contain any null bytes"); + RETURN_THROWS(); } valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN); if (!valid_file) { @@ -1821,8 +1824,8 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ } if (!source_len) { - php_error_docref(NULL, E_WARNING, "Empty string supplied as input"); - RETURN_FALSE; + zend_argument_value_error(1, "must not be empty"); + RETURN_THROWS(); } if (ZEND_LONG_EXCEEDS_INT(options)) { @@ -1832,8 +1835,8 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ if (mode == DOM_LOAD_FILE) { if (CHECK_NULL_PATH(source, source_len)) { - php_error_docref(NULL, E_WARNING, "Invalid file source"); - RETURN_FALSE; + zend_argument_value_error(1, "must not contain any null bytes"); + RETURN_THROWS(); } ctxt = htmlCreateFileParserCtxt(source, NULL); } else { @@ -1928,8 +1931,8 @@ PHP_METHOD(DOMDocument, saveHTMLFile) } if (file_len == 0) { - php_error_docref(NULL, E_WARNING, "Invalid Filename"); - RETURN_FALSE; + zend_argument_value_error(1, "must not be empty"); + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 641c3f5b34d45..051416792d349 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -44,7 +44,7 @@ PHP_METHOD(DOMDocumentFragment, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 86ec4a23684fe..b195af5549c66 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -67,8 +67,8 @@ PHP_METHOD(DOMImplementation, createDocumentType) } if (name_len == 0) { - php_error_docref(NULL, E_WARNING, "qualifiedName is required"); - RETURN_FALSE; + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); } if (publicid_len > 0) { @@ -134,12 +134,12 @@ PHP_METHOD(DOMImplementation, createDocument) if (node != NULL) { DOM_GET_OBJ(doctype, node, xmlDtdPtr, doctobj); if (doctype->type == XML_DOCUMENT_TYPE_NODE) { - php_error_docref(NULL, E_WARNING, "Invalid DocumentType object"); - RETURN_FALSE; + zend_argument_value_error(3, "is an invalid DocumentType object"); + RETURN_THROWS(); } if (doctype->doc != NULL) { php_dom_throw_error(WRONG_DOCUMENT_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } } else { doctobj = NULL; @@ -163,7 +163,7 @@ PHP_METHOD(DOMImplementation, createDocument) xmlFree(localname); } php_dom_throw_error(errorcode, 1); - RETURN_FALSE; + RETURN_THROWS(); } /* currently letting libxml2 set the version string */ @@ -195,9 +195,9 @@ PHP_METHOD(DOMImplementation, createDocument) } xmlFreeDoc(docp); xmlFree(localname); - /* Need some type of error here */ - php_error_docref(NULL, E_WARNING, "Unexpected Error"); - RETURN_FALSE; + /* Need some better type of error here */ + php_dom_throw_error(PHP_ERR, 1); + RETURN_THROWS(); } nodep->nsDef = nsptr; diff --git a/ext/dom/element.c b/ext/dom/element.c index 41bc7296ca875..317619001beea 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -49,7 +49,7 @@ PHP_METHOD(DOMElement, __construct) name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { php_dom_throw_error(INVALID_CHARACTER_ERR, 1); - return; + RETURN_THROWS(); } /* Namespace logic is separate and only when uri passed in to insure no BC breakage */ @@ -71,7 +71,7 @@ PHP_METHOD(DOMElement, __construct) xmlFreeNode(nodep); } php_dom_throw_error(errorcode, 1); - return; + RETURN_THROWS(); } } else { /* If you don't pass a namespace uri, then you can't set a prefix */ @@ -80,14 +80,14 @@ PHP_METHOD(DOMElement, __construct) xmlFree(localname); xmlFree(prefix); php_dom_throw_error(NAMESPACE_ERR, 1); - return; + RETURN_THROWS(); } nodep = xmlNewNode(NULL, (xmlChar *) name); } if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - return; + RETURN_THROWS(); } if (value_len > 0) { @@ -255,14 +255,14 @@ PHP_METHOD(DOMElement, setAttribute) } if (name_len == 0) { - php_error_docref(NULL, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); } name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { php_dom_throw_error(INVALID_CHARACTER_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -294,8 +294,8 @@ PHP_METHOD(DOMElement, setAttribute) attr = (xmlNodePtr)xmlSetProp(nodep, (xmlChar *) name, (xmlChar *)value); } if (!attr) { - php_error_docref(NULL, E_WARNING, "No such attribute '%s'", name); - RETURN_FALSE; + zend_argument_value_error(1, "must be a valid XML attribute"); + RETURN_THROWS(); } DOM_RET_OBJ(attr, &ret, intern); @@ -424,8 +424,8 @@ PHP_METHOD(DOMElement, setAttributeNode) DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); if (attrp->type != XML_ATTRIBUTE_NODE) { - php_error_docref(NULL, E_WARNING, "Attribute node is required"); - RETURN_FALSE; + zend_argument_value_error(1, "must have the node attribute"); + RETURN_THROWS(); } if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) { @@ -628,8 +628,8 @@ PHP_METHOD(DOMElement, setAttributeNS) } if (name_len == 0) { - php_error_docref(NULL, E_WARNING, "Attribute Name is required"); - RETURN_FALSE; + zend_argument_value_error(2, "cannot be empty"); + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -873,10 +873,10 @@ PHP_METHOD(DOMElement, setAttributeNodeNS) DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj); - if (attrp->type != XML_ATTRIBUTE_NODE) { - php_error_docref(NULL, E_WARNING, "Attribute node is required"); - RETURN_FALSE; - } + /* ZPP Guarantees that a DOMAttr class is given, as it is converted to a xmlAttr + * to pass to libxml (see http://www.xmlsoft.org/html/libxml-tree.html#xmlAttr) + * if it is not of type XML_ATTRIBUTE_NODE it indicates a bug somewhere */ + ZEND_ASSERT(attrp->type == XML_ATTRIBUTE_NODE); if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) { php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document)); diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index 4e45119b48f06..635cfe7653c43 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -46,14 +46,14 @@ PHP_METHOD(DOMEntityReference, __construct) name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { php_dom_throw_error(INVALID_CHARACTER_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } node = xmlNewReference(NULL, (xmlChar *) name); if (!node) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index fd96003e565f8..26e0551f3bc87 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -146,44 +146,42 @@ PHP_METHOD(DOMNamedNodeMap, item) if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) { RETURN_THROWS(); } - if (index >= 0) { - if (ZEND_LONG_INT_OVFL(index)) { - php_error_docref(NULL, E_WARNING, "Invalid index"); - RETURN_NULL(); - } + if (index < 0 || ZEND_LONG_INT_OVFL(index)) { + zend_argument_value_error(1, "must be between 0 and %d", INT_MAX); + RETURN_THROWS(); + } - intern = Z_DOMOBJ_P(id); + intern = Z_DOMOBJ_P(id); - objmap = (dom_nnodemap_object *)intern->ptr; + objmap = (dom_nnodemap_object *)intern->ptr; - if (objmap != NULL) { - if ((objmap->nodetype == XML_NOTATION_NODE) || - objmap->nodetype == XML_ENTITY_NODE) { - if (objmap->ht) { - if (objmap->nodetype == XML_ENTITY_NODE) { - itemnode = php_dom_libxml_hash_iter(objmap->ht, index); - } else { - itemnode = php_dom_libxml_notation_iter(objmap->ht, index); - } + if (objmap != NULL) { + if ((objmap->nodetype == XML_NOTATION_NODE) || + objmap->nodetype == XML_ENTITY_NODE) { + if (objmap->ht) { + if (objmap->nodetype == XML_ENTITY_NODE) { + itemnode = php_dom_libxml_hash_iter(objmap->ht, index); + } else { + itemnode = php_dom_libxml_notation_iter(objmap->ht, index); } - } else { - nodep = dom_object_get_node(objmap->baseobj); - if (nodep) { - curnode = (xmlNodePtr)nodep->properties; - count = 0; - while (count < index && curnode != NULL) { - count++; - curnode = (xmlNodePtr)curnode->next; - } - itemnode = curnode; + } + } else { + nodep = dom_object_get_node(objmap->baseobj); + if (nodep) { + curnode = (xmlNodePtr)nodep->properties; + count = 0; + while (count < index && curnode != NULL) { + count++; + curnode = (xmlNodePtr)curnode->next; } + itemnode = curnode; } } + } - if (itemnode) { - DOM_RET_OBJ(itemnode, &ret, objmap->baseobj); - return; - } + if (itemnode) { + DOM_RET_OBJ(itemnode, &ret, objmap->baseobj); + return; } RETVAL_NULL(); diff --git a/ext/dom/node.c b/ext/dom/node.c index 16a6c6cc54e1e..a6f88b5c0f1bb 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -97,8 +97,7 @@ int dom_node_node_name_read(dom_object *obj, zval *retval) case XML_TEXT_NODE: str = "#text"; break; - default: - php_error_docref(NULL, E_WARNING, "Invalid Node Type"); + EMPTY_SWITCH_DEFAULT_CASE(); } if (str != NULL) { @@ -875,6 +874,7 @@ PHP_METHOD(DOMNode, insertBefore) } if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) { + /* TODO Drop Warning? */ php_error_docref(NULL, E_WARNING, "Document Fragment is empty"); RETURN_FALSE; } @@ -981,8 +981,8 @@ PHP_METHOD(DOMNode, insertBefore) } if (NULL == new_child) { - php_error_docref(NULL, E_WARNING, "Couldn't add newnode as the previous sibling of refnode"); - RETURN_FALSE; + zend_throw_error(NULL, "Cannot add newnode as the previous sibling of refnode"); + RETURN_THROWS(); } dom_reconcile_ns(parentp->doc, new_child); @@ -1074,7 +1074,7 @@ PHP_METHOD(DOMNode, replaceChild) DOM_RET_OBJ(oldchild, &ret, intern); return; } else { - php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document)); + php_dom_throw_error(NOT_FOUND_ERR, stricterror); RETURN_FALSE; } } @@ -1173,6 +1173,7 @@ PHP_METHOD(DOMNode, appendChild) } if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) { + /* TODO Drop Warning? */ php_error_docref(NULL, E_WARNING, "Document Fragment is empty"); RETURN_FALSE; } @@ -1221,6 +1222,7 @@ PHP_METHOD(DOMNode, appendChild) if (new_child == NULL) { new_child = xmlAddChild(nodep, child); if (new_child == NULL) { + // TODO Convert to Error? php_error_docref(NULL, E_WARNING, "Couldn't append node"); RETURN_FALSE; } @@ -1570,8 +1572,8 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ docp = nodep->doc; if (! docp) { - php_error_docref(NULL, E_WARNING, "Node must be associated with a document"); - RETURN_FALSE; + zend_throw_error(NULL, "Node must be associated with a document"); + RETURN_THROWS(); } if (xpath_array == NULL) { @@ -1587,8 +1589,8 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ xmlXPathFreeObject(xpathobjp); } xmlXPathFreeContext(ctxp); - php_error_docref(NULL, E_WARNING, "XPath query did not return a nodeset."); - RETURN_FALSE; + zend_throw_error(NULL, "XPath query did not return a nodeset"); + RETURN_THROWS(); } } } else { @@ -1598,12 +1600,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ char *xquery; tmp = zend_hash_str_find(ht, "query", sizeof("query")-1); - if (tmp && Z_TYPE_P(tmp) == IS_STRING) { - xquery = Z_STRVAL_P(tmp); - } else { - php_error_docref(NULL, E_WARNING, "'query' missing from xpath array or is not a string"); - RETURN_FALSE; + if (!tmp) { + /* if mode == 0 then $xpath arg is 3, if mode == 1 then $xpath is 4 */ + zend_argument_value_error(3 + mode, "must have a \"query\" key"); + RETURN_THROWS(); + } + if (Z_TYPE_P(tmp) != IS_STRING) { + /* if mode == 0 then $xpath arg is 3, if mode == 1 then $xpath is 4 */ + zend_argument_type_error(3 + mode, "\"query\" option must be a string, %s given", zend_zval_type_name(tmp)); + RETURN_THROWS(); } + xquery = Z_STRVAL_P(tmp); ctxp = xmlXPathNewContext(docp); ctxp->node = nodep; @@ -1631,8 +1638,8 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ xmlXPathFreeObject(xpathobjp); } xmlXPathFreeContext(ctxp); - php_error_docref(NULL, E_WARNING, "XPath query did not return a nodeset."); - RETURN_FALSE; + zend_throw_error(NULL, "XPath query did not return a nodeset"); + RETURN_THROWS(); } } @@ -1738,6 +1745,7 @@ PHP_METHOD(DOMNode, getNodePath) value = (char *) xmlGetNodePath(nodep); if (value == NULL) { + /* TODO Research if can return empty string */ RETURN_NULL(); } else { RETVAL_STRING(value); diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 8eae00fc03bbe..78d22f6a5e05c 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -317,7 +317,9 @@ zval *dom_read_property(zend_object *object, zend_string *name, int type, void * if (obj->prop_handler != NULL) { hnd = zend_hash_find_ptr(obj->prop_handler, name); } else if (instanceof_function(obj->std.ce, dom_node_class_entry)) { - php_error(E_WARNING, "Couldn't fetch %s. Node no longer exists", ZSTR_VAL(obj->std.ce->name)); + zend_throw_error(NULL, "Couldn't fetch %s. Node no longer exists", ZSTR_VAL(obj->std.ce->name)); + retval = &EG(uninitialized_zval); + return retval; } if (hnd) { @@ -466,8 +468,8 @@ PHP_FUNCTION(dom_import_simplexml) if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) { DOM_RET_OBJ((xmlNodePtr) nodep, &ret, (dom_object *)nodeobj); } else { - php_error_docref(NULL, E_WARNING, "Invalid Nodetype to import"); - RETURN_NULL(); + zend_argument_value_error(1, "is not a valid node type"); + RETURN_THROWS(); } } /* }}} */ @@ -1208,7 +1210,8 @@ PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_valu break; } default: - php_error_docref(NULL, E_WARNING, "Unsupported node type: %d", obj->type); + /* TODO Convert to a ZEND assertion? */ + zend_throw_error(NULL, "Unsupported node type: %d", obj->type); ZVAL_NULL(return_value); return 0; } diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 285980b64644b..24e1ea646a05d 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -151,8 +151,8 @@ entry = zend_register_internal_class_ex(&ce, parent_ce); } #define DOM_NOT_IMPLEMENTED() \ - php_error_docref(NULL, E_WARNING, "Not yet implemented"); \ - return; + zend_throw_error(NULL, "Not yet implemented"); \ + RETURN_THROWS(); #define DOM_NODELIST 0 #define DOM_NAMEDNODEMAP 1 diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index 5f15f99e174e5..bce79c9177d61 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -201,7 +201,7 @@ public function hasAttributeNS(?string $namespace, string $localName) {} /** @return bool */ public function removeAttribute(string $qualifiedName) {} - /** @return DOMAttr|false */ + /** @return void */ public function removeAttributeNS(?string $namespace, string $localName) {} /** @return DOMAttr|false */ @@ -210,7 +210,7 @@ public function removeAttributeNode(string $qualifiedName) {} /** @return DOMAttr|bool */ public function setAttribute(string $qualifiedName, string $value) {} - /** @return bool|null */ + /** @return void */ public function setAttributeNS(?string $namespace, string $qualifiedName, string $value) {} /** @return DOMAttr|null|false */ diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index d5da40e46393f..fb8aaf59f23d9 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 8ac9356f9b19b84e98d335bc9d091b022a0f549d */ + * Stub hash: 128108b08807ce0b125fc7b963bf3c5b77e6987a */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 1) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0) diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index 9255213e7162a..73367442eb1c7 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -46,14 +46,14 @@ PHP_METHOD(DOMProcessingInstruction, __construct) name_valid = xmlValidateName((xmlChar *) name, 0); if (name_valid != 0) { php_dom_throw_error(INVALID_CHARACTER_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value); if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); diff --git a/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt b/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt index e57c3da913c1e..67a66ae16ea35 100644 --- a/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt +++ b/ext/dom/tests/DOMAttr_ownerElement_error_001.phpt @@ -14,10 +14,11 @@ $document->appendChild($root); $attr = $root->setAttribute('category', 'books'); $document->removeChild($root); $root = null; -var_dump($attr->ownerElement); +try { + var_dump($attr->ownerElement); +} catch (\Error $e) { + echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: Couldn't fetch DOMAttr. Node no longer exists in %s on line %d - -Warning: Undefined property: DOMAttr::$ownerElement in %s on line %d -NULL +--EXPECT-- +Error: Couldn't fetch DOMAttr. Node no longer exists diff --git a/ext/dom/tests/DOMDocument_adoptNode.phpt b/ext/dom/tests/DOMDocument_adoptNode.phpt index 5fc8e79d9dc31..0f0a32ae498ff 100644 --- a/ext/dom/tests/DOMDocument_adoptNode.phpt +++ b/ext/dom/tests/DOMDocument_adoptNode.phpt @@ -10,7 +10,11 @@ require_once('skipif.inc'); $dom = new DOMDocument(); $dom->loadXML(""); -$dom->adoptNode($dom->documentElement); +try { + $dom->adoptNode($dom->documentElement); +} catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: DOMDocument::adoptNode(): Not yet implemented in %s +--EXPECT-- +Not yet implemented diff --git a/ext/dom/tests/DOMDocument_encoding_basic.phpt b/ext/dom/tests/DOMDocument_encoding_basic.phpt index 6ac405da69859..925c84d5f185e 100644 --- a/ext/dom/tests/DOMDocument_encoding_basic.phpt +++ b/ext/dom/tests/DOMDocument_encoding_basic.phpt @@ -19,10 +19,14 @@ if( !$dom ) exit; } -echo "Empty Encoding Read: {$dom->encoding}\n"; +echo "Empty Encoding Read: '{$dom->encoding}'\n"; -$ret = $dom->encoding = 'NYPHP DOMinatrix'; -echo "Adding invalid encoding: $ret\n"; +try { + $ret = $dom->encoding = 'NYPHP DOMinatrix'; + echo "Adding invalid encoding: $ret\n"; +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} $ret = $dom->encoding = 'ISO-8859-1'; echo "Adding ISO-8859-1 encoding: $ret\n"; @@ -38,11 +42,9 @@ echo "UTF-16 Encoding Read: {$dom->encoding}\n"; ?> ---EXPECTF-- -Empty Encoding Read: - -Warning: main(): Invalid Document Encoding in %s on line %d -Adding invalid encoding: NYPHP DOMinatrix +--EXPECT-- +Empty Encoding Read: '' +Invalid document encoding Adding ISO-8859-1 encoding: ISO-8859-1 ISO-8859-1 Encoding Read: ISO-8859-1 Adding UTF-8 encoding: UTF-8 diff --git a/ext/dom/tests/DOMDocument_loadHTML_error2.phpt b/ext/dom/tests/DOMDocument_loadHTML_error2.phpt index 3167c0189034a..695f58868d5b2 100644 --- a/ext/dom/tests/DOMDocument_loadHTML_error2.phpt +++ b/ext/dom/tests/DOMDocument_loadHTML_error2.phpt @@ -9,7 +9,11 @@ require_once('skipif.inc'); --FILE-- loadHTML(''); +try { + $doc->loadHTML(''); +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: DOMDocument::loadHTML(): Empty string supplied as input in %s on line %d +--EXPECT-- +DOMDocument::loadHTML(): Argument #1 ($source) must not be empty diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt index 55b36e712d18a..492bedda1027a 100644 --- a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt +++ b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt @@ -11,13 +11,19 @@ assert.bail=true --FILE-- loadHTMLFile(""); -assert($result === false); +try { + $result = $doc->loadHTMLFile(""); +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} + $doc = new DOMDocument(); -$result = $doc->loadHTMLFile("text.html\0something"); -assert($result === false); +try { + $result = $doc->loadHTMLFile("text.html\0something"); +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} ?> ---EXPECTF-- -%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s - -%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Invalid file source %s +--EXPECT-- +DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not be empty +DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not contain any null bytes diff --git a/ext/dom/tests/DOMDocument_loadXML_error6.phpt b/ext/dom/tests/DOMDocument_loadXML_error6.phpt new file mode 100644 index 0000000000000..9f22692ed9f9b --- /dev/null +++ b/ext/dom/tests/DOMDocument_loadXML_error6.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test DOMDocument::loadXML() with empty file path +--SKIPIF-- + +--FILE-- +loadXML(""); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} +?> +--EXPECT-- +DOMDocument::loadXML(): Argument #1 ($source) must not be empty diff --git a/ext/dom/tests/DOMDocument_load_error6.phpt b/ext/dom/tests/DOMDocument_load_error6.phpt new file mode 100644 index 0000000000000..70e270651cc6d --- /dev/null +++ b/ext/dom/tests/DOMDocument_load_error6.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test DOMDocument::load() with invalid paths +--SKIPIF-- + +--FILE-- +load(""); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + $dom->load("/path/with/\0/byte"); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} + +// Path is too long +var_dump($dom->load(str_repeat(" ", PHP_MAXPATHLEN + 1))); +?> +--EXPECT-- +DOMDocument::load(): Argument #1 ($filename) must not be empty +Path to document must not contain any null bytes +bool(false) diff --git a/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt b/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt index 6ca66730eb588..12b45a491bd04 100644 --- a/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt +++ b/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt @@ -19,7 +19,11 @@ $title = $doc->createElement('title'); $title = $head->appendChild($title); $text = $doc->createTextNode('This is the title'); $text = $title->appendChild($text); -$bytes = $doc->saveHTMLFile($filename); +try { + $doc->saveHTMLFile($filename); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: DOMDocument::saveHTMLFile(): Invalid Filename in %s on line %d +--EXPECT-- +DOMDocument::saveHTMLFile(): Argument #1 ($filename) must not be empty diff --git a/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt b/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt index 41f9015b92b7a..dc7a1db901273 100644 --- a/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt @@ -12,10 +12,12 @@ $doc = new DOMDocument; $doc->load(__DIR__."/book.xml"); -$result = $doc->schemaValidateSource(''); -var_dump($result); +try { + $doc->schemaValidateSource(''); +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: DOMDocument::schemaValidateSource(): Invalid Schema source in %s.php on line %d -bool(false) +--EXPECT-- +DOMDocument::schemaValidateSource(): Argument #1 ($source) must not be empty diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt index 2ff2ce9487e69..0add6b2442a6d 100644 --- a/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt @@ -12,10 +12,12 @@ $doc = new DOMDocument; $doc->load(__DIR__."/book.xml"); -$result = $doc->schemaValidate(''); -var_dump($result); +try { + $doc->schemaValidate(''); +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: DOMDocument::schemaValidate(): Invalid Schema source in %s.php on line %d -bool(false) +--EXPECT-- +DOMDocument::schemaValidate(): Argument #1 ($filename) must not be empty diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt new file mode 100644 index 0000000000000..1dbfb9a2af9f0 --- /dev/null +++ b/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt @@ -0,0 +1,25 @@ +--TEST-- +DomDocument::schemaValidate() - invalid path to schema +--SKIPIF-- + +--FILE-- +load(__DIR__."/book.xml"); + +try { + $doc->schemaValidate("/path/with/\0/byte"); +} catch (ValueError $e) { + echo $e->getMessage() . "\n"; +} + +var_dump($doc->schemaValidate(str_repeat(" ", PHP_MAXPATHLEN + 1))); + +?> +--EXPECTF-- +DOMDocument::schemaValidate(): Argument #1 ($filename) must not contain any null bytes + +Warning: DOMDocument::schemaValidate(): Invalid Schema file source in %s on line %d +bool(false) diff --git a/ext/dom/tests/DOMNode_C14NFile_basic.phpt b/ext/dom/tests/DOMNode_C14NFile_basic.phpt index b006e47deb7ad..85a8b6f1a51bd 100644 --- a/ext/dom/tests/DOMNode_C14NFile_basic.phpt +++ b/ext/dom/tests/DOMNode_C14NFile_basic.phpt @@ -27,6 +27,16 @@ $node = $doc->getElementsByTagName('title')->item(0); var_dump($node->C14NFile($output)); $content = file_get_contents($output); var_dump($content); +try { + var_dump($node->C14NFile($output, false, false, [])); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} +try { + var_dump($node->C14NFile($output, false, false, ['query' => []])); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> --CLEAN-- The Grapes of Wrath" +DOMNode::C14NFile(): Argument #4 ($xpath) must have a "query" key +DOMNode::C14NFile(): Argument #4 ($xpath) "query" option must be a string, array given diff --git a/ext/dom/tests/DOMNode_C14N_basic.phpt b/ext/dom/tests/DOMNode_C14N_basic.phpt index bbfd7bcefb298..79a5366e222f5 100644 --- a/ext/dom/tests/DOMNode_C14N_basic.phpt +++ b/ext/dom/tests/DOMNode_C14N_basic.phpt @@ -24,6 +24,19 @@ $doc = new DOMDocument(); $doc->loadXML($xml); $node = $doc->getElementsByTagName('title')->item(0); var_dump($node->C14N()); + +try { + var_dump($node->C14N(false, false, [])); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} +try { + var_dump($node->C14N(false, false, ['query' => []])); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> --EXPECT-- string(34) "The Grapes of Wrath" +DOMNode::C14N(): Argument #3 ($xpath) must have a "query" key +DOMNode::C14N(): Argument #3 ($xpath) "query" option must be a string, array given diff --git a/ext/dom/tests/bug36756.phpt b/ext/dom/tests/bug36756.phpt index ccf9ba5049bb1..bf7aa20276bf0 100644 --- a/ext/dom/tests/bug36756.phpt +++ b/ext/dom/tests/bug36756.phpt @@ -13,7 +13,6 @@ $node = $xpath->query('/root')->item(0); echo $node->nodeName . "\n"; $dom->removeChild($GLOBALS['dom']->firstChild); echo "nodeType: " . $node->nodeType . "\n"; - /* Node gets destroyed during removeChild */ $dom->loadXML(''); $xpath = new DOMXpath($dom); @@ -21,15 +20,15 @@ $node = $xpath->query('//child')->item(0); echo $node->nodeName . "\n"; $GLOBALS['dom']->removeChild($GLOBALS['dom']->firstChild); -echo "nodeType: " . $node->nodeType . "\n"; +try { + echo "nodeType: " . $node->nodeType . "\n"; +} catch (\Error $e) { + echo get_class($e) . ': ' . $e->getMessage() .\PHP_EOL; +} ?> ---EXPECTF-- +--EXPECT-- root nodeType: 1 child - -Warning: Couldn't fetch DOMElement. Node no longer exists in %sbug36756.php on line %d - -Warning: Undefined property: DOMElement::$nodeType in %s on line %d -nodeType: +Error: Couldn't fetch DOMElement. Node no longer exists diff --git a/ext/dom/tests/bug77569.phpt b/ext/dom/tests/bug77569.phpt index 9eef2af65a788..4c63e263e47d6 100644 --- a/ext/dom/tests/bug77569.phpt +++ b/ext/dom/tests/bug77569.phpt @@ -8,7 +8,11 @@ if (!extension_loaded('dom')) die('skip dom extension not available'); createDocument("", ""); -$dom->encoding = null; +try { + $dom->encoding = null; +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: main(): Invalid Document Encoding in %s on line %d +--EXPECT-- +Invalid document encoding diff --git a/ext/dom/tests/domxpath.phpt b/ext/dom/tests/domxpath.phpt index f67b2584aacba..32aaffee01869 100644 --- a/ext/dom/tests/domxpath.phpt +++ b/ext/dom/tests/domxpath.phpt @@ -50,9 +50,24 @@ $root->appendChild($dom->createElementNS("urn::default", "testnode", 5)); $avg = $xpath->evaluate('number(php:function("MyAverage", //def:testnode))'); var_dump($avg); + +try { + $xpath->registerPHPFunctions('non_existent'); + $avg = $xpath->evaluate('number(php:function("non_existent", //def:testnode))'); +} catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; +} +try { + $xpath->registerPhpFunctions(['non_existant']); + $avg = $xpath->evaluate('number(php:function("non_existent", //def:testnode))'); +} catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> --EXPECT-- myval float(1) bool(true) float(4) +Unable to call handler non_existent() +Unable to call handler non_existent() diff --git a/ext/dom/text.c b/ext/dom/text.c index b1053b2039bfc..7a45be246360e 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -47,7 +47,7 @@ PHP_METHOD(DOMText, __construct) if (!nodep) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); @@ -122,17 +122,25 @@ PHP_METHOD(DOMText, splitText) } DOM_GET_OBJ(node, id, xmlNodePtr, intern); + if (offset < 0) { + zend_argument_value_error(1, "must be greater than or equal to 0"); + RETURN_THROWS(); + } + if (node->type != XML_TEXT_NODE && node->type != XML_CDATA_SECTION_NODE) { + /* TODO Add warning? */ RETURN_FALSE; } cur = xmlNodeGetContent(node); if (cur == NULL) { + /* TODO Add warning? */ RETURN_FALSE; } length = xmlUTF8Strlen(cur); - if (ZEND_LONG_INT_OVFL(offset) || (int)offset > length || offset < 0) { + if (ZEND_LONG_INT_OVFL(offset) || (int)offset > length) { + /* TODO Add warning? */ xmlFree(cur); RETURN_FALSE; } @@ -149,6 +157,7 @@ PHP_METHOD(DOMText, splitText) xmlFree(second); if (nnode == NULL) { + /* TODO Add warning? */ RETURN_FALSE; } diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index cc3cbf8433655..1f97601c426d1 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -136,15 +136,9 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, obj = valuePop(ctxt); if (obj->stringval == NULL) { - php_error_docref(NULL, E_WARNING, "Handler name must be a string"); + zend_type_error("Handler name must be a string"); xmlXPathFreeObject(obj); - if (fci.param_count > 0) { - for (i = 0; i < nargs - 1; i++) { - zval_ptr_dtor(&fci.params[i]); - } - efree(fci.params); - } - return; + goto cleanup; } ZVAL_STRING(&fci.function_name, (char *) obj->stringval); xmlXPathFreeObject(obj); @@ -154,11 +148,11 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, fci.retval = &retval; if (!zend_make_callable(&fci.function_name, &callable)) { - php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", ZSTR_VAL(callable)); + zend_throw_error(NULL, "Unable to call handler %s()", ZSTR_VAL(callable)); + goto cleanup; } else if (intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable) == 0) { - php_error_docref(NULL, E_WARNING, "Not allowed to call handler '%s()'.", ZSTR_VAL(callable)); - /* Push an empty string, so that we at least have an xslt result... */ - valuePush(ctxt, xmlXPathNewString((xmlChar *)"")); + zend_throw_error(NULL, "Not allowed to call handler '%s()'.", ZSTR_VAL(callable)); + goto cleanup; } else { result = zend_call_function(&fci, NULL); if (result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { @@ -176,8 +170,8 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, } else if (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE) { valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(retval) == IS_TRUE)); } else if (Z_TYPE(retval) == IS_OBJECT) { - php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string"); - valuePush(ctxt, xmlXPathNewString((xmlChar *)"")); + zend_type_error("A PHP Object cannot be converted to a XPath-string"); + return; } else { zend_string *str = zval_get_string(&retval); valuePush(ctxt, xmlXPathNewString((xmlChar *) ZSTR_VAL(str))); @@ -186,6 +180,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, zval_ptr_dtor(&retval); } } +cleanup: zend_string_release_ex(callable, 0); zval_ptr_dtor_str(&fci.function_name); if (fci.param_count > 0) { @@ -228,7 +223,7 @@ PHP_METHOD(DOMXPath, __construct) ctx = xmlXPathNewContext(docp); if (ctx == NULL) { php_dom_throw_error(INVALID_STATE_ERR, 1); - RETURN_FALSE; + RETURN_THROWS(); } intern = Z_XPATHOBJ_P(ZEND_THIS); @@ -308,8 +303,8 @@ PHP_METHOD(DOMXPath, registerNamespace) ctxp = (xmlXPathContextPtr) intern->dom.ptr; if (ctxp == NULL) { - php_error_docref(NULL, E_WARNING, "Invalid XPath Context"); - RETURN_FALSE; + zend_throw_error(NULL, "Invalid XPath Context"); + RETURN_THROWS(); } if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { @@ -352,8 +347,8 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ ctxp = (xmlXPathContextPtr) intern->dom.ptr; if (ctxp == NULL) { - php_error_docref(NULL, E_WARNING, "Invalid XPath Context"); - RETURN_FALSE; + zend_throw_error(NULL, "Invalid XPath Context"); + RETURN_THROWS(); } docp = (xmlDocPtr) ctxp->doc; @@ -371,8 +366,8 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ } if (nodep && docp != nodep->doc) { - php_error_docref(NULL, E_WARNING, "Node From Wrong Document"); - RETURN_FALSE; + zend_throw_error(NULL, "Node from wrong document"); + RETURN_THROWS(); } ctxp->node = nodep; @@ -401,6 +396,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ } if (! xpathobjp) { + /* TODO Add Warning? */ RETURN_FALSE; } diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index b24850dfa0cc5..044bb61699560 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -7302,11 +7302,11 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len) val->ch = '\t'; } else if (str[2] == 'v' && str_len == 4) { val->ch = '\v'; - } else if (str[2] >= '0' || str[2] <= '7') { + } else if (str[2] >= '0' && str[2] <= '7') { n = str[2] - '0'; - if (str[3] >= '0' || str[3] <= '7') { + if (str[3] >= '0' && str[3] <= '7') { n = n * 8 + (str[3] - '0'); - if ((str[4] >= '0' || str[4] <= '7') && str_len == 6) { + if ((str[4] >= '0' && str[4] <= '7') && str_len == 6) { n = n * 8 + (str[4] - '0'); } else if (str_len != 5) { val->kind = ZEND_FFI_VAL_ERROR; @@ -7320,23 +7320,25 @@ void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len) val->kind = ZEND_FFI_VAL_ERROR; } } else if (str[2] == 'x') { - if (str[3] >= '0' || str[3] <= '7') { + if (str[3] >= '0' && str[3] <= '9') { n = str[3] - '0'; - } else if (str[3] >= 'A' || str[3] <= 'F') { + } else if (str[3] >= 'A' && str[3] <= 'F') { n = str[3] - 'A'; - } else if (str[3] >= 'a' || str[3] <= 'f') { + } else if (str[3] >= 'a' && str[3] <= 'f') { n = str[3] - 'a'; } else { val->kind = ZEND_FFI_VAL_ERROR; + return; } - if ((str[4] >= '0' || str[4] <= '7') && str_len == 6) { + if ((str[4] >= '0' && str[4] <= '9') && str_len == 6) { n = n * 16 + (str[4] - '0'); - } else if ((str[4] >= 'A' || str[4] <= 'F') && str_len == 6) { + } else if ((str[4] >= 'A' && str[4] <= 'F') && str_len == 6) { n = n * 16 + (str[4] - 'A'); - } else if ((str[4] >= 'a' || str[4] <= 'f') && str_len == 6) { + } else if ((str[4] >= 'a' && str[4] <= 'f') && str_len == 6) { n = n * 16 + (str[4] - 'a'); } else if (str_len != 5) { val->kind = ZEND_FFI_VAL_ERROR; + return; } val->ch = n; } else if (str_len == 4) { diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 2538171f25bee..0a4ee3c34eebb 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -71,8 +71,8 @@ static inline finfo_object *php_finfo_fetch_object(zend_object *obj) { finfo_object *obj = Z_FINFO_P(object); \ finfo = obj->ptr; \ if (!finfo) { \ - php_error_docref(NULL, E_WARNING, "The invalid fileinfo object."); \ - RETURN_FALSE; \ + zend_throw_error(NULL, "Invalid finfo object"); \ + RETURN_THROWS(); \ } \ } @@ -270,7 +270,7 @@ PHP_FUNCTION(finfo_open) } if (magic_load(finfo->magic, file) == -1) { - php_error_docref(NULL, E_WARNING, "Failed to load magic database at '%s'.", file); + php_error_docref(NULL, E_WARNING, "Failed to load magic database at \"%s\"", file); magic_close(finfo->magic); efree(finfo); if (object) { @@ -382,7 +382,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime magic = magic_open(MAGIC_MIME_TYPE); if (magic_load(magic, NULL) == -1) { - php_error_docref(NULL, E_WARNING, "Failed to load magic database."); + php_error_docref(NULL, E_WARNING, "Failed to load magic database"); goto common; } } else if (object) { @@ -444,7 +444,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime goto clean; } if (CHECK_NULL_PATH(buffer, buffer_len)) { - zend_argument_type_error(1, "must not contain null bytes"); + zend_argument_type_error(1, "must not contain any null bytes"); goto clean; } diff --git a/ext/fileinfo/fileinfo.stub.php b/ext/fileinfo/fileinfo.stub.php index a951e573dcd07..9355a96a2b192 100644 --- a/ext/fileinfo/fileinfo.stub.php +++ b/ext/fileinfo/fileinfo.stub.php @@ -5,31 +5,31 @@ class finfo { /** @alias finfo_open */ - public function __construct(int $options = FILEINFO_NONE, string $arg = "") {} + public function __construct(int $flags = FILEINFO_NONE, string $magic_database = "") {} /** * @param resource|null $context * @return string|false * @alias finfo_file */ - public function file(string $file_name, int $options = FILEINFO_NONE, $context = null) {} + public function file(string $filename, int $flags = FILEINFO_NONE, $context = null) {} /** * @param resource|null $context * @return string|false * @alias finfo_buffer */ - public function buffer(string $string, int $options = FILEINFO_NONE, $context = null) {} + public function buffer(string $string, int $flags = FILEINFO_NONE, $context = null) {} /** * @return bool * @alias finfo_set_flags */ - public function set_flags(int $options) {} + public function set_flags(int $flags) {} } /** @return resource|false */ -function finfo_open(int $options = FILEINFO_NONE, string $arg = "") {} +function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = "") {} /** * @param resource $finfo @@ -39,19 +39,19 @@ function finfo_close($finfo): bool {} /** * @param resource $finfo */ -function finfo_set_flags($finfo, int $options): bool {} +function finfo_set_flags($finfo, int $flags): bool {} /** * @param resource $finfo * @param resource|null $context */ -function finfo_file($finfo, string $file_name, int $options = FILEINFO_NONE, $context = null): string|false {} +function finfo_file($finfo, string $filename, int $flags = FILEINFO_NONE, $context = null): string|false {} /** * @param resource $finfo * @param resource|null $context */ -function finfo_buffer($finfo, string $string, int $options = FILEINFO_NONE, $context = null): string|false {} +function finfo_buffer($finfo, string $string, int $flags = FILEINFO_NONE, $context = null): string|false {} /** * @param resource|string $filename diff --git a/ext/fileinfo/fileinfo_arginfo.h b/ext/fileinfo/fileinfo_arginfo.h index 95fe4fc98bf74..80850a6502e61 100644 --- a/ext/fileinfo/fileinfo_arginfo.h +++ b/ext/fileinfo/fileinfo_arginfo.h @@ -1,9 +1,9 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b8bfd01bd5a9a181550160e39c50a8cc047f15cd */ + * Stub hash: be858509df27550b51d8a7a51a3629eceb6d0aa6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_open, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, magic_database, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_close, 0, 1, _IS_BOOL, 0) @@ -12,20 +12,20 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_finfo_set_flags, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, finfo) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_finfo_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, finfo) - ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_finfo_buffer, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_INFO(0, finfo) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -36,19 +36,19 @@ ZEND_END_ARG_INFO() #define arginfo_class_finfo___construct arginfo_finfo_open ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_file, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_buffer, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "FILEINFO_NONE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_finfo_set_flags, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/fileinfo/tests/bug61964-mb.phpt b/ext/fileinfo/tests/bug61964-mb.phpt index 9187393554eb6..1142ad7eeda29 100644 --- a/ext/fileinfo/tests/bug61964-mb.phpt +++ b/ext/fileinfo/tests/bug61964-mb.phpt @@ -58,5 +58,5 @@ Warning: finfo_open(): offset `a' invalid in %sbug61964-mb.php on line %d Warning: finfo_open(): offset `b' invalid in %sbug61964-mb.php on line %d -Warning: finfo_open(): Failed to load magic database at '%sbug61964-mb'. in %sbug61964-mb.php on line %d +Warning: finfo_open(): Failed to load magic database at "%sbug61964-mb" in %sbug61964-mb.php on line %d DONE: testing dir with files diff --git a/ext/fileinfo/tests/bug61964.phpt b/ext/fileinfo/tests/bug61964.phpt index 24cf3bec8c807..ecb12fe75214d 100644 --- a/ext/fileinfo/tests/bug61964.phpt +++ b/ext/fileinfo/tests/bug61964.phpt @@ -58,5 +58,5 @@ Warning: finfo_open(): offset `a' invalid in %sbug61964.php on line %d Warning: finfo_open(): offset `b' invalid in %sbug61964.php on line %d -Warning: finfo_open(): Failed to load magic database at '%sbug61964'. in %sbug61964.php on line %d +Warning: finfo_open(): Failed to load magic database at "%sbug61964" in %sbug61964.php on line %d DONE: testing dir with files diff --git a/ext/fileinfo/tests/bug68996.phpt b/ext/fileinfo/tests/bug68996.phpt index aabd2670bdc08..2535f5e455857 100644 --- a/ext/fileinfo/tests/bug68996.phpt +++ b/ext/fileinfo/tests/bug68996.phpt @@ -14,4 +14,4 @@ finfo_open(FILEINFO_MIME_TYPE, "\xfc\x63");
Warning: finfo_open(%s�c): Failed to open stream: No such file or directory in %sbug68996.php on line %d

-Warning: finfo_open(): Failed to load magic database at '%s�c'. in %sbug68996.php on line %d
+Warning: finfo_open(): Failed to load magic database at "%s�c" in %s on line %d
diff --git a/ext/fileinfo/tests/bug71527-mb.phpt b/ext/fileinfo/tests/bug71527-mb.phpt index ea32a8122a923..0240ce3303eb9 100644 --- a/ext/fileinfo/tests/bug71527-mb.phpt +++ b/ext/fileinfo/tests/bug71527-mb.phpt @@ -12,5 +12,5 @@ USE_ZEND_ALLOC=0 var_dump($finfo); ?> --EXPECTF-- -Warning: finfo_open(): Failed to load magic database at '%sbug71527ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.magic'. in %sbug71527-mb.php on line %d +Warning: finfo_open(): Failed to load magic database at "%sbug71527ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™.magic" in %sbug71527-mb.php on line %d bool(false) diff --git a/ext/fileinfo/tests/bug71527.phpt b/ext/fileinfo/tests/bug71527.phpt index 9a00c4f32b83d..3a536266fcf2a 100644 --- a/ext/fileinfo/tests/bug71527.phpt +++ b/ext/fileinfo/tests/bug71527.phpt @@ -12,5 +12,5 @@ USE_ZEND_ALLOC=0 var_dump($finfo); ?> --EXPECTF-- -Warning: finfo_open(): Failed to load magic database at '%sbug71527.magic'. in %sbug71527.php on line %d +Warning: finfo_open(): Failed to load magic database at "%sbug71527.magic" in %sbug71527.php on line %d bool(false) diff --git a/ext/fileinfo/tests/finfo_file_001.phpt b/ext/fileinfo/tests/finfo_file_001.phpt index 726103e02d666..71d88bbd43f03 100644 --- a/ext/fileinfo/tests/finfo_file_001.phpt +++ b/ext/fileinfo/tests/finfo_file_001.phpt @@ -26,7 +26,7 @@ var_dump(finfo_file($fp, '&')); ?> --EXPECTF-- -finfo_file(): Argument #1 ($finfo) must not contain null bytes +finfo_file(): Argument #1 ($finfo) must not contain any null bytes finfo_file(): Argument #1 ($finfo) cannot be empty finfo_file(): Argument #1 ($finfo) cannot be empty string(9) "directory" diff --git a/ext/fileinfo/tests/finfo_file_basic.phpt b/ext/fileinfo/tests/finfo_file_basic.phpt index 08c296ac8be3b..821405b48cd39 100644 --- a/ext/fileinfo/tests/finfo_file_basic.phpt +++ b/ext/fileinfo/tests/finfo_file_basic.phpt @@ -25,4 +25,4 @@ try { string(28) "text/x-php; charset=us-ascii" string(22) "PHP script, ASCII text" string(25) "text/plain; charset=utf-8" -finfo_file(): Argument #1 ($finfo) must not contain null bytes +finfo_file(): Argument #1 ($finfo) must not contain any null bytes diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt index 1b1a1a690018f..ef36bc21f08e8 100644 --- a/ext/fileinfo/tests/finfo_open_001.phpt +++ b/ext/fileinfo/tests/finfo_open_001.phpt @@ -19,7 +19,7 @@ var_dump(finfo_open(FILEINFO_MIME, '/foo/bar/inexistent')); ?> --EXPECTF-- -finfo_open(): Argument #2 ($arg) must not contain any null bytes +finfo_open(): Argument #2 ($magic_database) must not contain any null bytes resource(%d) of type (file_info) resource(%d) of type (file_info) @@ -27,19 +27,19 @@ Warning: finfo_open(%s123): Failed to open stream: No such file or directory in Warning: finfo_open(%s123): Failed to open stream: No such file or directory in %s on line %d -Warning: finfo_open(): Failed to load magic database at '%s123'. in %s on line %d +Warning: finfo_open(): Failed to load magic database at "%s123" in %s on line %d bool(false) Warning: finfo_open(%s1): Failed to open stream: No such file or directory in %s on line %d Warning: finfo_open(%s1): Failed to open stream: No such file or directory in %s on line %d -Warning: finfo_open(): Failed to load magic database at '%s1'. in %s on line %d +Warning: finfo_open(): Failed to load magic database at "%s1" in %s on line %d bool(false) Warning: finfo_open(%sinexistent): Failed to open stream: No such file or directory in %s on line %d Warning: finfo_open(%sinexistent): Failed to open stream: No such file or directory in %s on line %d -Warning: finfo_open(): Failed to load magic database at '%sinexistent'. in %s on line %d +Warning: finfo_open(): Failed to load magic database at "%sinexistent" in %s on line %d bool(false) diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt index fea2c54041d2d..881c26f664827 100644 --- a/ext/fileinfo/tests/finfo_open_error.phpt +++ b/ext/fileinfo/tests/finfo_open_error.phpt @@ -31,10 +31,10 @@ Warning: finfo_open(%sfoobarfile): Failed to open stream: No such file or direct Warning: finfo_open(%sfoobarfile): Failed to open stream: No such file or directory in %sfinfo_open_error.php on line %d -Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error.php on line %d +Warning: finfo_open(): Failed to load magic database at "%sfoobarfile" in %sfinfo_open_error.php on line %d bool(false) Warning: finfo_open(): using regular magic file `%smagic' in %sfinfo_open_error.php on line %d resource(6) of type (file_info) -finfo_open(): Argument #1 ($options) must be of type int, string given -finfo::__construct(): Argument #1 ($options) must be of type int, string given +finfo_open(): Argument #1 ($flags) must be of type int, string given +finfo::__construct(): Argument #1 ($flags) must be of type int, string given diff --git a/ext/fileinfo/tests/mime_content_type_001.phpt b/ext/fileinfo/tests/mime_content_type_001.phpt index 9e3cb603986cd..76897cca7f9a6 100644 --- a/ext/fileinfo/tests/mime_content_type_001.phpt +++ b/ext/fileinfo/tests/mime_content_type_001.phpt @@ -48,4 +48,4 @@ mime_content_type(): Argument #2 must be of type resource|string, array given Warning: mime_content_type(foo/inexistent): Failed to open stream: No such file or directory in %s on line %d mime_content_type(): Argument #1 ($filename) cannot be empty -mime_content_type(): Argument #1 ($filename) must not contain null bytes +mime_content_type(): Argument #1 ($filename) must not contain any null bytes diff --git a/ext/filter/filter.stub.php b/ext/filter/filter.stub.php index 56f926b913f3c..de92b935192a7 100644 --- a/ext/filter/filter.stub.php +++ b/ext/filter/filter.stub.php @@ -2,16 +2,16 @@ /** @generate-function-entries */ -function filter_has_var(int $type, string $variable_name): bool {} +function filter_has_var(int $input_type, string $var_name): bool {} -function filter_input(int $type, string $variable_name, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed {} +function filter_input(int $type, string $var_name, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed {} -function filter_var(mixed $variable, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed {} +function filter_var(mixed $value, int $filter = FILTER_DEFAULT, array|int $options = 0): mixed {} function filter_input_array(int $type, array|int $options = FILTER_DEFAULT, bool $add_empty = true): array|false|null {} -function filter_var_array(array $data, array|int $options = FILTER_DEFAULT, bool $add_empty = true): array|false|null {} +function filter_var_array(array $array, array|int $options = FILTER_DEFAULT, bool $add_empty = true): array|false|null {} function filter_list(): array {} -function filter_id(string $filtername): int|false {} +function filter_id(string $name): int|false {} diff --git a/ext/filter/filter_arginfo.h b/ext/filter/filter_arginfo.h index bb3ab54666c5b..c4e4479e792a9 100644 --- a/ext/filter/filter_arginfo.h +++ b/ext/filter/filter_arginfo.h @@ -1,20 +1,20 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: dae0cf8beeb47a996123cffd3b429482047d42c1 */ + * Stub hash: b5f2e4a79eb6f30fe143b3086845435d0a0a6ef0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_has_var, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, variable_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, input_type, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, var_name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_input, 0, 2, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, variable_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, var_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filter, IS_LONG, 0, "FILTER_DEFAULT") ZEND_ARG_TYPE_MASK(0, options, MAY_BE_ARRAY|MAY_BE_LONG, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_var, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, variable, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filter, IS_LONG, 0, "FILTER_DEFAULT") ZEND_ARG_TYPE_MASK(0, options, MAY_BE_ARRAY|MAY_BE_LONG, "0") ZEND_END_ARG_INFO() @@ -26,7 +26,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filter_input_array, 0, 1, MAY_BE ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filter_var_array, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE|MAY_BE_NULL) - ZEND_ARG_TYPE_INFO(0, data, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) ZEND_ARG_TYPE_MASK(0, options, MAY_BE_ARRAY|MAY_BE_LONG, "FILTER_DEFAULT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, add_empty, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() @@ -35,7 +35,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_list, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filter_id, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, filtername, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() diff --git a/ext/filter/tests/040.phpt b/ext/filter/tests/040.phpt index 6f0a79199f2ef..1d742c89a49b1 100644 --- a/ext/filter/tests/040.phpt +++ b/ext/filter/tests/040.phpt @@ -34,6 +34,6 @@ bool(true) bool(true) bool(false) bool(false) -filter_has_var(): Argument #1 ($type) must be an INPUT_* constant +filter_has_var(): Argument #1 ($input_type) must be an INPUT_* constant bool(false) Done diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 0a185ef27294f..a6dca8c874bf7 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1284,7 +1284,7 @@ PHP_FUNCTION(ftp_set_option) RETURN_TRUE; break; default: - zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); + zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); RETURN_THROWS(); break; } @@ -1317,7 +1317,7 @@ PHP_FUNCTION(ftp_get_option) RETURN_BOOL(ftp->usepasvaddress); break; default: - zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); + zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); RETURN_THROWS(); } } diff --git a/ext/ftp/tests/ftp_get_option.phpt b/ext/ftp/tests/ftp_get_option.phpt index 336243d64ba75..13ed76fff15f3 100644 --- a/ext/ftp/tests/ftp_get_option.phpt +++ b/ext/ftp/tests/ftp_get_option.phpt @@ -28,4 +28,4 @@ try { int(%d) bool(true) bool(true) -ftp_get_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS +ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS diff --git a/ext/ftp/tests/ftp_set_option_errors.phpt b/ext/ftp/tests/ftp_set_option_errors.phpt index 03c387975e0b9..3f5476f6c32f0 100644 --- a/ext/ftp/tests/ftp_set_option_errors.phpt +++ b/ext/ftp/tests/ftp_set_option_errors.phpt @@ -49,4 +49,4 @@ ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOU ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given -ftp_set_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS +ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS diff --git a/ext/gd/gd.c b/ext/gd/gd.c index d425b83109a11..6f1ab3cf42b11 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -3521,7 +3521,7 @@ PHP_FUNCTION(imageflip) break; default: - zend_argument_value_error(2, "must be either IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH"); + zend_argument_value_error(2, "must be one of IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH"); RETURN_THROWS(); } diff --git a/ext/gd/tests/bug67248.phpt b/ext/gd/tests/bug67248.phpt index 5b5e0e8baec37..c48512e281ebe 100644 --- a/ext/gd/tests/bug67248.phpt +++ b/ext/gd/tests/bug67248.phpt @@ -19,7 +19,7 @@ for($i=0;$i<7;$i++) { !! [TypeError] imageaffinematrixget(): Argument #1 ($type) must be of type array when using translate or scale !! [TypeError] imageaffinematrixget(): Argument #1 ($type) must be of type array when using translate or scale -Notice: Object of class stdClass could not be converted to float in %s on line %d +Warning: Object of class stdClass could not be converted to float in %s on line %d array(6) { [0]=> float(%f) @@ -35,7 +35,7 @@ array(6) { float(0) } -Notice: Object of class stdClass could not be converted to float in %s on line %d +Warning: Object of class stdClass could not be converted to float in %s on line %d array(6) { [0]=> float(1) @@ -51,7 +51,7 @@ array(6) { float(0) } -Notice: Object of class stdClass could not be converted to float in %s on line %d +Warning: Object of class stdClass could not be converted to float in %s on line %d array(6) { [0]=> float(1) diff --git a/ext/gettext/gettext.stub.php b/ext/gettext/gettext.stub.php index 7e4bec8c9ac27..6c06d1881dc92 100644 --- a/ext/gettext/gettext.stub.php +++ b/ext/gettext/gettext.stub.php @@ -4,27 +4,27 @@ function textdomain(?string $domain): string {} -function gettext(string $msgid): string {} +function gettext(string $message): string {} /** @alias gettext */ -function _(string $msgid): string {} +function _(string $message): string {} -function dgettext(string $domain, string $msgid): string {} +function dgettext(string $domain, string $message): string {} -function dcgettext(string $domain, string $msgid, int $category): string {} +function dcgettext(string $domain, string $message, int $category): string {} -function bindtextdomain(string $domain, string $dir): string|false {} +function bindtextdomain(string $domain, string $directory): string|false {} #ifdef HAVE_NGETTEXT -function ngettext(string $msgid1, string $msgid2, int $n): string {} +function ngettext(string $singular, string $plural, int $count): string {} #endif #ifdef HAVE_DNGETTEXT -function dngettext(string $domain, string $msgid1, string $msgid2, int $count): string {} +function dngettext(string $domain, string $singular, string $plural, int $count): string {} #endif #ifdef HAVE_DCNGETTEXT -function dcngettext(string $domain, string $msgid1, string $msgid2, int $count, int $category): string {} +function dcngettext(string $domain, string $singular, string $plural, int $count, int $category): string {} #endif #ifdef HAVE_BIND_TEXTDOMAIN_CODESET diff --git a/ext/gettext/gettext_arginfo.h b/ext/gettext/gettext_arginfo.h index b0a8664196050..a00e361bc9c64 100644 --- a/ext/gettext/gettext_arginfo.h +++ b/ext/gettext/gettext_arginfo.h @@ -1,45 +1,45 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a8b64ae24724f0552a62cd4146f6cfb3cd75fa19 */ + * Stub hash: 7d0fe93cb15576756edc5aad71deadae67046690 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_textdomain, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gettext, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo__ arginfo_gettext ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dgettext, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dcgettext, 0, 3, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, category, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_bindtextdomain, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, dir, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_END_ARG_INFO() #if defined(HAVE_NGETTEXT) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ngettext, 0, 3, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, singular, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, plural, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) ZEND_END_ARG_INFO() #endif #if defined(HAVE_DNGETTEXT) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dngettext, 0, 4, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, singular, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, plural, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) ZEND_END_ARG_INFO() #endif @@ -47,8 +47,8 @@ ZEND_END_ARG_INFO() #if defined(HAVE_DCNGETTEXT) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dcngettext, 0, 5, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, msgid2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, singular, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, plural, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, category, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/gettext/tests/44938.phpt b/ext/gettext/tests/44938.phpt index 1de644a9339c2..c1f1c18a41818 100644 --- a/ext/gettext/tests/44938.phpt +++ b/ext/gettext/tests/44938.phpt @@ -106,16 +106,16 @@ try { --EXPECT-- bindtextdomain(): Argument #1 ($domain) is too long dngettext(): Argument #1 ($domain) is too long -dngettext(): Argument #2 ($msgid1) is too long -dngettext(): Argument #3 ($msgid2) is too long -gettext(): Argument #1 ($msgid) is too long -ngettext(): Argument #1 ($msgid1) is too long -ngettext(): Argument #2 ($msgid2) is too long +dngettext(): Argument #2 ($singular) is too long +dngettext(): Argument #3 ($plural) is too long +gettext(): Argument #1 ($message) is too long +ngettext(): Argument #1 ($singular) is too long +ngettext(): Argument #2 ($plural) is too long dcgettext(): Argument #1 ($domain) is too long -dcgettext(): Argument #2 ($msgid) is too long +dcgettext(): Argument #2 ($message) is too long dcngettext(): Argument #1 ($domain) is too long -dcngettext(): Argument #2 ($msgid1) is too long -dcngettext(): Argument #3 ($msgid2) is too long +dcngettext(): Argument #2 ($singular) is too long +dcngettext(): Argument #3 ($plural) is too long dgettext(): Argument #1 ($domain) is too long -dgettext(): Argument #2 ($msgid) is too long +dgettext(): Argument #2 ($message) is too long textdomain(): Argument #1 ($domain) is too long diff --git a/ext/gmp/gmp.stub.php b/ext/gmp/gmp.stub.php index 8f2c6ed944fd2..729ae37245aa6 100644 --- a/ext/gmp/gmp.stub.php +++ b/ext/gmp/gmp.stub.php @@ -6,76 +6,76 @@ class GMP { } -function gmp_init(int|string $number, int $base = 0): GMP {} +function gmp_init(int|string $num, int $base = 0): GMP {} -function gmp_import(string $data, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): GMP {} +function gmp_import(string $data, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): GMP {} -function gmp_export(GMP|int|string $gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {} +function gmp_export(GMP|int|string $num, int $word_size = 1, int $flags = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string {} -function gmp_intval(GMP|int|string $gmpnumber): int {} +function gmp_intval(GMP|int|string $num): int {} -function gmp_strval(GMP|int|string $gmpnumber, int $base = 10): string {} +function gmp_strval(GMP|int|string $num, int $base = 10): string {} -function gmp_add(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_add(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_sub(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_sub(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_mul(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_mul(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_div_qr(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): array {} +function gmp_div_qr(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): array {} -function gmp_div_q(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {} +function gmp_div_q(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {} -function gmp_div_r(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {} +function gmp_div_r(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {} /** @alias gmp_div_q */ -function gmp_div(GMP|int|string $a, GMP|int|string $b, int $round = GMP_ROUND_ZERO): GMP {} +function gmp_div(GMP|int|string $num1, GMP|int|string $num2, int $rounding_mode = GMP_ROUND_ZERO): GMP {} -function gmp_mod(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_mod(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_divexact(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_divexact(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_neg(GMP|int|string $a): GMP {} +function gmp_neg(GMP|int|string $num): GMP {} -function gmp_abs(GMP|int|string $a): GMP {} +function gmp_abs(GMP|int|string $num): GMP {} -function gmp_fact(GMP|int|string $a): GMP {} +function gmp_fact(GMP|int|string $num): GMP {} -function gmp_sqrt(GMP|int|string $a): GMP {} +function gmp_sqrt(GMP|int|string $num): GMP {} -function gmp_sqrtrem(GMP|int|string $a): array {} +function gmp_sqrtrem(GMP|int|string $num): array {} -function gmp_root(GMP|int|string $a, int $nth): GMP {} +function gmp_root(GMP|int|string $num, int $nth): GMP {} -function gmp_rootrem(GMP|int|string $a, int $nth): array {} +function gmp_rootrem(GMP|int|string $num, int $nth): array {} -function gmp_pow(GMP|int|string $base, int $exp): GMP {} +function gmp_pow(GMP|int|string $num, int $exponent): GMP {} -function gmp_powm(GMP|int|string $base, GMP|int|string $exp, GMP|int|string $mod): GMP {} +function gmp_powm(GMP|int|string $num, GMP|int|string $exponent, GMP|int|string $modulus): GMP {} -function gmp_perfect_square(GMP|int|string $a): bool {} +function gmp_perfect_square(GMP|int|string $num): bool {} -function gmp_perfect_power(GMP|int|string $a): bool {} +function gmp_perfect_power(GMP|int|string $num): bool {} -function gmp_prob_prime(GMP|int|string $a, int $reps = 10): int {} +function gmp_prob_prime(GMP|int|string $num, int $repetitions = 10): int {} -function gmp_gcd(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_gcd(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_gcdext(GMP|int|string $a, GMP|int|string $b): array {} +function gmp_gcdext(GMP|int|string $num1, GMP|int|string $num2): array {} -function gmp_lcm(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_invert(GMP|int|string $a, GMP|int|string $b): GMP|false {} +function gmp_invert(GMP|int|string $num1, GMP|int|string $num2): GMP|false {} -function gmp_jacobi(GMP|int|string $a, GMP|int|string $b): int {} +function gmp_jacobi(GMP|int|string $num1, GMP|int|string $num2): int {} -function gmp_legendre(GMP|int|string $a, GMP|int|string $b): int {} +function gmp_legendre(GMP|int|string $num1, GMP|int|string $num2): int {} -function gmp_kronecker(GMP|int|string $a, GMP|int|string $b): int {} +function gmp_kronecker(GMP|int|string $num1, GMP|int|string $num2): int {} -function gmp_cmp(GMP|int|string $a, GMP|int|string $b): int {} +function gmp_cmp(GMP|int|string $num1, GMP|int|string $num2): int {} -function gmp_sign(GMP|int|string $a): int {} +function gmp_sign(GMP|int|string $num): int {} function gmp_random_seed(GMP|int|string $seed): void {} @@ -83,28 +83,28 @@ function gmp_random_bits(int $bits): GMP {} function gmp_random_range(GMP|int|string $min, GMP|int|string $max): GMP {} -function gmp_and(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_and(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_or(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_or(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_com(GMP|int|string $a): GMP {} +function gmp_com(GMP|int|string $num): GMP {} -function gmp_xor(GMP|int|string $a, GMP|int|string $b): GMP {} +function gmp_xor(GMP|int|string $num1, GMP|int|string $num2): GMP {} -function gmp_setbit(GMP $a, int $index, bool $set_clear = true): void {} +function gmp_setbit(GMP $num, int $index, bool $value = true): void {} -function gmp_clrbit(GMP $a, int $index): void {} +function gmp_clrbit(GMP $num, int $index): void {} -function gmp_testbit(GMP|int|string $a, int $index): bool {} +function gmp_testbit(GMP|int|string $num, int $index): bool {} -function gmp_scan0(GMP|int|string $a, int $start): int {} +function gmp_scan0(GMP|int|string $num1, int $start): int {} -function gmp_scan1(GMP|int|string $a, int $start): int {} +function gmp_scan1(GMP|int|string $num1, int $start): int {} -function gmp_popcount(GMP|int|string $a): int {} +function gmp_popcount(GMP|int|string $num): int {} -function gmp_hamdist(GMP|int|string $a, GMP|int|string $b): int {} +function gmp_hamdist(GMP|int|string $num1, GMP|int|string $num2): int {} -function gmp_nextprime(GMP|int|string $a): GMP {} +function gmp_nextprime(GMP|int|string $num): GMP {} -function gmp_binomial(GMP|int|string $a, int $b): GMP {} +function gmp_binomial(GMP|int|string $n, int $k): GMP {} diff --git a/ext/gmp/gmp_arginfo.h b/ext/gmp/gmp_arginfo.h index 9f4a44f6d7954..fd341edbb565d 100644 --- a/ext/gmp/gmp_arginfo.h +++ b/ext/gmp/gmp_arginfo.h @@ -1,35 +1,35 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: fe4ff47c3359705bf2b1a64a882659fabd370bab */ + * Stub hash: a1eb4fd58c0b2155692611386c77035f1ef11c2c */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_init, 0, 1, GMP, 0) - ZEND_ARG_TYPE_MASK(0, number, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_import, 0, 1, GMP, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, word_size, IS_LONG, 0, "1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "GMP_MSW_FIRST | GMP_NATIVE_ENDIAN") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "GMP_MSW_FIRST | GMP_NATIVE_ENDIAN") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_export, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, gmpnumber, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, word_size, IS_LONG, 0, "1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "GMP_MSW_FIRST | GMP_NATIVE_ENDIAN") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "GMP_MSW_FIRST | GMP_NATIVE_ENDIAN") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_intval, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, gmpnumber, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_strval, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, gmpnumber, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_LONG, 0, "10") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_add, 0, 2, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num2, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_sub arginfo_gmp_add @@ -37,15 +37,15 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_mul arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_div_qr, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, round, IS_LONG, 0, "GMP_ROUND_ZERO") + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num2, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rounding_mode, IS_LONG, 0, "GMP_ROUND_ZERO") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_div_q, 0, 2, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, round, IS_LONG, 0, "GMP_ROUND_ZERO") + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num2, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rounding_mode, IS_LONG, 0, "GMP_ROUND_ZERO") ZEND_END_ARG_INFO() #define arginfo_gmp_div_r arginfo_gmp_div_q @@ -57,7 +57,7 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_divexact arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_neg, 0, 1, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_abs arginfo_gmp_neg @@ -67,58 +67,58 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_sqrt arginfo_gmp_neg ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_sqrtrem, 0, 1, IS_ARRAY, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_root, 0, 2, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, nth, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_rootrem, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, nth, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_pow, 0, 2, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, base, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO(0, exp, IS_LONG, 0) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, exponent, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_powm, 0, 3, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, base, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, exp, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, mod, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, exponent, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, modulus, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_perfect_square, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_perfect_power arginfo_gmp_perfect_square ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_prob_prime, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, reps, IS_LONG, 0, "10") + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, repetitions, IS_LONG, 0, "10") ZEND_END_ARG_INFO() #define arginfo_gmp_gcd arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_gcdext, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num2, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_lcm arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_gmp_invert, 0, 2, GMP, MAY_BE_FALSE) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num2, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_jacobi, 0, 2, IS_LONG, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_OBJ_TYPE_MASK(0, b, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num2, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_gmp_legendre arginfo_gmp_jacobi @@ -127,9 +127,7 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_cmp arginfo_gmp_jacobi -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_sign, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() +#define arginfo_gmp_sign arginfo_gmp_intval ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_random_seed, 0, 1, IS_VOID, 0) ZEND_ARG_OBJ_TYPE_MASK(0, seed, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) @@ -153,37 +151,37 @@ ZEND_END_ARG_INFO() #define arginfo_gmp_xor arginfo_gmp_add ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_setbit, 0, 2, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(0, a, GMP, 0) + ZEND_ARG_OBJ_INFO(0, num, GMP, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, set_clear, _IS_BOOL, 0, "true") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_clrbit, 0, 2, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(0, a, GMP, 0) + ZEND_ARG_OBJ_INFO(0, num, GMP, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_testbit, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gmp_scan0, 0, 2, IS_LONG, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_OBJ_TYPE_MASK(0, num1, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_gmp_scan1 arginfo_gmp_scan0 -#define arginfo_gmp_popcount arginfo_gmp_sign +#define arginfo_gmp_popcount arginfo_gmp_intval #define arginfo_gmp_hamdist arginfo_gmp_jacobi #define arginfo_gmp_nextprime arginfo_gmp_neg ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_binomial, 0, 2, GMP, 0) - ZEND_ARG_OBJ_TYPE_MASK(0, a, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO(0, b, IS_LONG, 0) + ZEND_ARG_OBJ_TYPE_MASK(0, n, GMP, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, k, IS_LONG, 0) ZEND_END_ARG_INFO() diff --git a/ext/gmp/tests/003.phpt b/ext/gmp/tests/003.phpt index 7a84d3f8d0151..70613eb94b046 100644 --- a/ext/gmp/tests/003.phpt +++ b/ext/gmp/tests/003.phpt @@ -35,7 +35,7 @@ Check for number base recognition } ?> --EXPECT-- -gmp_init(): Argument #1 ($number) is not an integer string +gmp_init(): Argument #1 ($num) is not an integer string 1234 1234 10011010010 diff --git a/ext/gmp/tests/bug66872.phpt b/ext/gmp/tests/bug66872.phpt index c44d4c807e8a0..e4090176de538 100644 --- a/ext/gmp/tests/bug66872.phpt +++ b/ext/gmp/tests/bug66872.phpt @@ -13,4 +13,4 @@ try { ?> --EXPECT-- -gmp_testbit(): Argument #1 ($a) is not an integer string +gmp_testbit(): Argument #1 ($num) is not an integer string diff --git a/ext/gmp/tests/gmp_abs.phpt b/ext/gmp/tests/gmp_abs.phpt index 0fb8ba5f1a291..57b0dde25c821 100644 --- a/ext/gmp/tests/gmp_abs.phpt +++ b/ext/gmp/tests/gmp_abs.phpt @@ -44,14 +44,14 @@ try { echo "Done\n"; ?> --EXPECT-- -gmp_abs(): Argument #1 ($a) is not an integer string +gmp_abs(): Argument #1 ($num) is not an integer string string(1) "0" string(1) "0" -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, float given +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, float given string(21) "111111111111111111111" string(21) "111111111111111111111" string(1) "0" -gmp_abs(): Argument #1 ($a) is not an integer string -gmp_abs(): Argument #1 ($a) is not an integer string -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_abs(): Argument #1 ($num) is not an integer string +gmp_abs(): Argument #1 ($num) is not an integer string +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_and.phpt b/ext/gmp/tests/gmp_and.phpt index 26ed3dda3761b..aa40a12aa4b54 100644 --- a/ext/gmp/tests/gmp_and.phpt +++ b/ext/gmp/tests/gmp_and.phpt @@ -47,10 +47,10 @@ string(5) "40994" string(3) "515" string(4) "3333" string(4) "4544" -gmp_and(): Argument #1 ($a) is not an integer string +gmp_and(): Argument #1 ($num1) is not an integer string string(4) "1536" string(15) "424703623692768" -gmp_and(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_and(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_and(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_and(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_and(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_and(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_binomial.phpt b/ext/gmp/tests/gmp_binomial.phpt index b6db19c35cc7c..eadf175ac9e0a 100644 --- a/ext/gmp/tests/gmp_binomial.phpt +++ b/ext/gmp/tests/gmp_binomial.phpt @@ -67,4 +67,4 @@ object(GMP)#2 (1) { ["num"]=> string(1) "7" } -gmp_binomial(): Argument #2 ($b) must be greater than or equal to 0 +gmp_binomial(): Argument #2 ($k) must be greater than or equal to 0 diff --git a/ext/gmp/tests/gmp_clrbit.phpt b/ext/gmp/tests/gmp_clrbit.phpt index 5dc0ff4dbb8d9..7bcf6969e9df3 100644 --- a/ext/gmp/tests/gmp_clrbit.phpt +++ b/ext/gmp/tests/gmp_clrbit.phpt @@ -52,5 +52,5 @@ gmp_clrbit(): Argument #2 ($index) must be greater than or equal to 0 string(7) "1000000" string(7) "1000000" string(30) "238462734628347239571822592658" -gmp_clrbit(): Argument #1 ($a) must be of type GMP, array given +gmp_clrbit(): Argument #1 ($num) must be of type GMP, array given Done diff --git a/ext/gmp/tests/gmp_cmp.phpt b/ext/gmp/tests/gmp_cmp.phpt index 35c2796ffaae2..45ca865dc6344 100644 --- a/ext/gmp/tests/gmp_cmp.phpt +++ b/ext/gmp/tests/gmp_cmp.phpt @@ -34,5 +34,5 @@ int(1) int(-1) bool(true) int(0) -gmp_cmp(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_cmp(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_com.phpt b/ext/gmp/tests/gmp_com.phpt index 71f9f39e96a40..1cc0aae428e4a 100644 --- a/ext/gmp/tests/gmp_com.phpt +++ b/ext/gmp/tests/gmp_com.phpt @@ -33,12 +33,12 @@ echo "Done\n"; --EXPECT-- string(2) "-1" string(2) "-1" -gmp_com(): Argument #1 ($a) is not an integer string +gmp_com(): Argument #1 ($num) is not an integer string string(14) "-2394876545679" string(3) "110" string(7) "-874654" string(4) "9875" string(9) "-98765468" string(12) "-98765463338" -gmp_com(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_com(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_q.phpt b/ext/gmp/tests/gmp_div_q.phpt index 08d82c6132c62..a9adeab24ce7d 100644 --- a/ext/gmp/tests/gmp_div_q.phpt +++ b/ext/gmp/tests/gmp_div_q.phpt @@ -51,7 +51,7 @@ object(GMP)#2 (1) { ["num"]=> string(1) "0" } -gmp_div_q(): Argument #3 ($round) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF +gmp_div_q(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF object(GMP)#1 (1) { ["num"]=> string(4) "9131" @@ -76,6 +76,6 @@ object(GMP)#1 (1) { ["num"]=> string(4) "9131" } -gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int, resource given -gmp_div_q(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_div_q(): Argument #1 ($num1) must be of type GMP|string|int, resource given +gmp_div_q(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_qr.phpt b/ext/gmp/tests/gmp_div_qr.phpt index 03c5facac2a48..a31c39c731cf5 100644 --- a/ext/gmp/tests/gmp_div_qr.phpt +++ b/ext/gmp/tests/gmp_div_qr.phpt @@ -74,7 +74,7 @@ array(2) { string(5) "12653" } } -gmp_div_qr(): Argument #3 ($round) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF +gmp_div_qr(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF array(2) { [0]=> object(GMP)#4 (1) { @@ -159,6 +159,6 @@ array(2) { string(2) "10" } } -gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int, resource given -gmp_div_qr(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_div_qr(): Argument #1 ($num1) must be of type GMP|string|int, resource given +gmp_div_qr(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_r.phpt b/ext/gmp/tests/gmp_div_r.phpt index eab9286fe763b..2372474bc89cd 100644 --- a/ext/gmp/tests/gmp_div_r.phpt +++ b/ext/gmp/tests/gmp_div_r.phpt @@ -51,7 +51,7 @@ object(GMP)#3 (1) { ["num"]=> string(5) "12653" } -gmp_div_r(): Argument #3 ($round) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF +gmp_div_r(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF object(GMP)#2 (1) { ["num"]=> string(2) "10" @@ -76,6 +76,6 @@ object(GMP)#3 (1) { ["num"]=> string(2) "10" } -gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int, resource given -gmp_div_r(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_div_r(): Argument #1 ($num1) must be of type GMP|string|int, resource given +gmp_div_r(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_export.phpt b/ext/gmp/tests/gmp_export.phpt index d3ccfb3b1e5fb..6877e5624d680 100644 --- a/ext/gmp/tests/gmp_export.phpt +++ b/ext/gmp/tests/gmp_export.phpt @@ -78,5 +78,5 @@ try { bool(true) gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1 gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1 -gmp_export(): Argument #3 ($options) cannot use multiple word order options -gmp_export(): Argument #3 ($options) cannot use multiple endian options +gmp_export(): Argument #3 ($flags) cannot use multiple word order options +gmp_export(): Argument #3 ($flags) cannot use multiple endian options diff --git a/ext/gmp/tests/gmp_fact.phpt b/ext/gmp/tests/gmp_fact.phpt index 81f16019f0928..d2b98f78c28c9 100644 --- a/ext/gmp/tests/gmp_fact.phpt +++ b/ext/gmp/tests/gmp_fact.phpt @@ -48,16 +48,16 @@ echo "Done\n"; ?> --EXPECT-- string(1) "1" -gmp_fact(): Argument #1 ($a) is not an integer string +gmp_fact(): Argument #1 ($num) is not an integer string string(1) "1" -gmp_fact(): Argument #1 ($a) must be greater than or equal to 0 -gmp_fact(): Argument #1 ($a) must be greater than or equal to 0 +gmp_fact(): Argument #1 ($num) must be greater than or equal to 0 +gmp_fact(): Argument #1 ($num) must be greater than or equal to 0 string(1) "1" string(19) "2432902008176640000" string(65) "30414093201713378043612608166064768844377641568960512000000000000" string(7) "3628800" string(1) "1" string(9) "479001600" -gmp_fact(): Argument #1 ($a) must be greater than or equal to 0 -gmp_fact(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_fact(): Argument #1 ($num) must be greater than or equal to 0 +gmp_fact(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_gcdext.phpt b/ext/gmp/tests/gmp_gcdext.phpt index abab8cdfdcd83..0f4b23af7d9f9 100644 --- a/ext/gmp/tests/gmp_gcdext.phpt +++ b/ext/gmp/tests/gmp_gcdext.phpt @@ -63,6 +63,6 @@ string(1) "1" string(1) "1" string(3) "195" string(3) "195" -gmp_gcdext(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_gcdext(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_gcdext(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_gcdext(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_hamdist.phpt b/ext/gmp/tests/gmp_hamdist.phpt index c4b28949411fd..8e216e39a080b 100644 --- a/ext/gmp/tests/gmp_hamdist.phpt +++ b/ext/gmp/tests/gmp_hamdist.phpt @@ -42,7 +42,7 @@ int(-1) int(43) int(0) int(26) -gmp_hamdist(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_hamdist(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_hamdist(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_hamdist(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_hamdist(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_hamdist(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_import.phpt b/ext/gmp/tests/gmp_import.phpt index 59bf652a1f3cf..026ab079d5637 100644 --- a/ext/gmp/tests/gmp_import.phpt +++ b/ext/gmp/tests/gmp_import.phpt @@ -95,5 +95,5 @@ gmp_import(): Argument #2 ($word_size) must be greater than or equal to 1 gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) -gmp_import(): Argument #3 ($options) cannot use multiple word order options -gmp_import(): Argument #3 ($options) cannot use multiple endian options +gmp_import(): Argument #3 ($flags) cannot use multiple word order options +gmp_import(): Argument #3 ($flags) cannot use multiple endian options diff --git a/ext/gmp/tests/gmp_init.phpt b/ext/gmp/tests/gmp_init.phpt index b600a020ec7f9..045ddc668e38e 100644 --- a/ext/gmp/tests/gmp_init.phpt +++ b/ext/gmp/tests/gmp_init.phpt @@ -38,7 +38,7 @@ object(GMP)#1 (1) { } string(8) "98765678" gmp_init(): Argument #2 ($base) must be between 2 and 62 -gmp_init(): Argument #1 ($number) is not an integer string -gmp_init(): Argument #1 ($number) is not an integer string -gmp_init(): Argument #1 ($number) is not an integer string +gmp_init(): Argument #1 ($num) is not an integer string +gmp_init(): Argument #1 ($num) is not an integer string +gmp_init(): Argument #1 ($num) is not an integer string Done diff --git a/ext/gmp/tests/gmp_intval.phpt b/ext/gmp/tests/gmp_intval.phpt index 9540f7a432ca1..4642d9ec5229e 100644 --- a/ext/gmp/tests/gmp_intval.phpt +++ b/ext/gmp/tests/gmp_intval.phpt @@ -44,8 +44,8 @@ int(-2349828) int(2342344) int(1) int(12345678) -gmp_intval(): Argument #1 ($gmpnumber) is not an integer string -gmp_intval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, stdClass given -gmp_intval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, array given -gmp_intval(): Argument #1 ($gmpnumber) is not an integer string +gmp_intval(): Argument #1 ($num) is not an integer string +gmp_intval(): Argument #1 ($num) must be of type GMP|string|int, stdClass given +gmp_intval(): Argument #1 ($num) must be of type GMP|string|int, array given +gmp_intval(): Argument #1 ($num) is not an integer string Done diff --git a/ext/gmp/tests/gmp_invert.phpt b/ext/gmp/tests/gmp_invert.phpt index b5ab666061a25..888802f25dd65 100644 --- a/ext/gmp/tests/gmp_invert.phpt +++ b/ext/gmp/tests/gmp_invert.phpt @@ -53,7 +53,7 @@ string(1) "0" string(1) "0" string(22) "3498273496234234523441" string(1) "1" -gmp_invert(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_invert(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_invert(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_invert(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_invert(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_invert(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_jacobi.phpt b/ext/gmp/tests/gmp_jacobi.phpt index 116442457819b..da95b805facec 100644 --- a/ext/gmp/tests/gmp_jacobi.phpt +++ b/ext/gmp/tests/gmp_jacobi.phpt @@ -56,7 +56,7 @@ string(1) "0" string(2) "-1" string(1) "0" string(2) "-1" -gmp_jacobi(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_jacobi(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_jacobi(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_jacobi(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_jacobi(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_jacobi(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_legendre.phpt b/ext/gmp/tests/gmp_legendre.phpt index 258e453e4de18..fb8ad08423811 100644 --- a/ext/gmp/tests/gmp_legendre.phpt +++ b/ext/gmp/tests/gmp_legendre.phpt @@ -56,7 +56,7 @@ string(1) "0" string(2) "-1" string(1) "0" string(2) "-1" -gmp_legendre(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_legendre(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_legendre(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_legendre(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_legendre(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_legendre(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_mod.phpt b/ext/gmp/tests/gmp_mod.phpt index 90868ab9d99da..a20f871df9561 100644 --- a/ext/gmp/tests/gmp_mod.phpt +++ b/ext/gmp/tests/gmp_mod.phpt @@ -33,7 +33,7 @@ var_dump(gmp_mod($a, $b)); echo "Done\n"; ?> --EXPECT-- -gmp_mod(): Argument #1 ($a) is not an integer string +gmp_mod(): Argument #1 ($num1) is not an integer string object(GMP)#2 (1) { ["num"]=> string(1) "0" @@ -43,7 +43,7 @@ object(GMP)#2 (1) { string(1) "0" } Modulo by zero -gmp_mod(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_mod(): Argument #1 ($num1) must be of type GMP|string|int, array given object(GMP)#4 (1) { ["num"]=> string(5) "31161" diff --git a/ext/gmp/tests/gmp_neg.phpt b/ext/gmp/tests/gmp_neg.phpt index 5d8e80cd5b620..bed25722bb52e 100644 --- a/ext/gmp/tests/gmp_neg.phpt +++ b/ext/gmp/tests/gmp_neg.phpt @@ -36,9 +36,9 @@ int(0) int(-1) int(1) int(1) -gmp_neg(): Argument #1 ($a) is not an integer string +gmp_neg(): Argument #1 ($num) is not an integer string int(0) int(0) string(21) "-12345678901234567890" -gmp_neg(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_neg(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_nextprime.phpt b/ext/gmp/tests/gmp_nextprime.phpt index e2fa2703cbbc8..7d252aee65985 100644 --- a/ext/gmp/tests/gmp_nextprime.phpt +++ b/ext/gmp/tests/gmp_nextprime.phpt @@ -43,7 +43,7 @@ string(1) "2" string(1) "2" string(4) "1009" string(6) "100003" -gmp_nextprime(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_nextprime(): Argument #1 ($a) is not an integer string -gmp_nextprime(): Argument #1 ($a) must be of type GMP|string|int, stdClass given +gmp_nextprime(): Argument #1 ($num) must be of type GMP|string|int, array given +gmp_nextprime(): Argument #1 ($num) is not an integer string +gmp_nextprime(): Argument #1 ($num) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_or.phpt b/ext/gmp/tests/gmp_or.phpt index 5a34a82addf91..75f631e326817 100644 --- a/ext/gmp/tests/gmp_or.phpt +++ b/ext/gmp/tests/gmp_or.phpt @@ -46,10 +46,10 @@ string(6) "517363" string(10) "2342341163" string(2) "-1" string(3) "-19" -gmp_or(): Argument #1 ($a) is not an integer string +gmp_or(): Argument #1 ($num1) is not an integer string string(15) "987657876576252" string(21) "987658441719689394144" -gmp_or(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_or(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_or(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_or(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_or(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_or(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_perfect_square.phpt b/ext/gmp/tests/gmp_perfect_square.phpt index d6cd09e40ef49..f96f39091f3de 100644 --- a/ext/gmp/tests/gmp_perfect_square.phpt +++ b/ext/gmp/tests/gmp_perfect_square.phpt @@ -41,5 +41,5 @@ bool(false) bool(false) bool(true) bool(false) -gmp_perfect_square(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_perfect_square(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_popcount.phpt b/ext/gmp/tests/gmp_popcount.phpt index fa1a6172d4fb6..ddd1c2434c20a 100644 --- a/ext/gmp/tests/gmp_popcount.phpt +++ b/ext/gmp/tests/gmp_popcount.phpt @@ -28,5 +28,5 @@ int(10) int(31) int(-1) int(20) -gmp_popcount(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_popcount(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_pow.phpt b/ext/gmp/tests/gmp_pow.phpt index d4d20f2ce796a..ab87e7f093309 100644 --- a/ext/gmp/tests/gmp_pow.phpt +++ b/ext/gmp/tests/gmp_pow.phpt @@ -49,13 +49,13 @@ string(4) "1024" string(5) "-2048" string(4) "1024" string(1) "1" -gmp_pow(): Argument #2 ($exp) must be greater than or equal to 0 +gmp_pow(): Argument #2 ($exponent) must be greater than or equal to 0 string(4) "1024" string(14) "10240000000000" string(17) "97656250000000000" -gmp_pow(): Argument #2 ($exp) must be greater than or equal to 0 +gmp_pow(): Argument #2 ($exponent) must be greater than or equal to 0 string(14) "10240000000000" string(14) "10240000000000" -gmp_pow(): Argument #2 ($exp) must be of type int, array given -gmp_pow(): Argument #1 ($base) must be of type GMP|string|int, array given +gmp_pow(): Argument #2 ($exponent) must be of type int, array given +gmp_pow(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_pown.phpt b/ext/gmp/tests/gmp_pown.phpt index 76d5576e47581..49bc308e156dc 100644 --- a/ext/gmp/tests/gmp_pown.phpt +++ b/ext/gmp/tests/gmp_pown.phpt @@ -75,11 +75,11 @@ string(3) "171" string(3) "371" Modulo by zero Modulo by zero -gmp_powm(): Argument #1 ($base) must be of type GMP|string|int, array given -gmp_powm(): Argument #2 ($exp) must be of type GMP|string|int, array given -gmp_powm(): Argument #2 ($exp) must be of type GMP|string|int, TypeError given -gmp_powm(): Argument #1 ($base) must be of type GMP|string|int, array given -gmp_powm(): Argument #2 ($exp) must be greater than or equal to 0 +gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given +gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, array given +gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, TypeError given +gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given +gmp_powm(): Argument #2 ($exponent) must be greater than or equal to 0 object(GMP)#6 (1) { ["num"]=> string(1) "1" diff --git a/ext/gmp/tests/gmp_prob_prime.phpt b/ext/gmp/tests/gmp_prob_prime.phpt index efc5cf4e165ae..be8a8d0f6859f 100644 --- a/ext/gmp/tests/gmp_prob_prime.phpt +++ b/ext/gmp/tests/gmp_prob_prime.phpt @@ -75,5 +75,5 @@ int(0) int(0) int(0) int(0) -gmp_prob_prime(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_prob_prime(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_scan0.phpt b/ext/gmp/tests/gmp_scan0.phpt index 017148c0119b0..c949f6a3beef6 100644 --- a/ext/gmp/tests/gmp_scan0.phpt +++ b/ext/gmp/tests/gmp_scan0.phpt @@ -34,5 +34,5 @@ int(0) int(5) int(200) int(13) -gmp_scan0(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_scan0(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_scan1.phpt b/ext/gmp/tests/gmp_scan1.phpt index ba480e3e9665e..d625f0cb86343 100644 --- a/ext/gmp/tests/gmp_scan1.phpt +++ b/ext/gmp/tests/gmp_scan1.phpt @@ -34,5 +34,5 @@ int(12) int(9) int(-1) int(10) -gmp_scan1(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_scan1(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_setbit.phpt b/ext/gmp/tests/gmp_setbit.phpt index 02857c7e52ed9..6dad79f5d3b4e 100644 --- a/ext/gmp/tests/gmp_setbit.phpt +++ b/ext/gmp/tests/gmp_setbit.phpt @@ -59,6 +59,6 @@ string(1) "7" string(12) "100008388608" string(12) "100000000000" string(12) "100000000008" -gmp_setbit(): Argument #1 ($a) must be of type GMP, string given -gmp_setbit(): Argument #1 ($a) must be of type GMP, array given +gmp_setbit(): Argument #1 ($num) must be of type GMP, string given +gmp_setbit(): Argument #1 ($num) must be of type GMP, array given Done diff --git a/ext/gmp/tests/gmp_sign.phpt b/ext/gmp/tests/gmp_sign.phpt index 01567bb5c43f8..7d7e67177c996 100644 --- a/ext/gmp/tests/gmp_sign.phpt +++ b/ext/gmp/tests/gmp_sign.phpt @@ -36,7 +36,7 @@ int(1) int(0) int(1) int(-1) -gmp_sign(): Argument #1 ($a) is not an integer string -gmp_init(): Argument #1 ($number) is not an integer string -gmp_sign(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_sign(): Argument #1 ($num) is not an integer string +gmp_init(): Argument #1 ($num) is not an integer string +gmp_sign(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_sqrt.phpt b/ext/gmp/tests/gmp_sqrt.phpt index 19a44121b6593..dcd9c58373d08 100644 --- a/ext/gmp/tests/gmp_sqrt.phpt +++ b/ext/gmp/tests/gmp_sqrt.phpt @@ -40,13 +40,13 @@ try { echo "Done\n"; ?> --EXPECT-- -gmp_sqrt(): Argument #1 ($a) must be greater than or equal to 0 -gmp_sqrt(): Argument #1 ($a) must be greater than or equal to 0 +gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 +gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 string(1) "0" string(1) "1" string(2) "12" string(1) "0" -gmp_sqrt(): Argument #1 ($a) must be greater than or equal to 0 +gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 string(2) "27" -gmp_sqrt(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_sqrt(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_sqrtrem.phpt b/ext/gmp/tests/gmp_sqrtrem.phpt index 0d63a54ff8e66..b415711bd4f2e 100644 --- a/ext/gmp/tests/gmp_sqrtrem.phpt +++ b/ext/gmp/tests/gmp_sqrtrem.phpt @@ -66,7 +66,7 @@ try { echo "Done\n"; ?> --EXPECT-- -gmp_sqrtrem(): Argument #1 ($a) must be greater than or equal to 0 +gmp_sqrtrem(): Argument #1 ($num) must be greater than or equal to 0 string(1) "0" string(1) "0" string(1) "1" @@ -83,8 +83,8 @@ string(4) "1000" string(1) "0" string(4) "1000" string(1) "1" -gmp_sqrtrem(): Argument #1 ($a) must be greater than or equal to 0 +gmp_sqrtrem(): Argument #1 ($num) must be greater than or equal to 0 string(4) "1000" string(1) "1" -gmp_sqrtrem(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_sqrtrem(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_strict_types.phpt b/ext/gmp/tests/gmp_strict_types.phpt index 8a2b5509a5c78..e697afa67533c 100644 --- a/ext/gmp/tests/gmp_strict_types.phpt +++ b/ext/gmp/tests/gmp_strict_types.phpt @@ -48,8 +48,8 @@ object(GMP)#2 (1) { ["num"]=> string(1) "1" } -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, float given -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, bool given -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, bool given -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, null given -gmp_abs(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, float given +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, bool given +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, bool given +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, null given +gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, array given diff --git a/ext/gmp/tests/gmp_strval.phpt b/ext/gmp/tests/gmp_strval.phpt index 234465c294a6b..3aa3e372a9fa4 100644 --- a/ext/gmp/tests/gmp_strval.phpt +++ b/ext/gmp/tests/gmp_strval.phpt @@ -65,9 +65,9 @@ try { echo "Done\n"; ?> --EXPECT-- -gmp_strval(): Argument #1 ($gmpnumber) is not an integer string +gmp_strval(): Argument #1 ($num) is not an integer string gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 -gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, resource given +gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, resource given string(7) "9765456" gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 @@ -76,6 +76,6 @@ string(8) "-3373333" gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 string(8) "-3373333" -gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, array given -gmp_strval(): Argument #1 ($gmpnumber) must be of type GMP|string|int, stdClass given +gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, array given +gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_sub.phpt b/ext/gmp/tests/gmp_sub.phpt index 28a01f86ee640..a1e5a6158305c 100644 --- a/ext/gmp/tests/gmp_sub.phpt +++ b/ext/gmp/tests/gmp_sub.phpt @@ -37,8 +37,8 @@ try { echo "Done\n"; ?> --EXPECT-- -gmp_sub(): Argument #1 ($a) is not an integer string -gmp_sub(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_sub(): Argument #1 ($num1) is not an integer string +gmp_sub(): Argument #1 ($num1) must be of type GMP|string|int, array given object(GMP)#1 (1) { ["num"]=> string(2) "-1" @@ -49,6 +49,6 @@ object(GMP)#3 (1) { string(5) "10001" } string(5) "10001" -gmp_sub(): Argument #2 ($b) must be of type GMP|string|int, stdClass given -gmp_sub(): Argument #1 ($a) must be of type GMP|string|int, stdClass given +gmp_sub(): Argument #2 ($num2) must be of type GMP|string|int, stdClass given +gmp_sub(): Argument #1 ($num1) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_xor.phpt b/ext/gmp/tests/gmp_xor.phpt index d81b5947fcbde..eb99f8c99c9ab 100644 --- a/ext/gmp/tests/gmp_xor.phpt +++ b/ext/gmp/tests/gmp_xor.phpt @@ -46,10 +46,10 @@ string(6) "476369" string(10) "2342340648" string(5) "-3334" string(5) "-4563" -gmp_xor(): Argument #1 ($a) is not an integer string +gmp_xor(): Argument #1 ($num1) is not an integer string string(15) "987657876574716" string(21) "987658017016065701376" -gmp_xor(): Argument #1 ($a) must be of type GMP|string|int, array given -gmp_xor(): Argument #2 ($b) must be of type GMP|string|int, array given -gmp_xor(): Argument #1 ($a) must be of type GMP|string|int, array given +gmp_xor(): Argument #1 ($num1) must be of type GMP|string|int, array given +gmp_xor(): Argument #2 ($num2) must be of type GMP|string|int, array given +gmp_xor(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php index a8f90cd5ec98c..4cce866136b4d 100644 --- a/ext/hash/hash.stub.php +++ b/ext/hash/hash.stub.php @@ -2,25 +2,25 @@ /** @generate-function-entries */ -function hash(string $algo, string $data, bool $raw_output = false): string|false {} +function hash(string $algo, string $data, bool $binary = false): string|false {} -function hash_file(string $algo, string $filename, bool $raw_output = false): string|false {} +function hash_file(string $algo, string $filename, bool $binary = false): string|false {} -function hash_hmac(string $algo, string $data, string $key, bool $raw_output = false): string|false {} +function hash_hmac(string $algo, string $data, string $key, bool $binary = false): string|false {} -function hash_hmac_file(string $algo, string $data, string $key, bool $raw_output = false): string|false {} +function hash_hmac_file(string $algo, string $data, string $key, bool $binary = false): string|false {} -function hash_init(string $algo, int $options = 0, string $key = ""): HashContext {} +function hash_init(string $algo, int $flags = 0, string $key = ""): HashContext {} function hash_update(HashContext $context, string $data): bool {} -/** @param resource $handle */ -function hash_update_stream(HashContext $context, $handle, int $length = -1): int {} +/** @param resource $stream */ +function hash_update_stream(HashContext $context, $stream, int $length = -1): int {} -/** @param resource $stream_context */ +/** @param resource|null $stream_context */ function hash_update_file(HashContext $context, string $filename, $stream_context = null): bool {} -function hash_final(HashContext $context, bool $raw_output = false): string {} +function hash_final(HashContext $context, bool $binary = false): string {} function hash_copy(HashContext $context): HashContext {} @@ -28,22 +28,22 @@ function hash_algos(): array {} function hash_hmac_algos(): array {} -function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $raw_output = false): string {} +function hash_pbkdf2(string $algo, string $password, string $salt, int $iterations, int $length = 0, bool $binary = false): string {} function hash_equals(string $known_string, string $user_string): bool {} -function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = "", string $salt = ""): string {} +function hash_hkdf(string $algo, string $key, int $length = 0, string $info = "", string $salt = ""): string {} #ifdef PHP_MHASH_BC -function mhash_get_block_size(int $hash): int|false {} +function mhash_get_block_size(int $algo): int|false {} -function mhash_get_hash_name(int $hash): string|false {} +function mhash_get_hash_name(int $algo): string|false {} -function mhash_keygen_s2k(int $hash, string $input_password, string $salt, int $bytes): string|false {} +function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {} function mhash_count(): int {} -function mhash(int $hash, string $data, ?string $key = null): string|false {} +function mhash(int $algo, string $data, ?string $key = null): string|false {} #endif final class HashContext diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h index a7837b28481c3..cb8815de35123 100644 --- a/ext/hash/hash_arginfo.h +++ b/ext/hash/hash_arginfo.h @@ -1,30 +1,30 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 28ec46ceae7550c9a4103c98fd7c20364f078289 */ + * Stub hash: 5298231334ab85edd67ae46c33b7e6cffb2ecc53 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_hmac, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() #define arginfo_hash_hmac_file arginfo_hash_hmac ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_init, 0, 1, HashContext, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() @@ -35,7 +35,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_stream, 0, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, HashContext, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() @@ -47,7 +47,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_final, 0, 1, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, context, HashContext, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_copy, 0, 1, HashContext, 0) @@ -65,7 +65,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_pbkdf2, 0, 4, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_equals, 0, 2, _IS_BOOL, 0) @@ -75,7 +75,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_hkdf, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, ikm, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 0, "\"\"") @@ -83,22 +83,22 @@ ZEND_END_ARG_INFO() #if defined(PHP_MHASH_BC) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_block_size, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0) ZEND_END_ARG_INFO() #endif #if defined(PHP_MHASH_BC) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_hash_name, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0) ZEND_END_ARG_INFO() #endif #if defined(PHP_MHASH_BC) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_keygen_s2k, 0, 4, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, input_password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, bytes, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() #endif @@ -109,7 +109,7 @@ ZEND_END_ARG_INFO() #if defined(PHP_MHASH_BC) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, hash, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 1, "null") ZEND_END_ARG_INFO() diff --git a/ext/hash/tests/hash_hkdf_error.phpt b/ext/hash/tests/hash_hkdf_error.phpt index a478420ca46fc..60a887d003d01 100644 --- a/ext/hash/tests/hash_hkdf_error.phpt +++ b/ext/hash/tests/hash_hkdf_error.phpt @@ -61,6 +61,6 @@ trycatch_dump( [ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_hkdf() function with invalid parameters -- -[ValueError] hash_hkdf(): Argument #2 ($ikm) cannot be empty +[ValueError] hash_hkdf(): Argument #2 ($key) cannot be empty [ValueError] hash_hkdf(): Argument #3 ($length) must be greater than or equal to 0 [ValueError] hash_hkdf(): Argument #3 ($length) must be less than or equal to 5100 diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 89ae1b43a4a77..90c209cbcbf00 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -117,8 +117,6 @@ static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, const char *str, size_t nbytes, zend_long offset, zend_long len, const char *enc); -static php_iconv_err_t _php_iconv_strpos(size_t *pretval, const char *haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, zend_long offset, const char *enc); - static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, size_t max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const char *out_charset, const char *enc); static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode); @@ -638,27 +636,22 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, return err; } - if (len < 0) { - if ((len += (total_len - offset)) < 0) { - return PHP_ICONV_ERR_SUCCESS; - } - } - if (offset < 0) { if ((offset += total_len) < 0) { - return PHP_ICONV_ERR_SUCCESS; + offset = 0; } + } else if ((size_t)offset > total_len) { + offset = total_len; } - if((size_t)len > total_len) { + if (len < 0) { + if ((len += (total_len - offset)) < 0) { + len = 0; + } + } else if ((size_t)len > total_len) { len = total_len; } - - if ((size_t)offset > total_len) { - return PHP_ICONV_ERR_SUCCESS; - } - if ((size_t)(offset + len) > total_len ) { /* trying to compute the length */ len = total_len - offset; @@ -753,7 +746,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, static php_iconv_err_t _php_iconv_strpos(size_t *pretval, const char *haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, - zend_long offset, const char *enc) + size_t offset, const char *enc, bool reverse) { char buf[GENERIC_SUPERSET_NBYTES]; @@ -834,49 +827,7 @@ static php_iconv_err_t _php_iconv_strpos(size_t *pretval, break; } } - if (offset >= 0) { - if (cnt >= (size_t)offset) { - if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) { - if (match_ofs == (size_t)-1) { - match_ofs = cnt; - } - ndl_buf_p += GENERIC_SUPERSET_NBYTES; - ndl_buf_left -= GENERIC_SUPERSET_NBYTES; - if (ndl_buf_left == 0) { - *pretval = match_ofs; - break; - } - } else { - size_t i, j, lim; - - i = 0; - j = GENERIC_SUPERSET_NBYTES; - lim = (size_t)(ndl_buf_p - ZSTR_VAL(ndl_buf)); - - while (j < lim) { - if (_php_iconv_memequal(&ZSTR_VAL(ndl_buf)[j], &ZSTR_VAL(ndl_buf)[i], - GENERIC_SUPERSET_NBYTES)) { - i += GENERIC_SUPERSET_NBYTES; - } else { - j -= i; - i = 0; - } - j += GENERIC_SUPERSET_NBYTES; - } - - if (_php_iconv_memequal(buf, &ZSTR_VAL(ndl_buf)[i], sizeof(buf))) { - match_ofs += (lim - i) / GENERIC_SUPERSET_NBYTES; - i += GENERIC_SUPERSET_NBYTES; - ndl_buf_p = &ZSTR_VAL(ndl_buf)[i]; - ndl_buf_left = ZSTR_LEN(ndl_buf) - i; - } else { - match_ofs = (size_t)-1; - ndl_buf_p = ZSTR_VAL(ndl_buf); - ndl_buf_left = ZSTR_LEN(ndl_buf); - } - } - } - } else { + if (cnt >= offset) { if (_php_iconv_memequal(buf, ndl_buf_p, sizeof(buf))) { if (match_ofs == (size_t)-1) { match_ofs = cnt; @@ -885,9 +836,15 @@ static php_iconv_err_t _php_iconv_strpos(size_t *pretval, ndl_buf_left -= GENERIC_SUPERSET_NBYTES; if (ndl_buf_left == 0) { *pretval = match_ofs; - ndl_buf_p = ZSTR_VAL(ndl_buf); - ndl_buf_left = ZSTR_LEN(ndl_buf); - match_ofs = -1; + if (reverse) { + /* If searching backward, continue trying to find a later match. */ + ndl_buf_p = ZSTR_VAL(ndl_buf); + ndl_buf_left = ZSTR_LEN(ndl_buf); + match_ofs = -1; + } else { + /* If searching forward, stop at first match. */ + break; + } } } else { size_t i, j, lim; @@ -927,6 +884,10 @@ static php_iconv_err_t _php_iconv_strpos(size_t *pretval, iconv_close(cd); + if (err == PHP_ICONV_ERR_SUCCESS && offset > cnt) { + return PHP_ICONV_ERR_OUT_BY_BOUNDS; + } + return err; } /* }}} */ @@ -1782,11 +1743,11 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, break; case PHP_ICONV_ERR_CONVERTER: - php_error_docref(NULL, E_NOTICE, "Cannot open converter"); + php_error_docref(NULL, E_WARNING, "Cannot open converter"); break; case PHP_ICONV_ERR_WRONG_CHARSET: - php_error_docref(NULL, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed", + php_error_docref(NULL, E_WARNING, "Wrong encoding, conversion from \"%s\" to \"%s\" is not allowed", in_charset, out_charset); break; @@ -1807,6 +1768,10 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, php_error_docref(NULL, E_WARNING, "Malformed string"); break; + case PHP_ICONV_ERR_OUT_BY_BOUNDS: + zend_argument_value_error(3, "must be contained in argument #1 ($haystack)"); + break; + default: /* other error */ php_error_docref(NULL, E_NOTICE, "Unknown error (%d)", errno); @@ -1834,7 +1799,7 @@ PHP_FUNCTION(iconv_strlen) if (charset == NULL) { charset = get_internal_encoding(); } else if (charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -1870,7 +1835,7 @@ PHP_FUNCTION(iconv_substr) if (charset == NULL) { charset = get_internal_encoding(); } else if (charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -1911,7 +1876,7 @@ PHP_FUNCTION(iconv_strpos) if (charset == NULL) { charset = get_internal_encoding(); } else if (charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -1924,17 +1889,19 @@ PHP_FUNCTION(iconv_strpos) } offset += haystk_len; if (offset < 0) { /* If offset before start */ - php_error_docref(NULL, E_WARNING, "Offset not contained in string."); - RETURN_FALSE; + zend_argument_value_error(3, "must be contained in argument #1 ($haystack)"); + RETURN_THROWS(); } } if (ZSTR_LEN(ndl) < 1) { + // TODO: Support empty needles! RETURN_FALSE; } - err = _php_iconv_strpos(&retval, ZSTR_VAL(haystk), ZSTR_LEN(haystk), ZSTR_VAL(ndl), ZSTR_LEN(ndl), - offset, charset); + err = _php_iconv_strpos( + &retval, ZSTR_VAL(haystk), ZSTR_LEN(haystk), ZSTR_VAL(ndl), ZSTR_LEN(ndl), + offset, charset, /* reverse */ false); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset); if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) { @@ -1970,12 +1937,13 @@ PHP_FUNCTION(iconv_strrpos) if (charset == NULL) { charset = get_internal_encoding(); } else if (charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } - err = _php_iconv_strpos(&retval, ZSTR_VAL(haystk), ZSTR_LEN(haystk), ZSTR_VAL(ndl), ZSTR_LEN(ndl), - -1, charset); + err = _php_iconv_strpos( + &retval, ZSTR_VAL(haystk), ZSTR_LEN(haystk), ZSTR_VAL(ndl), ZSTR_LEN(ndl), + /* offset */ 0, charset, /* reserve */ true); _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset); if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) { @@ -2028,7 +1996,7 @@ PHP_FUNCTION(iconv_mime_encode) if ((pzval = zend_hash_str_find_deref(Z_ARRVAL_P(pref), "input-charset", sizeof("input-charset") - 1)) != NULL && Z_TYPE_P(pzval) == IS_STRING) { if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -2040,7 +2008,7 @@ PHP_FUNCTION(iconv_mime_encode) if ((pzval = zend_hash_str_find_deref(Z_ARRVAL_P(pref), "output-charset", sizeof("output-charset") - 1)) != NULL && Z_TYPE_P(pzval) == IS_STRING) { if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -2109,7 +2077,7 @@ PHP_FUNCTION(iconv_mime_decode) if (charset == NULL) { charset = get_internal_encoding(); } else if (charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -2150,7 +2118,7 @@ PHP_FUNCTION(iconv_mime_decode_headers) if (charset == NULL) { charset = get_internal_encoding(); } else if (charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -2243,7 +2211,7 @@ PHP_FUNCTION(iconv) } if (in_charset_len >= ICONV_CSNMAXLEN || out_charset_len >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } @@ -2273,7 +2241,7 @@ PHP_FUNCTION(iconv_set_encoding) } if (ZSTR_LEN(charset) >= ICONV_CSNMAXLEN) { - php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); + php_error_docref(NULL, E_WARNING, "Encoding parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN); RETURN_FALSE; } diff --git a/ext/iconv/iconv.stub.php b/ext/iconv/iconv.stub.php index a5f6743e81c44..84dc48a5e965f 100644 --- a/ext/iconv/iconv.stub.php +++ b/ext/iconv/iconv.stub.php @@ -2,22 +2,22 @@ /** @generate-function-entries */ -function iconv_strlen(string $str, ?string $charset = null): int|false {} +function iconv_strlen(string $string, ?string $encoding = null): int|false {} -function iconv_substr(string $str, int $offset, ?int $length = null, ?string $charset = null): string|false {} +function iconv_substr(string $string, int $offset, ?int $length = null, ?string $encoding = null): string|false {} -function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string $charset = null): int|false {} +function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false {} -function iconv_strrpos(string $haystack, string $needle, ?string $charset = null): int|false {} +function iconv_strrpos(string $haystack, string $needle, ?string $encoding = null): int|false {} -function iconv_mime_encode(string $field_name, string $field_value, array $preference = []): string|false {} +function iconv_mime_encode(string $field_name, string $field_value, array $options = []): string|false {} -function iconv_mime_decode(string $encoded_string, int $mode = 0, ?string $charset = null): string|false {} +function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = null): string|false {} -function iconv_mime_decode_headers(string $headers, int $mode = 0, ?string $charset = null): array|false {} +function iconv_mime_decode_headers(string $headers, int $mode = 0, ?string $encoding = null): array|false {} -function iconv(string $in_charset, string $out_charset, string $str): string|false {} +function iconv(string $from_encoding, string $to_encoding, string $string): string|false {} -function iconv_set_encoding(string $type, string $charset): bool {} +function iconv_set_encoding(string $type, string $encoding): bool {} function iconv_get_encoding(string $type = "all"): array|string|false {} diff --git a/ext/iconv/iconv_arginfo.h b/ext/iconv/iconv_arginfo.h index 3702e5739bdf2..619d52631fb6d 100644 --- a/ext/iconv/iconv_arginfo.h +++ b/ext/iconv/iconv_arginfo.h @@ -1,58 +1,58 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4e26168b04450adf510a4e638184c46757679ac1 */ + * Stub hash: 5d05deb60466c6e1ee73b44ad0b09a032bc8410e */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strlen, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_substr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strpos, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strrpos, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_mime_encode, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, field_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, field_value, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preference, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_mime_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, encoded_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_mime_decode_headers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, in_charset, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, out_charset, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, from_encoding, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, to_encoding, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iconv_set_encoding, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_get_encoding, 0, 0, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE) diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h index 89506fab530b2..901ba440fd683 100644 --- a/ext/iconv/php_iconv.h +++ b/ext/iconv/php_iconv.h @@ -87,7 +87,8 @@ typedef enum _php_iconv_err_t { PHP_ICONV_ERR_ILLEGAL_CHAR = 5, PHP_ICONV_ERR_UNKNOWN = 6, PHP_ICONV_ERR_MALFORMED = 7, - PHP_ICONV_ERR_ALLOC = 8 + PHP_ICONV_ERR_ALLOC = 8, + PHP_ICONV_ERR_OUT_BY_BOUNDS = 9 } php_iconv_err_t; /* }}} */ diff --git a/ext/iconv/tests/iconv-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv-charset-length-cve-2007-4840.phpt index b05bd560d7478..730870d4f71eb 100644 --- a/ext/iconv/tests/iconv-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv-charset-length-cve-2007-4840.phpt @@ -9,8 +9,8 @@ var_dump(iconv($a, "b", "test")); var_dump(iconv("x", $a, "test")); ?> --EXPECTF-- -Warning: iconv(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) -Warning: iconv(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt index d2e7f5713f816..59a8668957d65 100644 --- a/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt @@ -8,5 +8,5 @@ $a = str_repeat("/", 9000000); var_dump(iconv_mime_decode("a", null, $a)); ?> --EXPECTF-- -Warning: iconv_mime_decode(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_mime_decode(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt index f08d17754bec1..818b599500ade 100644 --- a/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt @@ -8,5 +8,5 @@ $a = str_repeat("/", 9000000); var_dump(iconv_mime_decode_headers("a", null, $a)); ?> --EXPECTF-- -Warning: iconv_mime_decode_headers(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_mime_decode_headers(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_set_encoding-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_set_encoding-charset-length-cve-2007-4840.phpt index 40c87001e4476..b0ba4016fb949 100644 --- a/ext/iconv/tests/iconv_set_encoding-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_set_encoding-charset-length-cve-2007-4840.phpt @@ -10,11 +10,11 @@ var_dump(iconv_set_encoding("output_encoding", $a)); var_dump(iconv_set_encoding("internal_encoding", $a)); ?> --EXPECTF-- -Warning: iconv_set_encoding(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_set_encoding(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) -Warning: iconv_set_encoding(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_set_encoding(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) -Warning: iconv_set_encoding(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_set_encoding(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_strlen-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_strlen-charset-length-cve-2007-4840.phpt index 23f0b6f2eae8c..f202d53625e1f 100644 --- a/ext/iconv/tests/iconv_strlen-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_strlen-charset-length-cve-2007-4840.phpt @@ -8,5 +8,5 @@ $a = str_repeat("/", 9791999); var_dump(iconv_strlen(1, $a)); ?> --EXPECTF-- -Warning: iconv_strlen(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_strlen(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_strlen_error2.phpt b/ext/iconv/tests/iconv_strlen_error2.phpt index ea2bb430fbf2a..a4517f6e08f13 100644 --- a/ext/iconv/tests/iconv_strlen_error2.phpt +++ b/ext/iconv/tests/iconv_strlen_error2.phpt @@ -23,5 +23,5 @@ var_dump(iconv_strlen($string, $encoding)); --EXPECTF-- *** Testing iconv_strlen() : error *** -Notice: iconv_strlen(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_strlen(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_strpos-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_strpos-charset-length-cve-2007-4840.phpt index 0b378cb5030d0..6bfbde0546b5e 100644 --- a/ext/iconv/tests/iconv_strpos-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_strpos-charset-length-cve-2007-4840.phpt @@ -8,5 +8,5 @@ $a = str_repeat("/", 9000000); var_dump(iconv_strpos("a", "b", 0, $a)); ?> --EXPECTF-- -Warning: iconv_strpos(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_strpos(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_strpos.phpt b/ext/iconv/tests/iconv_strpos.phpt index 1dafd6c06b482..df9427d2c621b 100644 --- a/ext/iconv/tests/iconv_strpos.phpt +++ b/ext/iconv/tests/iconv_strpos.phpt @@ -16,14 +16,19 @@ function foo($haystk, $needle, $offset, $to_charset = false, $from_charset = fal } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; } - if ($to_charset !== false) { - var_dump(iconv_strpos($haystk, $needle, $offset, $to_charset)); - } else { - var_dump(iconv_strpos($haystk, $needle, $offset)); + try { + if ($to_charset !== false) { + var_dump(iconv_strpos($haystk, $needle, $offset, $to_charset)); + } else { + var_dump(iconv_strpos($haystk, $needle, $offset)); + } + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; } } foo("abecdbcdabef", "bcd", -1); foo("abecdbcdabef", "bcd", -7); +foo("abecdbcdabef", "bcd", 12); foo("abecdbcdabef", "bcd", 100000); foo("abcabcabcdabcababcdabc", "bcd", 0); foo("abcabcabcdabcababcdabc", "bcd", 10); @@ -41,8 +46,10 @@ bool(false) bool(false) int(5) int(5) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) bool(false) +bool(false) +strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(7) int(7) int(16) diff --git a/ext/iconv/tests/iconv_strpos_error2.phpt b/ext/iconv/tests/iconv_strpos_error2.phpt index b95e1e1edc9b2..ac22704b2d95c 100644 --- a/ext/iconv/tests/iconv_strpos_error2.phpt +++ b/ext/iconv/tests/iconv_strpos_error2.phpt @@ -24,6 +24,6 @@ echo "Done"; --EXPECTF-- *** Testing iconv_strpos() : error conditions *** -Notice: iconv_strpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_strpos(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) Done diff --git a/ext/iconv/tests/iconv_strpos_variation5.phpt b/ext/iconv/tests/iconv_strpos_variation5.phpt index 4feef545a4299..625c44efa7e50 100644 --- a/ext/iconv/tests/iconv_strpos_variation5.phpt +++ b/ext/iconv/tests/iconv_strpos_variation5.phpt @@ -32,25 +32,29 @@ $needle_mb = base64_decode('44CC'); for ($i = -30; $i <= 60; $i += 10) { echo "\n**-- Offset is: $i --**\n"; echo "-- ASCII String --\n"; - var_dump(iconv_strpos($string_ascii, $needle_ascii, $i)); + try { + var_dump(iconv_strpos($string_ascii, $needle_ascii, $i)); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } echo "--Multibyte String --\n"; - var_dump(iconv_strpos($string_mb, $needle_mb, $i, 'UTF-8')); + try { + var_dump(iconv_strpos($string_mb, $needle_mb, $i, 'UTF-8')); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } } echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing iconv_strpos() : usage variations *** **-- Offset is: -30 --** -- ASCII String -- - -Warning: iconv_strpos(): Offset not contained in string. in %s on line %d -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- - -Warning: iconv_strpos(): Offset not contained in string. in %s on line %d -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: -20 --** -- ASCII String -- @@ -84,25 +88,25 @@ int(20) **-- Offset is: 30 --** -- ASCII String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 40 --** -- ASCII String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 50 --** -- ASCII String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 60 --** -- ASCII String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -bool(false) +iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) Done diff --git a/ext/iconv/tests/iconv_strrpos-charset-length-cve-2007-4840.phpt b/ext/iconv/tests/iconv_strrpos-charset-length-cve-2007-4840.phpt index f1492798001a5..554920cc26ea6 100644 --- a/ext/iconv/tests/iconv_strrpos-charset-length-cve-2007-4840.phpt +++ b/ext/iconv/tests/iconv_strrpos-charset-length-cve-2007-4840.phpt @@ -8,5 +8,5 @@ $a = str_repeat("/", 9000000); var_dump(iconv_strrpos("a", "b", $a)); ?> --EXPECTF-- -Warning: iconv_strrpos(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_strrpos(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_strrpos_error2.phpt b/ext/iconv/tests/iconv_strrpos_error2.phpt index 7b0155ac4d444..4e02ac4712fa8 100644 --- a/ext/iconv/tests/iconv_strrpos_error2.phpt +++ b/ext/iconv/tests/iconv_strrpos_error2.phpt @@ -25,6 +25,6 @@ echo "Done"; --EXPECTF-- *** Testing iconv_strrpos() : error conditions *** -Notice: iconv_strrpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_strrpos(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) Done diff --git a/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt b/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt index 135c636718b03..77a29d0f21b8c 100644 --- a/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt +++ b/ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt @@ -9,5 +9,5 @@ $b = str_repeat('/', 2798349); var_dump(iconv_substr($a, 0, 1, $b)); ?> --EXPECTF-- -Warning: iconv_substr(): Charset parameter exceeds the maximum allowed length of %d characters in %s on line %d +Warning: iconv_substr(): Encoding parameter exceeds the maximum allowed length of 64 characters in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_substr.phpt b/ext/iconv/tests/iconv_substr.phpt index 1d029520a47f2..3064c3a6a8d94 100644 --- a/ext/iconv/tests/iconv_substr.phpt +++ b/ext/iconv/tests/iconv_substr.phpt @@ -45,8 +45,8 @@ var_dump(iconv("ISO-2022-JP", "EUC-JP", iconv_substr(iconv("EUC-JP", "ISO-2022-J 666768696a6b6c a6a4a8a4aaa4ab a4aba4ada4afa4b1a4b3a4b5a4b7 -bool(false) -bool(false) +string(0) "" +string(0) "" string(14) "This is a test" string(14) "This is a test" string(3) "est" @@ -55,8 +55,8 @@ string(3) "est" string(3) "est" string(5) "This " string(5) "This " -bool(false) -bool(false) -bool(false) -bool(false) +string(0) "" +string(0) "" +string(0) "" +string(0) "" string(10) "¤Á¤Ï ISO-2" diff --git a/ext/iconv/tests/iconv_substr_error2.phpt b/ext/iconv/tests/iconv_substr_error2.phpt index 70a4e958c1806..858b89518694e 100644 --- a/ext/iconv/tests/iconv_substr_error2.phpt +++ b/ext/iconv/tests/iconv_substr_error2.phpt @@ -25,6 +25,6 @@ echo "Done"; --EXPECTF-- *** Testing iconv_substr() : error conditions *** -Notice: iconv_substr(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_substr(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) Done diff --git a/ext/iconv/tests/iconv_substr_out_of_bounds.phpt b/ext/iconv/tests/iconv_substr_out_of_bounds.phpt new file mode 100644 index 0000000000000..4e3e5fae0a972 --- /dev/null +++ b/ext/iconv/tests/iconv_substr_out_of_bounds.phpt @@ -0,0 +1,48 @@ +--TEST-- +iconv_substr() with out of bounds offset +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(0) "" +string(3) "foo" +string(0) "" +string(3) "foo" +string(0) "" +string(6) "äöü" +string(0) "" +string(6) "äöü" +string(3) "foo" +string(0) "" +string(3) "foo" +string(0) "" +string(6) "äöü" +string(0) "" +string(6) "äöü" +string(0) "" +string(2) "ä" +string(4) "äö" +string(0) "" diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 667587ab7741c..98085884ab87e 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -141,9 +141,14 @@ ZEND_GET_MODULE(imap) /* True globals, no need for thread safety */ static int le_imap; -#define PHP_IMAP_CHECK_MSGNO(msgindex) \ - if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { \ - php_error_docref(NULL, E_WARNING, "Bad message number"); \ +// TODO Promote to ValueError? +#define PHP_IMAP_CHECK_MSGNO(msgindex, arg_pos) \ + if (msgindex < 1) { \ + zend_argument_value_error(arg_pos, "must be greater than 0"); \ + RETURN_THROWS(); \ + } \ + if (((unsigned) msgindex) > imap_le_struct->imap_stream->nmsgs) { \ + php_error_docref(NULL, E_WARNING, "Bad message number"); \ RETURN_FALSE; \ } \ @@ -695,22 +700,31 @@ PHP_MINFO_FUNCTION(imap) } /* }}} */ -/* {{{ imap_do_open */ -static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) +/* {{{ Open an IMAP stream to a mailbox */ +PHP_FUNCTION(imap_open) { zend_string *mailbox, *user, *passwd; - zend_long retries = 0, flags = NIL, cl_flags = NIL; + zend_long retries = 0, flags = 0, cl_flags = 0; MAILSTREAM *imap_stream; pils *imap_le_struct; - zval *params = NULL; - int argc = ZEND_NUM_ARGS(); + HashTable *params = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "PSS|llh", &mailbox, &user, &passwd, &flags, &retries, ¶ms) == FAILURE) { + RETURN_THROWS(); + } - if (zend_parse_parameters(argc, "PSS|lla", &mailbox, &user, - &passwd, &flags, &retries, ¶ms) == FAILURE) { + if (flags && ((flags & ~(OP_READONLY | OP_ANONYMOUS | OP_HALFOPEN | CL_EXPUNGE | OP_DEBUG | OP_SHORTCACHE + | OP_SILENT | OP_PROTOTYPE | OP_SECURE)) != 0)) { + zend_argument_value_error(4, "must be a bitmask of the OP_* constants, and CL_EXPUNGE"); RETURN_THROWS(); } - if (argc >= 4) { + if (retries < 0) { + zend_argument_value_error(5, "must be greater than or equal to 0"); + RETURN_THROWS(); + } + + if (flags) { if (flags & PHP_EXPUNGE) { cl_flags = CL_EXPUNGE; flags ^= PHP_EXPUNGE; @@ -723,7 +737,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (params) { zval *disabled_auth_method; - if ((disabled_auth_method = zend_hash_str_find(Z_ARRVAL_P(params), "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR") - 1)) != NULL) { + if ((disabled_auth_method = zend_hash_str_find(params, "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR") - 1)) != NULL) { switch (Z_TYPE_P(disabled_auth_method)) { case IS_STRING: if (Z_STRLEN_P(disabled_auth_method) > 1) { @@ -746,16 +760,16 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) mail_parameters(NIL, DISABLE_AUTHENTICATOR, (void *)Z_STRVAL_P(z_auth_method)); } } else { - php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings"); + zend_argument_type_error(6, "option \"DISABLE_AUTHENTICATOR\" must be a string or an array of strings"); + RETURN_THROWS(); } } } } break; - case IS_LONG: default: - php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings"); - break; + zend_argument_type_error(6, "option \"DISABLE_AUTHENTICATOR\" must be a string or an array of strings"); + RETURN_THROWS(); } } } @@ -779,12 +793,8 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) IMAPG(imap_password) = estrndup(ZSTR_VAL(passwd), ZSTR_LEN(passwd)); #ifdef SET_MAXLOGINTRIALS - if (argc >= 5) { - if (retries < 0) { - php_error_docref(NULL, E_WARNING ,"Retries must be greater or equal to 0"); - } else { - mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) retries); - } + if (retries) { + mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) retries); } #endif @@ -805,13 +815,6 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } /* }}} */ -/* {{{ Open an IMAP stream to a mailbox */ -PHP_FUNCTION(imap_open) -{ - php_imap_do_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - /* {{{ Reopen an IMAP stream to a new mailbox */ PHP_FUNCTION(imap_reopen) { @@ -830,6 +833,18 @@ PHP_FUNCTION(imap_reopen) RETURN_THROWS(); } + /* TODO Verify these are the only options available as they are pulled from the php.net documentation */ + if (options && ((options & ~(OP_READONLY | OP_ANONYMOUS | OP_HALFOPEN | OP_EXPUNGE | CL_EXPUNGE)) != 0)) { + zend_argument_value_error(3, "must be a bitmask of OP_READONLY, OP_ANONYMOUS, OP_HALFOPEN, " + "OP_EXPUNGE, and CL_EXPUNGE"); + RETURN_THROWS(); + } + + if (retries < 0) { + zend_argument_value_error(4, "must be greater than or equal to 0"); + RETURN_THROWS(); + } + if (options) { flags = options; if (flags & PHP_EXPUNGE) { @@ -866,7 +881,7 @@ PHP_FUNCTION(imap_append) pils *imap_le_struct; STRING st; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSS|SS", &streamind, &folder, &message, &flags, &internal_date) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSS|S!S!", &streamind, &folder, &message, &flags, &internal_date) == FAILURE) { RETURN_THROWS(); } @@ -888,11 +903,14 @@ PHP_FUNCTION(imap_append) 0, Z_L(0), Z_L(0)); if (!Z_LVAL_P(return_value)) { + // TODO Promoto to error? php_error_docref(NULL, E_WARNING, "Internal date not correctly formatted"); internal_date = NULL; } } + /* TODO Check if flags are valid (documentation is not present on php.net so need to check this first) */ + if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { RETURN_THROWS(); } @@ -1126,17 +1144,18 @@ PHP_FUNCTION(imap_gc) RETURN_THROWS(); } - if (flags && ((flags & ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the flags parameter"); - RETURN_FALSE; + if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + RETURN_THROWS(); } - if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + if (flags && ((flags & ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) { + zend_argument_value_error(2, "must be a bitmask of IMAP_GC_TEXTS, IMAP_GC_ELT, and IMAP_GC_ENV"); RETURN_THROWS(); } mail_gc(imap_le_struct->imap_stream, flags); + // TODO Return void? RETURN_TRUE; } /* }}} */ @@ -1147,9 +1166,8 @@ PHP_FUNCTION(imap_close) zval *streamind; pils *imap_le_struct=NULL; zend_long options = 0, flags = NIL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "r|l", &streamind, &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &streamind, &options) == FAILURE) { RETURN_THROWS(); } @@ -1157,13 +1175,13 @@ PHP_FUNCTION(imap_close) RETURN_THROWS(); } - if (argc == 2) { + if (options) { flags = options; /* Check that flags is exactly equal to PHP_EXPUNGE or zero */ if (flags && ((flags & ~PHP_EXPUNGE) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the flags parameter"); - RETURN_FALSE; + zend_argument_value_error(2, "must be CL_EXPUNGE or 0"); + RETURN_THROWS(); } /* Do the translation from PHP's internal PHP_EXPUNGE define to c-client's CL_EXPUNGE */ @@ -1176,6 +1194,7 @@ PHP_FUNCTION(imap_close) zend_list_close(Z_RES_P(streamind)); + // TODO Return void? RETURN_TRUE; } /* }}} */ @@ -1237,37 +1256,45 @@ PHP_FUNCTION(imap_body) zval *streamind; zend_long msgno, flags = 0; pils *imap_le_struct; - int msgindex, argc = ZEND_NUM_ARGS(); + unsigned long msgindex; char *body; unsigned long body_len = 0; - if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &streamind, &msgno, &flags) == FAILURE) { RETURN_THROWS(); } - if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the options parameter"); - RETURN_FALSE; + if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + RETURN_THROWS(); } - if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + if (msgno < 1) { + zend_argument_value_error(2, "must be greater than 0"); RETURN_THROWS(); } - if ((argc == 3) && (flags & FT_UID)) { + if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { + zend_argument_value_error(3, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL"); + RETURN_THROWS(); + } + + if (flags && (flags & FT_UID)) { /* This should be cached; if it causes an extra RTT to the IMAP server, then that's the price we pay for making sure we don't crash. */ msgindex = mail_msgno(imap_le_struct->imap_stream, msgno); + if (msgindex == 0) { + php_error_docref(NULL, E_WARNING, "UID does not exist"); + RETURN_FALSE; + } } else { - msgindex = msgno; - } - if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { - php_error_docref(NULL, E_WARNING, "Bad message number"); - RETURN_FALSE; + msgindex = (unsigned long) msgno; } - body = mail_fetchtext_full (imap_le_struct->imap_stream, msgno, &body_len, (argc == 3 ? flags : NIL)); + PHP_IMAP_CHECK_MSGNO(msgindex, 2); + + /* TODO Shouldn't this pass msgindex??? */ + body = mail_fetchtext_full (imap_le_struct->imap_stream, msgno, &body_len, flags); if (body_len == 0) { RETVAL_EMPTY_STRING(); } else { @@ -1282,10 +1309,9 @@ PHP_FUNCTION(imap_mail_copy) zval *streamind; zend_long options = 0; zend_string *seq, *folder; - int argc = ZEND_NUM_ARGS(); pils *imap_le_struct; - if (zend_parse_parameters(argc, "rSS|l", &streamind, &seq, &folder, &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSS|l", &streamind, &seq, &folder, &options) == FAILURE) { RETURN_THROWS(); } @@ -1293,7 +1319,12 @@ PHP_FUNCTION(imap_mail_copy) RETURN_THROWS(); } - if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), (argc == 4 ? options : NIL)) == T) { + if (options && ((options & ~(CP_UID | CP_MOVE)) != 0)) { + zend_argument_value_error(4, "must be a bitmask of CP_UID, and CP_MOVE"); + RETURN_THROWS(); + } + + if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), options) == T) { RETURN_TRUE; } else { RETURN_FALSE; @@ -1308,9 +1339,8 @@ PHP_FUNCTION(imap_mail_move) zend_string *seq, *folder; zend_long options = 0; pils *imap_le_struct; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rSS|l", &streamind, &seq, &folder, &options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSS|l", &streamind, &seq, &folder, &options) == FAILURE) { RETURN_THROWS(); } @@ -1318,7 +1348,15 @@ PHP_FUNCTION(imap_mail_move) RETURN_THROWS(); } - if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), (argc == 4 ? (options | CP_MOVE) : CP_MOVE)) == T) { + if (options && ((options & ~CP_UID) != 0)) { + zend_argument_value_error(4, "must be CP_UID or 0"); + RETURN_THROWS(); + } + + /* Add CP_MOVE flag */ + options = (options | CP_MOVE); + + if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), options) == T) { RETURN_TRUE; } else { RETURN_FALSE; @@ -1552,12 +1590,12 @@ PHP_FUNCTION(imap_check) /* {{{ Mark a message for deletion */ PHP_FUNCTION(imap_delete) { - zval *streamind, *sequence; + zval *streamind; pils *imap_le_struct; + zend_string *sequence; zend_long flags = 0; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rz|l", &streamind, &sequence, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS|l", &streamind, &sequence, &flags) == FAILURE) { RETURN_THROWS(); } @@ -1565,11 +1603,12 @@ PHP_FUNCTION(imap_delete) RETURN_THROWS(); } - if (!try_convert_to_string(sequence)) { + if (flags && ((flags & ~FT_UID) != 0)) { + zend_argument_value_error(3, "must be FT_UID or 0"); RETURN_THROWS(); } - mail_setflag_full(imap_le_struct->imap_stream, Z_STRVAL_P(sequence), "\\DELETED", (argc == 3 ? flags : NIL)); + mail_setflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), "\\DELETED", flags); RETVAL_TRUE; } /* }}} */ @@ -1577,12 +1616,12 @@ PHP_FUNCTION(imap_delete) /* {{{ Remove the delete flag from a message */ PHP_FUNCTION(imap_undelete) { - zval *streamind, *sequence; + zval *streamind; + zend_string *sequence; zend_long flags = 0; pils *imap_le_struct; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rz|l", &streamind, &sequence, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS|l", &streamind, &sequence, &flags) == FAILURE) { RETURN_THROWS(); } @@ -1590,11 +1629,11 @@ PHP_FUNCTION(imap_undelete) RETURN_THROWS(); } - if (!try_convert_to_string(sequence)) { - RETURN_THROWS(); - } + /* TODO Check if flags are valid (documentation is not present on php.net so need to check this first) */ + + mail_clearflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), "\\DELETED", flags); - mail_clearflag_full(imap_le_struct->imap_stream, Z_STRVAL_P(sequence), "\\DELETED", (argc == 3 ? flags : NIL)); + // TODO Return void? RETVAL_TRUE; } /* }}} */ @@ -1603,15 +1642,13 @@ PHP_FUNCTION(imap_undelete) PHP_FUNCTION(imap_headerinfo) { zval *streamind; - zend_string *defaulthost = NULL; - int argc = ZEND_NUM_ARGS(); - zend_long msgno, fromlength, subjectlength; + zend_long msgno, fromlength = 0, subjectlength = 0; pils *imap_le_struct; MESSAGECACHE *cache; ENVELOPE *en; char dummy[2000], fulladdress[MAILTMPLEN + 1]; - if (zend_parse_parameters(argc, "rl|llS", &streamind, &msgno, &fromlength, &subjectlength, &defaulthost) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|ll", &streamind, &msgno, &fromlength, &subjectlength) == FAILURE) { RETURN_THROWS(); } @@ -1619,24 +1656,17 @@ PHP_FUNCTION(imap_headerinfo) RETURN_THROWS(); } - if (argc >= 3) { - if (fromlength < 0 || fromlength > MAILTMPLEN) { - php_error_docref(NULL, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN); - RETURN_FALSE; - } - } else { - fromlength = 0x00; - } - if (argc >= 4) { - if (subjectlength < 0 || subjectlength > MAILTMPLEN) { - php_error_docref(NULL, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN); - RETURN_FALSE; - } - } else { - subjectlength = 0x00; + PHP_IMAP_CHECK_MSGNO(msgno, 2); + + if (fromlength < 0 || fromlength > MAILTMPLEN) { + zend_argument_value_error(3, "must be between 0 and %d", MAILTMPLEN); + RETURN_THROWS(); } - PHP_IMAP_CHECK_MSGNO(msgno); + if (subjectlength < 0 || subjectlength > MAILTMPLEN) { + zend_argument_value_error(4, "must be between 0 and %d", MAILTMPLEN); + RETURN_THROWS(); + } if (mail_fetchstructure(imap_le_struct->imap_stream, msgno, NIL)) { cache = mail_elt(imap_le_struct->imap_stream, msgno); @@ -1688,13 +1718,12 @@ PHP_FUNCTION(imap_rfc822_parse_headers) { zend_string *headers, *defaulthost = NULL; ENVELOPE *en; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "S|S", &headers, &defaulthost) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &headers, &defaulthost) == FAILURE) { RETURN_THROWS(); } - if (argc == 2) { + if (defaulthost) { rfc822_parse_msg(&en, NULL, ZSTR_VAL(headers), ZSTR_LEN(headers), NULL, ZSTR_VAL(defaulthost), NIL); } else { rfc822_parse_msg(&en, NULL, ZSTR_VAL(headers), ZSTR_LEN(headers), NULL, "UNKNOWN", NIL); @@ -1847,38 +1876,44 @@ PHP_FUNCTION(imap_fetchstructure) zend_long msgno, flags = 0; pils *imap_le_struct; BODY *body; - int msgindex, argc = ZEND_NUM_ARGS(); + int msgindex; - if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &streamind, &msgno, &flags) == FAILURE) { RETURN_THROWS(); } - if (flags && ((flags & ~FT_UID) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the options parameter"); - RETURN_FALSE; - } - if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { RETURN_THROWS(); } if (msgno < 1) { - RETURN_FALSE; + zend_argument_value_error(2, "must be greater than 0"); + RETURN_THROWS(); + } + + if (flags && ((flags & ~FT_UID) != 0)) { + zend_argument_value_error(3, "must be FT_UID or 0"); + RETURN_THROWS(); } object_init(return_value); - if ((argc == 3) && (flags & FT_UID)) { + if (flags & FT_UID) { /* This should be cached; if it causes an extra RTT to the IMAP server, then that's the price we pay for making sure we don't crash. */ msgindex = mail_msgno(imap_le_struct->imap_stream, msgno); + if (msgindex == 0) { + php_error_docref(NULL, E_WARNING, "UID does not exist"); + RETURN_FALSE; + } } else { msgindex = msgno; } - PHP_IMAP_CHECK_MSGNO(msgindex); + PHP_IMAP_CHECK_MSGNO(msgindex, 2); - mail_fetchstructure_full(imap_le_struct->imap_stream, msgno, &body , (argc == 3 ? flags : NIL)); + /* TODO Shouldn't this pass msgindex??? */ + mail_fetchstructure_full(imap_le_struct->imap_stream, msgno, &body , (ZEND_NUM_ARGS() == 3 ? flags : NIL)); if (!body) { php_error_docref(NULL, E_WARNING, "No body information available"); @@ -1898,27 +1933,31 @@ PHP_FUNCTION(imap_fetchbody) char *body; zend_string *sec; unsigned long len; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rlS|l", &streamind, &msgno, &sec, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlS|l", &streamind, &msgno, &sec, &flags) == FAILURE) { RETURN_THROWS(); } - if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the options parameter"); - RETURN_FALSE; + if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + RETURN_THROWS(); } - if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + if (msgno < 1) { + zend_argument_value_error(2, "must be greater than 0"); + RETURN_THROWS(); + } + + if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { + zend_argument_value_error(4, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL"); RETURN_THROWS(); } - if (argc < 4 || !(flags & FT_UID)) { + if (!(flags & FT_UID)) { /* only perform the check if the msgno is a message number and not a UID */ - PHP_IMAP_CHECK_MSGNO(msgno); + PHP_IMAP_CHECK_MSGNO(msgno, 2); } - body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, (argc == 4 ? flags : NIL)); + body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, flags); if (!body) { php_error_docref(NULL, E_WARNING, "No body information available"); @@ -1939,27 +1978,31 @@ PHP_FUNCTION(imap_fetchmime) char *body; zend_string *sec; unsigned long len; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rlS|l", &streamind, &msgno, &sec, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlS|l", &streamind, &msgno, &sec, &flags) == FAILURE) { + RETURN_THROWS(); + } + + if (msgno < 1) { + zend_argument_value_error(2, "must be greater than 0"); RETURN_THROWS(); } if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the options parameter"); - RETURN_FALSE; + zend_argument_value_error(4, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL"); + RETURN_THROWS(); } if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { RETURN_THROWS(); } - if (argc < 4 || !(flags & FT_UID)) { + if (!(flags & FT_UID)) { /* only perform the check if the msgno is a message number and not a UID */ - PHP_IMAP_CHECK_MSGNO(msgno); + PHP_IMAP_CHECK_MSGNO(msgno, 2); } - body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, (argc == 4 ? flags : NIL)); + body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, flags); if (!body) { php_error_docref(NULL, E_WARNING, "No body MIME information available"); @@ -1974,7 +2017,7 @@ PHP_FUNCTION(imap_fetchmime) PHP_FUNCTION(imap_savebody) { zval *stream, *out; - pils *imap_ptr = NULL; + pils *imap_le_struct = NULL; php_stream *writer = NULL; zend_string *section = NULL; int close_stream = 1; @@ -1984,11 +2027,19 @@ PHP_FUNCTION(imap_savebody) RETURN_THROWS(); } - if ((imap_ptr = (pils *)zend_fetch_resource(Z_RES_P(stream), "imap", le_imap)) == NULL) { + if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(stream), "imap", le_imap)) == NULL) { + RETURN_THROWS(); + } + + PHP_IMAP_CHECK_MSGNO(msgno, 3); + + if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) { + zend_argument_value_error(5, "must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL"); RETURN_THROWS(); } - if (!imap_ptr) { + // TODO Drop this? + if (!imap_le_struct) { RETURN_FALSE; } @@ -2004,6 +2055,7 @@ PHP_FUNCTION(imap_savebody) if (!try_convert_to_string(out)) { RETURN_THROWS(); } + // TODO Need to check for null bytes? writer = php_stream_open_wrapper(Z_STRVAL_P(out), "wb", REPORT_ERRORS, NULL); break; } @@ -2014,7 +2066,7 @@ PHP_FUNCTION(imap_savebody) IMAPG(gets_stream) = writer; mail_parameters(NIL, SET_GETS, (void *) php_mail_gets); - mail_fetchbody_full(imap_ptr->imap_stream, msgno, section?ZSTR_VAL(section):"", NULL, flags); + mail_fetchbody_full(imap_le_struct->imap_stream, msgno, section?ZSTR_VAL(section):"", NULL, flags); mail_parameters(NIL, SET_GETS, (void *) NULL); IMAPG(gets_stream) = NULL; @@ -2570,7 +2622,8 @@ static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ if (out == NIL) { RETURN_FALSE; } else { - RETURN_STRING((char *)out); + RETVAL_STRING((char *)out); + fs_give((void**) &out); } } /* }}} */ @@ -2606,6 +2659,11 @@ PHP_FUNCTION(imap_setflag_full) RETURN_THROWS(); } + if (flags && ((flags & ~ST_UID) != 0)) { + zend_argument_value_error(4, "must be ST_UID or 0"); + RETURN_THROWS(); + } + mail_setflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), (flags ? flags : NIL)); RETURN_TRUE; } @@ -2618,9 +2676,8 @@ PHP_FUNCTION(imap_clearflag_full) zend_string *sequence, *flag; zend_long flags = 0; pils *imap_le_struct; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rSS|l", &streamind, &sequence, &flag, &flags) ==FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSS|l", &streamind, &sequence, &flag, &flags) ==FAILURE) { RETURN_THROWS(); } @@ -2628,7 +2685,12 @@ PHP_FUNCTION(imap_clearflag_full) RETURN_THROWS(); } - mail_clearflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), (argc == 4 ? flags : NIL)); + if (flags && ((flags & ~ST_UID) != 0)) { + zend_argument_value_error(4, "must be ST_UID or 0"); + RETURN_THROWS(); + } + + mail_clearflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), flags); RETURN_TRUE; } /* }}} */ @@ -2638,15 +2700,14 @@ PHP_FUNCTION(imap_sort) { zval *streamind; zend_string *criteria = NULL, *charset = NULL; - zend_long pgm, rev, flags = 0; + zend_long sort, rev, flags = 0; pils *imap_le_struct; unsigned long *slst, *sl; char *search_criteria; SORTPGM *mypgm=NIL; SEARCHPGM *spg=NIL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rll|lSS", &streamind, &pgm, &rev, &flags, &criteria, &charset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll|lS!S!", &streamind, &sort, &rev, &flags, &criteria, &charset) == FAILURE) { RETURN_THROWS(); } @@ -2654,17 +2715,18 @@ PHP_FUNCTION(imap_sort) RETURN_THROWS(); } - if (pgm > SORTSIZE) { - php_error_docref(NULL, E_WARNING, "Unrecognized sort criteria"); - RETURN_FALSE; + if (!(sort == SORTDATE || sort == SORTARRIVAL || sort == SORTFROM || sort == SORTSUBJECT || sort == SORTTO || + sort == SORTCC || sort == SORTSIZE) ) { + zend_argument_value_error(2, "must be one of the SORT* constants"); + RETURN_THROWS(); } - if (argc >= 4) { - if (flags < 0) { - php_error_docref(NULL, E_WARNING, "Search options parameter has to be greater than or equal to 0"); - RETURN_FALSE; - } + + if (flags && ((flags & ~(SE_UID|SE_NOPREFETCH )) != 0)) { + zend_argument_value_error(4, "must be a bitmask of SE_UID, and SE_NOPREFETCH"); + RETURN_THROWS(); } - if (argc >= 5) { + + if (criteria) { search_criteria = estrndup(ZSTR_VAL(criteria), ZSTR_LEN(criteria)); spg = mail_criteria(search_criteria); efree(search_criteria); @@ -2674,10 +2736,10 @@ PHP_FUNCTION(imap_sort) mypgm = mail_newsortpgm(); mypgm->reverse = rev; - mypgm->function = (short) pgm; + mypgm->function = (short) sort; mypgm->next = NIL; - slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? ZSTR_VAL(charset) : NIL), spg, mypgm, (argc >= 4 ? flags : NIL)); + slst = mail_sort(imap_le_struct->imap_stream, (charset ? ZSTR_VAL(charset) : NIL), spg, mypgm, flags); if (spg && !(flags & SE_FREE)) { mail_free_searchpgm(&spg); @@ -2699,33 +2761,40 @@ PHP_FUNCTION(imap_fetchheader) zval *streamind; zend_long msgno, flags = 0L; pils *imap_le_struct; - int msgindex, argc = ZEND_NUM_ARGS(); + int msgindex; - if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &streamind, &msgno, &flags) == FAILURE) { RETURN_THROWS(); } - if (flags && ((flags & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the options parameter"); - RETURN_FALSE; + if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + RETURN_THROWS(); } - if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { + // TODO Check for msgno < 1 now or wait later for PHP_IMAP_CHECK_MSGNO check? + + if (flags && ((flags & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) { + zend_argument_value_error(3, "must be a bitmask of FT_UID, FT_PREFETCHTEXT, and FT_INTERNAL"); RETURN_THROWS(); } - if ((argc == 3) && (flags & FT_UID)) { + if (flags & FT_UID) { /* This should be cached; if it causes an extra RTT to the IMAP server, then that's the price we pay for making sure we don't crash. */ msgindex = mail_msgno(imap_le_struct->imap_stream, msgno); + if (msgindex == 0) { + php_error_docref(NULL, E_WARNING, "UID does not exist"); + RETURN_FALSE; + } } else { msgindex = msgno; } - PHP_IMAP_CHECK_MSGNO(msgindex); + PHP_IMAP_CHECK_MSGNO(msgindex, 2); - RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, msgno, NIL, NIL, (argc == 3 ? flags : NIL))); + /* TODO Check shouldn't this pass msgindex???? */ + RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, msgno, NIL, NIL, (ZEND_NUM_ARGS() == 3 ? flags : NIL))); } /* }}} */ @@ -2735,7 +2804,6 @@ PHP_FUNCTION(imap_uid) zval *streamind; zend_long msgno; pils *imap_le_struct; - int msgindex; if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) { RETURN_THROWS(); @@ -2745,11 +2813,7 @@ PHP_FUNCTION(imap_uid) RETURN_THROWS(); } - msgindex = msgno; - if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { - php_error_docref(NULL, E_WARNING, "Bad message number"); - RETURN_FALSE; - } + PHP_IMAP_CHECK_MSGNO(msgno, 2); RETURN_LONG(mail_uid(imap_le_struct->imap_stream, msgno)); } @@ -2770,6 +2834,8 @@ PHP_FUNCTION(imap_msgno) RETURN_THROWS(); } + PHP_IMAP_CHECK_MSGNO(msgno, 2); + RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msgno)); } /* }}} */ @@ -2790,6 +2856,11 @@ PHP_FUNCTION(imap_status) RETURN_THROWS(); } + if (flags && ((flags & ~(SA_MESSAGES | SA_RECENT | SA_UNSEEN | SA_UIDNEXT | SA_UIDVALIDITY /*| SA_ALL*/)) != 0)) { + zend_argument_value_error(3, "must be a bitmask of SA_* constants"); + RETURN_THROWS(); + } + object_init(return_value); if (mail_status(imap_le_struct->imap_stream, ZSTR_VAL(mbx), flags)) { @@ -2819,14 +2890,14 @@ PHP_FUNCTION(imap_status) PHP_FUNCTION(imap_bodystruct) { zval *streamind; - zend_long msg; + zend_long msgno; zend_string *section; pils *imap_le_struct; zval parametres, param, dparametres, dparam; PARAMETER *par, *dpar; BODY *body; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlS", &streamind, &msg, §ion) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlS", &streamind, &msgno, §ion) == FAILURE) { RETURN_THROWS(); } @@ -2834,13 +2905,9 @@ PHP_FUNCTION(imap_bodystruct) RETURN_THROWS(); } - if (!msg || msg < 1 || (unsigned) msg > imap_le_struct->imap_stream->nmsgs) { - php_error_docref(NULL, E_WARNING, "Bad message number"); - RETURN_FALSE; - } - + PHP_IMAP_CHECK_MSGNO(msgno, 2); - body=mail_body(imap_le_struct->imap_stream, msg, (unsigned char*)ZSTR_VAL(section)); + body=mail_body(imap_le_struct->imap_stream, msgno, (unsigned char*)ZSTR_VAL(section)); if (body == NULL) { RETURN_FALSE; } @@ -2936,15 +3003,14 @@ PHP_FUNCTION(imap_fetch_overview) zval myoverview; zend_string *address; zend_long status, flags = 0L; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "rS|l", &streamind, &sequence, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS|l", &streamind, &sequence, &flags) == FAILURE) { RETURN_THROWS(); } if (flags && ((flags & ~FT_UID) != 0)) { - php_error_docref(NULL, E_WARNING, "Invalid value for the options parameter"); - RETURN_FALSE; + zend_argument_value_error(3, "must be FT_UID or 0"); + RETURN_THROWS(); } if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) { @@ -3103,6 +3169,7 @@ PHP_FUNCTION(imap_mail_compose) first = 0; if (Z_TYPE_P(data) != IS_ARRAY) { + // TODO ValueError php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array"); RETURN_FALSE; } @@ -3295,6 +3362,7 @@ PHP_FUNCTION(imap_mail_compose) } ZEND_HASH_FOREACH_END(); if (first) { + // TODO ValueError php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array"); RETURN_FALSE; } @@ -3410,7 +3478,8 @@ PHP_FUNCTION(imap_mail_compose) /* }}} */ /* {{{ _php_imap_mail */ -int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath) +bool _php_imap_mail(zend_string *to, zend_string *subject, zend_string *message, zend_string *headers, + zend_string *cc, zend_string *bcc, zend_string* rpath) { #ifdef PHP_WIN32 int tsm_err; @@ -3419,6 +3488,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * int ret; #endif + ZEND_ASSERT(to && ZSTR_LEN(to) != 0); + ZEND_ASSERT(subject && ZSTR_LEN(subject) != 0); + #ifdef PHP_WIN32 char *tempMailTo; char *tsm_errmsg = NULL; @@ -3427,14 +3499,13 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * size_t offset, bufferLen = 0; size_t bt_len; + /* Add "To" field's necessary buffer length */ + bufferLen += ZSTR_LEN(to) + 6; if (headers) { - bufferLen += strlen(headers); - } - if (to) { - bufferLen += strlen(to) + 6; + bufferLen += ZSTR_LEN(headers); } if (cc) { - bufferLen += strlen(cc) + 6; + bufferLen += ZSTR_LEN(cc) + 6; } #define PHP_IMAP_CLEAN if (bufferTo) efree(bufferTo); if (bufferCc) efree(bufferCc); if (bufferBcc) efree(bufferBcc); if (bufferHeader) efree(bufferHeader); @@ -3442,41 +3513,41 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * bufferHeader = (char *)safe_emalloc(bufferLen, 1, 1); memset(bufferHeader, 0, bufferLen); - if (to && *to) { - strlcat(bufferHeader, "To: ", bufferLen + 1); - strlcat(bufferHeader, to, bufferLen + 1); - strlcat(bufferHeader, "\r\n", bufferLen + 1); - tempMailTo = estrdup(to); - bt_len = strlen(to); - bufferTo = (char *)safe_emalloc(bt_len, 1, 1); - bt_len++; - offset = 0; - addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, "NO HOST"); - while (addr) { - if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { - PHP_IMAP_BAD_DEST; - } else { - bufferTo = safe_erealloc(bufferTo, bt_len, 1, strlen(addr->mailbox)); - bt_len += strlen(addr->mailbox); - bufferTo = safe_erealloc(bufferTo, bt_len, 1, strlen(addr->host)); - bt_len += strlen(addr->host); - offset += slprintf(bufferTo + offset, bt_len - offset, "%s@%s,", addr->mailbox, addr->host); - } - addr = addr->next; - } - efree(tempMailTo); - if (offset>0) { - bufferTo[offset-1] = 0; + + /* Handle "To" Field */ + strlcat(bufferHeader, "To: ", bufferLen + 1); + strlcat(bufferHeader, ZSTR_VAL(to), bufferLen + 1); + strlcat(bufferHeader, "\r\n", bufferLen + 1); + tempMailTo = estrdup(ZSTR_VAL(to)); + bt_len = ZSTR_LEN(to); + bufferTo = (char *)safe_emalloc(bt_len, 1, 1); + bt_len++; + offset = 0; + addr = NULL; + rfc822_parse_adrlist(&addr, tempMailTo, "NO HOST"); + while (addr) { + if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { + PHP_IMAP_BAD_DEST; + } else { + bufferTo = safe_erealloc(bufferTo, bt_len, 1, strlen(addr->mailbox)); + bt_len += strlen(addr->mailbox); + bufferTo = safe_erealloc(bufferTo, bt_len, 1, strlen(addr->host)); + bt_len += strlen(addr->host); + offset += slprintf(bufferTo + offset, bt_len - offset, "%s@%s,", addr->mailbox, addr->host); } + addr = addr->next; + } + efree(tempMailTo); + if (offset>0) { + bufferTo[offset-1] = 0; } - if (cc && *cc) { + if (cc && ZSTR_LEN(cc) != 0) { strlcat(bufferHeader, "Cc: ", bufferLen + 1); - strlcat(bufferHeader, cc, bufferLen + 1); + strlcat(bufferHeader, ZSTR_VAL(cc), bufferLen + 1); strlcat(bufferHeader, "\r\n", bufferLen + 1); - tempMailTo = estrdup(cc); - bt_len = strlen(cc); + tempMailTo = estrdup(ZSTR_VAL(cc)); + bt_len = ZSTR_LEN(cc); bufferCc = (char *)safe_emalloc(bt_len, 1, 1); bt_len++; offset = 0; @@ -3500,9 +3571,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * } } - if (bcc && *bcc) { - tempMailTo = estrdup(bcc); - bt_len = strlen(bcc); + if (bcc && ZSTR_LEN(bcc)) { + tempMailTo = estrdup(ZSTR_VAL(bcc)); + bt_len = ZSTR_LEN(bcc); bufferBcc = (char *)safe_emalloc(bt_len, 1, 1); bt_len++; offset = 0; @@ -3526,11 +3597,12 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * } } - if (headers && *headers) { - strlcat(bufferHeader, headers, bufferLen + 1); + if (headers && ZSTR_LEN(headers)) { + strlcat(bufferHeader, ZSTR_VAL(headers), bufferLen + 1); } - if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) { + if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, ZSTR_VAL(subject), + bufferTo, ZSTR_VAL(message), bufferCc, bufferBcc, ZSTR_VAL(rpath)) != SUCCESS) { if (tsm_errmsg) { php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg); efree(tsm_errmsg); @@ -3547,15 +3619,15 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * } sendmail = popen(INI_STR("sendmail_path"), "w"); if (sendmail) { - if (rpath && rpath[0]) fprintf(sendmail, "From: %s\n", rpath); - fprintf(sendmail, "To: %s\n", to); - if (cc && cc[0]) fprintf(sendmail, "Cc: %s\n", cc); - if (bcc && bcc[0]) fprintf(sendmail, "Bcc: %s\n", bcc); - fprintf(sendmail, "Subject: %s\n", subject); + if (ZSTR_LEN(rpath) != 0) fprintf(sendmail, "From: %s\n", ZSTR_VAL(rpath)); + fprintf(sendmail, "To: %s\n", ZSTR_VAL(to)); + if (ZSTR_LEN(cc) != 0) fprintf(sendmail, "Cc: %s\n", ZSTR_VAL(cc)); + if (ZSTR_LEN(bcc) != 0) fprintf(sendmail, "Bcc: %s\n", ZSTR_VAL(bcc)); + fprintf(sendmail, "Subject: %s\n", ZSTR_VAL(subject)); if (headers != NULL) { - fprintf(sendmail, "%s\n", headers); + fprintf(sendmail, "%s\n", ZSTR_VAL(headers)); } - fprintf(sendmail, "\n%s\n", message); + fprintf(sendmail, "\n%s\n", ZSTR_VAL(message)); ret = pclose(sendmail); return ret != -1; @@ -3572,33 +3644,32 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * PHP_FUNCTION(imap_mail) { zend_string *to=NULL, *message=NULL, *headers=NULL, *subject=NULL, *cc=NULL, *bcc=NULL, *rpath=NULL; - int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "SSS|SSSS", &to, &subject, &message, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "PPP|P!P!P!P!", &to, &subject, &message, &headers, &cc, &bcc, &rpath) == FAILURE) { RETURN_THROWS(); } /* To: */ - if (!ZSTR_LEN(to)) { - php_error_docref(NULL, E_WARNING, "No to field in mail command"); - RETURN_FALSE; + if (ZSTR_LEN(to) == 0) { + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); } /* Subject: */ - if (!ZSTR_LEN(subject)) { - php_error_docref(NULL, E_WARNING, "No subject field in mail command"); - RETURN_FALSE; + if (ZSTR_LEN(subject) == 0) { + zend_argument_value_error(2, "cannot be empty"); + RETURN_THROWS(); } /* message body */ - if (!ZSTR_LEN(message)) { + if (ZSTR_LEN(message) == 0) { /* this is not really an error, so it is allowed. */ + // TODO Drop warning or emit ValueError? php_error_docref(NULL, E_WARNING, "No message string in mail command"); } - if (_php_imap_mail(ZSTR_VAL(to), ZSTR_VAL(subject), ZSTR_VAL(message), headers?ZSTR_VAL(headers):NULL, cc?ZSTR_VAL(cc):NULL, - bcc?ZSTR_VAL(bcc):NULL, rpath?ZSTR_VAL(rpath):NULL)) { + if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath)) { RETURN_TRUE; } else { RETURN_FALSE; @@ -3626,6 +3697,12 @@ PHP_FUNCTION(imap_search) RETURN_THROWS(); } + /* TODO Update docs to allow SE_FREE as an option */ + if (flags && ((flags & ~(SE_FREE | SE_UID)) != 0)) { + zend_argument_value_error(3, "must be a bitmask of SE_FREE, and SE_UID"); + RETURN_THROWS(); + } + search_criteria = estrndup(ZSTR_VAL(criteria), ZSTR_LEN(criteria)); IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL; @@ -4204,10 +4281,9 @@ PHP_FUNCTION(imap_thread) zend_long flags = SE_FREE; char criteria[] = "ALL"; THREADNODE *top; - int argc = ZEND_NUM_ARGS(); SEARCHPGM *pgm = NIL; - if (zend_parse_parameters(argc, "r|l", &streamind, &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &streamind, &flags) == FAILURE) { RETURN_THROWS(); } @@ -4215,19 +4291,21 @@ PHP_FUNCTION(imap_thread) RETURN_THROWS(); } + /* TODO Check if flags are valid (documentation is not present on php.net so need to check this first) */ + pgm = mail_criteria(criteria); top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags); if (pgm && !(flags & SE_FREE)) { mail_free_searchpgm(&pgm); } - if(top == NIL) { + if (top == NIL) { php_error_docref(NULL, E_WARNING, "Function returned an empty tree"); RETURN_FALSE; } /* Populate our return value data structure here. */ - if(build_thread_tree(top, &return_value) == FAILURE) { + if (build_thread_tree(top, &return_value) == FAILURE) { mail_free_threadnode(&top); RETURN_FALSE; } diff --git a/ext/imap/php_imap.stub.php b/ext/imap/php_imap.stub.php index 9d2e1082c1a7c..0a7adc2736977 100644 --- a/ext/imap/php_imap.stub.php +++ b/ext/imap/php_imap.stub.php @@ -5,7 +5,7 @@ /** * @return resource|false */ -function imap_open(string $mailbox, string $user, string $password, int $options = 0, int $n_retries = 0, array $params = UNKNOWN) {} +function imap_open(string $mailbox, string $user, string $password, int $options = 0, int $n_retries = 0, array $params = []) {} /** * @param resource $stream_id @@ -27,13 +27,7 @@ function imap_num_recent($stream_id): int|false {} function imap_headers($stream_id): array|false {} /** @param resource $stream_id */ -function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {} - -/** - * @param resource $stream_id - * @alias imap_headerinfo - */ -function imap_header($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0, string $default_host = UNKNOWN): stdClass|false {} +function imap_headerinfo($stream_id, int $msg_no, int $from_length = 0, int $subject_length = 0): stdClass|false {} function imap_rfc822_parse_headers(string $headers, string $default_host = "UNKNOWN"): stdClass {} @@ -148,7 +142,7 @@ function imap_subscribe($stream_id, string $mailbox): bool {} function imap_unsubscribe($stream_id, string $mailbox): bool {} /** @param resource $stream_id */ -function imap_append($stream_id, string $folder, string $message, string $options = UNKNOWN, string $internal_date = UNKNOWN): bool {} +function imap_append($stream_id, string $folder, string $message, ?string $options = null, ?string $internal_date = null): bool {} /** @param resource $stream_id */ function imap_ping($stream_id): bool {} @@ -180,7 +174,7 @@ function imap_setflag_full($stream_id, string $sequence, string $flag, int $opti function imap_clearflag_full($stream_id, string $sequence, string $flag, int $options = 0): bool {} /** @param resource $stream_id */ -function imap_sort($stream_id, int $criteria, int $reverse, int $options = 0, string $search_criteria = UNKNOWN, string $charset = UNKNOWN): array|false {} +function imap_sort($stream_id, int $criteria, int $reverse, int $options = 0, ?string $search_criteria = null, ?string $charset = null): array|false {} /** @param resource $stream_id */ function imap_uid($stream_id, int $msg_no): int|false {} @@ -258,4 +252,4 @@ function imap_setacl($stream_id, string $mailbox, string $id, string $rights): b function imap_getacl($stream_id, string $mailbox): array|false {} #endif -function imap_mail(string $to, string $subject, string $message, string $additional_headers = UNKNOWN, string $cc = UNKNOWN, string $bcc = UNKNOWN, string $rpath = UNKNOWN): bool {} +function imap_mail(string $to, string $subject, string $message, ?string $additional_headers = null, ?string $cc = null, ?string $bcc = null, ?string $rpath = null): bool {} diff --git a/ext/imap/php_imap_arginfo.h b/ext/imap/php_imap_arginfo.h index 69fe25e4d0f4c..ffb60a034f890 100644 --- a/ext/imap/php_imap_arginfo.h +++ b/ext/imap/php_imap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4991f82d78672ab23044864fa6dd75851952965c */ + * Stub hash: e501d6869d721ad720a1a7c8b597b96e9591d5ed */ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) @@ -7,7 +7,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, n_retries, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_reopen, 0, 2, _IS_BOOL, 0) @@ -37,11 +37,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_headerinfo, 0, 2, stdCl ZEND_ARG_TYPE_INFO(0, msg_no, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, from_length, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, subject_length, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO(0, default_host, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_imap_header arginfo_imap_headerinfo - ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_imap_rfc822_parse_headers, 0, 1, stdClass, 0) ZEND_ARG_TYPE_INFO(0, headers, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, default_host, IS_STRING, 0, "\"UNKNOWN\"") @@ -173,8 +170,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_append, 0, 3, _IS_BOOL, 0) ZEND_ARG_INFO(0, stream_id) ZEND_ARG_TYPE_INFO(0, folder, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, internal_date, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, internal_date, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #define arginfo_imap_ping arginfo_imap_expunge @@ -217,8 +214,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_sort, 0, 3, MAY_BE_ARRAY|MA ZEND_ARG_TYPE_INFO(0, criteria, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, reverse, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO(0, search_criteria, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, search_criteria, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_imap_uid, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) @@ -342,10 +339,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_mail, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, additional_headers, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cc, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, bcc, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, rpath, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_headers, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cc, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bcc, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rpath, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -440,7 +437,6 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(imap_num_recent, arginfo_imap_num_recent) ZEND_FE(imap_headers, arginfo_imap_headers) ZEND_FE(imap_headerinfo, arginfo_imap_headerinfo) - ZEND_FALIAS(imap_header, imap_headerinfo, arginfo_imap_header) ZEND_FE(imap_rfc822_parse_headers, arginfo_imap_rfc822_parse_headers) ZEND_FE(imap_rfc822_write_address, arginfo_imap_rfc822_write_address) ZEND_FE(imap_rfc822_parse_adrlist, arginfo_imap_rfc822_parse_adrlist) diff --git a/ext/imap/tests/README.md b/ext/imap/tests/README.md index 381cdc2e8eb08..6324ab7f9e60b 100644 --- a/ext/imap/tests/README.md +++ b/ext/imap/tests/README.md @@ -9,40 +9,16 @@ files will need to be changed to match the local mailserver configuration. The tests have been checked using dovecot (on Linux 32 and 64 bit systems) and hMailServer on Windows. The tests are intended to be mailserver agnostic. -The tests can be run without modification with a fairly minimal dovecot -installation. For information, the dovecot.conf file used in running the tests -is given below. The dovecot password file (dovecotpass) requires a password for -one user, `webmaster@something.com`. It's also necessary to set up one -additional user ID (vmail) to own the mail directory. +## Set-up tests on Ubuntu (checked on Ubuntu 18.04 (Bionic)) +The necessary packages can be installed using the following command; +`apt-get install libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd` -```txt -protocols = imap imaps - -listen = * - -ssl_disable = yes - -disable_plaintext_auth=yes - -## Mailbox locations and namespaces - -mail_location = maildir:/home/vmail/mail/%d/%n/Maildir - -auth_verbose = yes - -auth_debug = yes - -auth default { - mechanisms = login - - passdb passwd-file { - args = /etc/dovecot/dovecotpass - } - - userdb static { - args = uid=11459 gid=1002 home=/home/vmail/dovecot/mail/%d/%n - } - - user = root -} +The build of PHP will need to be compiled with the following flags: +``` +--with-imap --with-kerberos --with-imap-ssl ``` + +Then run the set-up script `ext/imap/tests/setup.sh` which will add the `vmail` +group and user which is used by Dovecot for the mailbox. It will also copy the +`ext/imap/tests/dovecot.conf` and `ext/imap/tests/dovecotpass` to the correct +location for Dovecot and restarts it for the new configuration to be enabled. diff --git a/ext/imap/tests/imap_body.phpt b/ext/imap/tests/imap_body.phpt index 4d4133c343fc7..752ca1c39db77 100644 --- a/ext/imap/tests/imap_body.phpt +++ b/ext/imap/tests/imap_body.phpt @@ -1,5 +1,5 @@ --TEST-- -imap_body() incorrect parameter count +imap_body() ValueError --CREDITS-- Paul Sohier #phptestfest utrecht @@ -14,19 +14,26 @@ require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); -imap_body($stream_id,-1); -imap_body($stream_id,1,-1); +try { + imap_body($stream_id,-1); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} +try { + imap_body($stream_id,1,-1); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} //Access not existing -var_dump(imap_body($stream_id, 999, FT_UID)); +var_dump(imap_body($stream_id, 255, FT_UID)); imap_close($stream_id); ?> --EXPECTF-- -Warning: imap_body(): Bad message number in %s on line %d +imap_body(): Argument #2 ($msg_no) must be greater than 0 +imap_body(): Argument #3 ($options) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL -Warning: imap_body(): Invalid value for the options parameter in %s on line %d - -Warning: imap_body(): Bad message number in %s on line %d +Warning: imap_body(): UID does not exist in %s on line %d bool(false) diff --git a/ext/imap/tests/imap_close_variation4.phpt b/ext/imap/tests/imap_close_variation4.phpt index c6f13678cc5b9..56e3722e9e382 100644 --- a/ext/imap/tests/imap_close_variation4.phpt +++ b/ext/imap/tests/imap_close_variation4.phpt @@ -28,7 +28,12 @@ foreach($inputs as $input) { imap_delete($stream_id, $i); } echo "\n-- Iteration $iterator --\n"; - var_dump( $check = imap_close($stream_id, $input) ); + try { + var_dump( $check = imap_close($stream_id, $input) ); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + $check = false; + } // check that imap_close was successful, if not call imap_close and explicitly set CL_EXPUNGE if(false === $check) { @@ -71,16 +76,10 @@ bool(true) CL_EXPUNGE was set -- Iteration 3 -- - -Warning: imap_close(): Invalid value for the flags parameter in %s on line %d -bool(false) +imap_close(): Argument #2 ($options) must be CL_EXPUNGE or 0 -- Iteration 4 -- - -Warning: imap_close(): Invalid value for the flags parameter in %s on line %d -bool(false) +imap_close(): Argument #2 ($options) must be CL_EXPUNGE or 0 -- Iteration 5 -- - -Warning: imap_close(): Invalid value for the flags parameter in %s on line %d -bool(false) +imap_close(): Argument #2 ($options) must be CL_EXPUNGE or 0 diff --git a/ext/imap/tests/imap_errors_basic.phpt b/ext/imap/tests/imap_errors_basic.phpt index c3d890aa5dbe6..c89719376658d 100644 --- a/ext/imap/tests/imap_errors_basic.phpt +++ b/ext/imap/tests/imap_errors_basic.phpt @@ -1,30 +1,25 @@ --TEST-- -Test imap_errors() function : basic functionality +Test imap_errors() function : invalid password --SKIPIF-- --FILE-- --EXPECTF-- -*** Testing imap_errors() : basic functionality *** -Issue open with invalid password with normal default number of retries, i.e 3 +*** Testing imap_errors() : invalid password *** +Issue opening with invalid password, 1 retry Warning: imap_open(): Couldn't open stream %s in %s on line %d List any errors @@ -33,16 +28,4 @@ array(%d) { string(%d) "%s" [1]=> string(%d) "%s" - [2]=> - string(%d) "%a -} - - -Issue open with invalid password with retries == 1 - -Warning: imap_open(): Couldn't open stream %s in %s on line %d -List any errors -array(%d) { - [0]=> - string(%d) "%a } diff --git a/ext/imap/tests/imap_fetch_overview_variation3.phpt b/ext/imap/tests/imap_fetch_overview_variation3.phpt index 419de4c95152f..68d8d20ce4150 100644 --- a/ext/imap/tests/imap_fetch_overview_variation3.phpt +++ b/ext/imap/tests/imap_fetch_overview_variation3.phpt @@ -25,21 +25,21 @@ $options = array ('1', true, 1.000000000000001, 0.00001e5, - PHP_INT_MAX, - -PHP_INT_MAX + 245 ); -// iterate over each element of $options array -$iterator = 1; imap_check($stream_id); foreach($options as $option) { echo "\nTesting with option value:"; var_dump($option); - $overview = imap_fetch_overview($stream_id, $msg_uid, $option); - if ($overview) { - echo "imap_fetch_overview() returns an object\n"; + try { + $overview = imap_fetch_overview($stream_id, $msg_uid, $option); + if ($overview) { + echo "imap_fetch_overview() returns an object\n"; } - $iterator++; + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } } ?> @@ -64,10 +64,5 @@ imap_fetch_overview() returns an object Testing with option value:float(1) imap_fetch_overview() returns an object -Testing with option value:int(%d) - -Warning: imap_fetch_overview(): Invalid value for the options parameter in %s on line %d - -Testing with option value:int(-%d) - -Warning: imap_fetch_overview(): Invalid value for the options parameter in %s on line %d +Testing with option value:int(245) +imap_fetch_overview(): Argument #3 ($options) must be FT_UID or 0 diff --git a/ext/imap/tests/imap_fetchbody_variation4.phpt b/ext/imap/tests/imap_fetchbody_variation4.phpt index 45158a9ed0295..510e78fd3101a 100644 --- a/ext/imap/tests/imap_fetchbody_variation4.phpt +++ b/ext/imap/tests/imap_fetchbody_variation4.phpt @@ -31,11 +31,16 @@ $iterator = 1; imap_check($stream_id); foreach($options as $option) { echo "\n-- Iteration $iterator --\n"; - if(is_string(imap_fetchbody($stream_id, $msg_uid, $section, $option))) { - echo "FT_UID valid\n"; - } else { - echo "FT_UID not valid\n"; + + try { + if(is_string(imap_fetchbody($stream_id, $msg_uid, $section, $option))) { + echo "FT_UID valid\n"; + } else { + echo "FT_UID not valid\n"; } + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } $iterator++; } @@ -62,11 +67,7 @@ FT_UID valid FT_UID valid -- Iteration 5 -- - -Warning: imap_fetchbody(): Invalid value for the options parameter in %s on line %d -FT_UID not valid +imap_fetchbody(): Argument #4 ($options) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL -- Iteration 6 -- - -Warning: imap_fetchbody(): Invalid value for the options parameter in %s on line %d -FT_UID not valid +imap_fetchbody(): Argument #4 ($options) must be a bitmask of FT_UID, FT_PEEK, and FT_INTERNAL diff --git a/ext/imap/tests/imap_fetchbody_variation6.phpt b/ext/imap/tests/imap_fetchbody_variation6.phpt index 75516f8381454..fd5a898b680d9 100644 --- a/ext/imap/tests/imap_fetchbody_variation6.phpt +++ b/ext/imap/tests/imap_fetchbody_variation6.phpt @@ -23,9 +23,10 @@ $sequences = [0, /* out of range */ 4, 1]; foreach($sequences as $msg_no) { echo "\n-- \$msg_no is $msg_no --\n"; - var_dump($overview = imap_fetchbody($stream_id, $msg_no, $section)); - if (!$overview) { - echo imap_last_error() . "\n"; + try { + var_dump(imap_fetchbody($stream_id, $msg_no, $section)); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; } } ?> @@ -39,17 +40,13 @@ Create a temporary mailbox and add 3 msgs .. mailbox '{%s}%s' created -- $msg_no is 0 -- - -Warning: imap_fetchbody(): Bad message number in %s on line %d -bool(false) - +imap_fetchbody(): Argument #2 ($msg_no) must be greater than 0 -- $msg_no is 4 -- Warning: imap_fetchbody(): Bad message number in %s on line %d bool(false) - -- $msg_no is 1 -- string(42) "1: this is a test message, please ignore " diff --git a/ext/imap/tests/imap_fetchheader_variation3.phpt b/ext/imap/tests/imap_fetchheader_variation3.phpt index 8f6b5b5a12191..9391393782338 100644 --- a/ext/imap/tests/imap_fetchheader_variation3.phpt +++ b/ext/imap/tests/imap_fetchheader_variation3.phpt @@ -30,11 +30,15 @@ $iterator = 1; imap_check($stream_id); foreach($options as $option) { echo "\n-- Iteration $iterator --\n"; - if(is_string(imap_fetchheader($stream_id, $msg_uid, $option))) { - echo "FT_UID valid\n"; - } else { - echo "FT_UID not valid\n"; + try { + if (is_string(imap_fetchheader($stream_id, $msg_uid, $option))) { + echo "FT_UID valid\n"; + } else { + echo "FT_UID not valid\n"; } + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; + } $iterator++; } ?> @@ -60,11 +64,7 @@ FT_UID valid FT_UID valid -- Iteration 5 -- - -Warning: imap_fetchheader(): Invalid value for the options parameter in %s on line %d -FT_UID not valid +imap_fetchheader(): Argument #3 ($options) must be a bitmask of FT_UID, FT_PREFETCHTEXT, and FT_INTERNAL -- Iteration 6 -- - -Warning: imap_fetchheader(): Invalid value for the options parameter in %s on line %d -FT_UID not valid +imap_fetchheader(): Argument #3 ($options) must be a bitmask of FT_UID, FT_PREFETCHTEXT, and FT_INTERNAL diff --git a/ext/imap/tests/imap_fetchheader_variation5.phpt b/ext/imap/tests/imap_fetchheader_variation5.phpt index 2283861df8e8a..7e45f1ba46ac9 100644 --- a/ext/imap/tests/imap_fetchheader_variation5.phpt +++ b/ext/imap/tests/imap_fetchheader_variation5.phpt @@ -21,9 +21,10 @@ $sequences = [0, /* out of range */ 4, 1]; foreach($sequences as $msg_no) { echo "\n-- \$msg_no is $msg_no --\n"; - var_dump($overview = imap_fetchheader($stream_id, $msg_no)); - if (!$overview) { - echo imap_last_error() . "\n"; + try { + var_dump(imap_fetchheader($stream_id, $msg_no)); + } catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; } } @@ -40,17 +41,13 @@ Create a temporary mailbox and add 3 msgs .. mailbox '{%s}%s' created -- $msg_no is 0 -- - -Warning: imap_fetchheader(): Bad message number in %s on line %d -bool(false) - +imap_fetchheader(): Argument #2 ($msg_no) must be greater than 0 -- $msg_no is 4 -- Warning: imap_fetchheader(): Bad message number in %s on line %d bool(false) - -- $msg_no is 1 -- string(%d) "From: foo@anywhere.com Subject: Test msg 1 diff --git a/ext/imap/tests/imap_fetchstructure_basic.phpt b/ext/imap/tests/imap_fetchstructure_basic.phpt index 572556e6e13d1..11c1f7efb253c 100644 --- a/ext/imap/tests/imap_fetchstructure_basic.phpt +++ b/ext/imap/tests/imap_fetchstructure_basic.phpt @@ -12,7 +12,11 @@ require_once(__DIR__.'/skipif.inc'); require_once(__DIR__.'/imap_include.inc'); $stream_id = setup_test_mailbox('', 1); -imap_fetchstructure($stream_id,0); +try { + imap_fetchstructure($stream_id,0); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} $z = imap_fetchstructure($stream_id,1); @@ -39,6 +43,7 @@ require_once('clean.inc'); --EXPECTF-- Create a temporary mailbox and add 1 msgs .. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created +imap_fetchstructure(): Argument #2 ($msg_no) must be greater than 0 bool(true) bool(true) bool(true) diff --git a/ext/imap/tests/imap_gc_error.phpt b/ext/imap/tests/imap_gc_error.phpt index 072af103930cb..5b5b65d271422 100644 --- a/ext/imap/tests/imap_gc_error.phpt +++ b/ext/imap/tests/imap_gc_error.phpt @@ -13,8 +13,13 @@ require_once(__DIR__.'/skipif.inc'); require_once(__DIR__.'/imap_include.inc'); $stream_id = imap_open($default_mailbox, $username, $password) or die("Cannot connect to mailbox $default_mailbox: " . imap_last_error()); -imap_gc($stream_id, -1); + +try { + imap_gc($stream_id, -1); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: imap_gc(): Invalid value for the flags parameter in %s on line %d +--EXPECT-- +imap_gc(): Argument #2 ($flags) must be a bitmask of IMAP_GC_TEXTS, IMAP_GC_ELT, and IMAP_GC_ENV diff --git a/ext/imap/tests/imap_getsubscribed_basic.phpt b/ext/imap/tests/imap_getsubscribed_basic.phpt index bba82271c7ca3..8e5d85383daef 100644 --- a/ext/imap/tests/imap_getsubscribed_basic.phpt +++ b/ext/imap/tests/imap_getsubscribed_basic.phpt @@ -5,6 +5,7 @@ Olivier Doucet --SKIPIF-- --FILE-- --FILE-- --FILE-- getMessage() . \PHP_EOL; +} require_once(__DIR__.'/imap_include.inc'); -imap_open($default_mailbox, $username, $password, NIL, -1); + +try { + imap_open($default_mailbox, $username, $password, NIL, -1); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> --EXPECTF-- Checking with incorrect parameters Warning: imap_open(): Couldn't open stream in %s on line %d - -Warning: imap_open(): Couldn't open stream in %s on line %d - -Warning: imap_open(): Retries must be greater or equal to 0 in %s on line %d +imap_open(): Argument #4 ($options) must be a bitmask of the OP_* constants, and CL_EXPUNGE +imap_open(): Argument #5 ($n_retries) must be greater than or equal to 0 Notice: Unknown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0 diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index da2cb85673b5c..c9c49fcb3c729 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -320,7 +320,7 @@ zval* collator_convert_string_to_double( zval* str, zval *rv ) */ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) { - int is_numeric = 0; + zend_uchar is_numeric = 0; zend_long lval = 0; double dval = 0; @@ -329,7 +329,7 @@ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) COLLATOR_CONVERT_RETURN_FAILED( str ); } - if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, 1 ) ) ) + if ( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, /* allow_errors */ 1 ) ) ) { if( is_numeric == IS_LONG ) { ZVAL_LONG(rv, lval); diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index 6f7311fa96070..3fa9c0d13bc5c 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -207,24 +207,18 @@ static zend_long collator_u_strtol(nptr, endptr, base) /* {{{ collator_is_numeric] * Taken from PHP6:is_numeric_unicode() */ -zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, int allow_errors ) +zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors ) { zend_long local_lval; double local_dval; UChar *end_ptr_long, *end_ptr_double; - int conv_base=10; if (!length) { return 0; } - /* handle hex numbers */ - if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) { - conv_base=16; - } - errno=0; - local_lval = collator_u_strtol(str, &end_ptr_long, conv_base); + local_lval = collator_u_strtol(str, &end_ptr_long, 10); if (errno != ERANGE) { if (end_ptr_long == str+length) { /* integer string */ if (lval) { @@ -238,11 +232,6 @@ zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, dou end_ptr_long = NULL; } - if (conv_base == 16) { /* hex string, under UNIX strtod() messes it up */ - /* UTODO: keep compatibility with is_numeric_string() here? */ - return 0; - } - local_dval = collator_u_strtod(str, &end_ptr_double); if (local_dval == 0 && end_ptr_double == str) { end_ptr_double = NULL; @@ -263,9 +252,6 @@ zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, dou if (!allow_errors) { return 0; } - if (allow_errors == -1) { - zend_error(E_NOTICE, "A non well formed numeric value encountered"); - } if (allow_errors) { if (end_ptr_double > end_ptr_long && dval) { diff --git a/ext/intl/collator/collator_is_numeric.h b/ext/intl/collator/collator_is_numeric.h index 34b84e9990ba2..e6b5b18658cd6 100644 --- a/ext/intl/collator/collator_is_numeric.h +++ b/ext/intl/collator/collator_is_numeric.h @@ -19,6 +19,6 @@ #include #include -zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, int allow_errors ); +zend_uchar collator_is_numeric( UChar *str, int32_t length, zend_long *lval, double *dval, bool allow_errors ); #endif // COLLATOR_IS_NUMERIC_H diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 8706381e58825..e45330e15085e 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -129,21 +129,17 @@ PHP_FUNCTION(grapheme_strpos) RETURN_THROWS(); } - if (offset >= 0) { + if (offset >= 0 && grapheme_ascii_check((unsigned char *)haystack, haystack_len) >= 0) { /* quick check to see if the string might be there * I realize that 'offset' is 'grapheme count offset' but will work in spite of that */ found = php_memnstr(haystack + noffset, needle, needle_len, haystack + haystack_len); /* if it isn't there the we are done */ - if (!found) { - RETURN_FALSE; - } - - /* if it is there, and if the haystack is ascii, we are all done */ - if ( grapheme_ascii_check((unsigned char *)haystack, haystack_len) >= 0 ) { + if (found) { RETURN_LONG(found - haystack); } + RETURN_FALSE; } /* do utf16 part of the strpos */ @@ -375,22 +371,20 @@ PHP_FUNCTION(grapheme_substr) RETURN_THROWS(); } - if ( OUTSIDE_STRING(lstart, str_len)) { - zend_argument_value_error(2, "must be contained in argument #1 ($string)"); + if (lstart < INT32_MIN || lstart > INT32_MAX) { + zend_argument_value_error(2, "is too large"); RETURN_THROWS(); } - /* we checked that it will fit: */ start = (int32_t) lstart; - if(no_length) { + if (no_length) { length = str_len; } - if(length < INT32_MIN) { - length = INT32_MIN; - } else if(length > INT32_MAX) { - length = INT32_MAX; + if (length < INT32_MIN || length > INT32_MAX) { + zend_argument_value_error(3, "is too large"); + RETURN_THROWS(); } /* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */ @@ -455,15 +449,17 @@ PHP_FUNCTION(grapheme_substr) start += iter_val; } - if ( 0 != start || sub_str_start_pos >= ustr_len ) { - - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 ); - - if (ustr) { - efree(ustr); + if (0 != start) { + if (start > 0) { + if (ustr) { + efree(ustr); + } + ubrk_close(bi); + RETURN_EMPTY_STRING(); } - ubrk_close(bi); - RETURN_FALSE; + + sub_str_start_pos = 0; + ubrk_first(bi); } /* OK to convert here since if str_len were big, convert above would fail */ @@ -530,20 +526,17 @@ PHP_FUNCTION(grapheme_substr) ubrk_close(bi); if ( UBRK_DONE == sub_str_end_pos) { - if(length < 0) { - zend_argument_value_error(3, "must be contained in argument #1 ($string)"); + if (length < 0) { efree(ustr); - RETURN_THROWS(); + RETURN_EMPTY_STRING(); } else { sub_str_end_pos = ustr_len; } } - if(sub_str_start_pos > sub_str_end_pos) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 ); - + if (sub_str_start_pos > sub_str_end_pos) { efree(ustr); - RETURN_FALSE; + RETURN_EMPTY_STRING(); } status = U_ZERO_ERROR; @@ -586,9 +579,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas if ( !f_ignore_case ) { - /* ASCII optimization: quick check to see if the string might be there - * I realize that 'offset' is 'grapheme count offset' but will work in spite of that - */ + /* ASCII optimization: quick check to see if the string might be there */ found = php_memnstr(haystack, needle, needle_len, haystack + haystack_len); /* if it isn't there the we are done */ @@ -778,7 +769,7 @@ PHP_FUNCTION(grapheme_extract) } if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) { - zend_argument_value_error(3, "must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS"); + zend_argument_value_error(3, "must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS"); RETURN_THROWS(); } diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index 71d60749990c0..8633fddf5bc10 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -57,20 +57,6 @@ void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char return; } - if ((l < 0 && -l > str_len2)) { - return; - } else if (l > 0 && l > str_len2) { - l = str_len2; - } - - if (f > str_len2 || (f < 0 && -f > str_len2)) { - return; - } - - if (l < 0 && str_len2 < f - l) { - return; - } - /* if "from" position is negative, count start position from the end * of the string */ @@ -79,8 +65,9 @@ void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char if (f < 0) { f = 0; } - } - + } else if (f > str_len2) { + f = str_len2; + } /* if "length" position is negative, set it to the length * needed to stop that many chars from the end of the string @@ -90,40 +77,21 @@ void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char if (l < 0) { l = 0; } - } - - if (f >= str_len2) { - return; - } - - if ((f + l) > str_len2) { - l = str_len - f; - } + } else if (l > str_len2 - f) { + l = str_len2 - f; + } *sub_str = str + f; *sub_str_len = l; - - return; } /* }}} */ -#define STRPOS_CHECK_STATUS(status, error) \ - if ( U_FAILURE( (status) ) ) { \ - intl_error_set_code( NULL, (status) ); \ - intl_error_set_custom_msg( NULL, (error), 0 ); \ - if (uhaystack) { \ - efree( uhaystack ); \ - } \ - if (uneedle) { \ - efree( uneedle ); \ - } \ - if(bi) { \ - ubrk_close (bi); \ - } \ - if(src) { \ - usearch_close(src); \ - } \ - return -1; \ +#define STRPOS_CHECK_STATUS(status, error) \ + if ( U_FAILURE( (status) ) ) { \ + intl_error_set_code( NULL, (status) ); \ + intl_error_set_custom_msg( NULL, (error), 0 ); \ + ret_pos = -1; \ + goto finish; \ } @@ -172,9 +140,10 @@ int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, if(offset != 0) { offset_pos = grapheme_get_haystack_offset(bi, offset); - if(offset_pos == -1) { - status = U_ILLEGAL_ARGUMENT_ERROR; - STRPOS_CHECK_STATUS(status, "Invalid search offset"); + if (offset_pos == -1) { + zend_argument_value_error(3, "must be contained in argument #1 ($haystack)"); + ret_pos = -1; + goto finish; } status = U_ZERO_ERROR; usearch_setOffset(src, offset_pos, &status); @@ -201,14 +170,19 @@ int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, ret_pos = -1; } +finish: if (uhaystack) { efree( uhaystack ); } if (uneedle) { efree( uneedle ); } - ubrk_close (bi); - usearch_close (src); + if (bi) { + ubrk_close (bi); + } + if (src) { + usearch_close (src); + } return ret_pos; } diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 508b7355f0217..6aeeed2bd798e 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -37,6 +37,6 @@ int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset); UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ); /* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */ -#define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset >= (zend_long) max_len) ) +#define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset > (zend_long) max_len) ) #endif // GRAPHEME_GRAPHEME_UTIL_H diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index b04b69cb88cd7..0d6387713e3ca 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c @@ -125,6 +125,7 @@ PHP_METHOD(Spoofchecker, setChecks) /* }}} */ #if U_ICU_VERSION_MAJOR_NUM >= 58 +/* TODO Document this method on PHP.net */ /* {{{ Set the loosest restriction level allowed for strings. */ PHP_METHOD(Spoofchecker, setRestrictionLevel) { @@ -143,8 +144,10 @@ PHP_METHOD(Spoofchecker, setRestrictionLevel) USPOOF_MODERATELY_RESTRICTIVE != level && USPOOF_MINIMALLY_RESTRICTIVE != level && USPOOF_UNRESTRICTIVE != level) { - php_error_docref(NULL, E_WARNING, "Invalid restriction level value"); - return; + zend_argument_value_error(1, "must be one of Spoofchecker::ASCII, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE, " + "Spoofchecker::SINGLE_HIGHLY_RESTRICTIVE, Spoofchecker::SINGLE_MODERATELY_RESTRICTIVE, " + "Spoofchecker::SINGLE_MINIMALLY_RESTRICTIVE, or Spoofchecker::UNRESTRICTIVE"); + RETURN_THROWS(); } uspoof_setRestrictionLevel(co->uspoof, (URestrictionLevel)level); diff --git a/ext/intl/tests/bug62083.phpt b/ext/intl/tests/bug62083.phpt index 5b0f36e4f0872..9896cea79fd84 100644 --- a/ext/intl/tests/bug62083.phpt +++ b/ext/intl/tests/bug62083.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -grapheme_extract(): Argument #3 ($extract_type) must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS +grapheme_extract(): Argument #3 ($extract_type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS diff --git a/ext/intl/tests/bug62759.phpt b/ext/intl/tests/bug62759.phpt index d4126b752fcb6..bbfb5032fc383 100644 --- a/ext/intl/tests/bug62759.phpt +++ b/ext/intl/tests/bug62759.phpt @@ -14,11 +14,11 @@ var_dump(intl_get_error_message()); var_dump(grapheme_substr('déjà', -1, 0)); ?> --EXPECT-- -bool(false) string(0) "" -bool(false) -string(61) "grapheme_substr: invalid parameters: U_ILLEGAL_ARGUMENT_ERROR" string(0) "" -bool(false) -string(65) "grapheme_substr: length is beyond start: U_ILLEGAL_ARGUMENT_ERROR" +string(0) "" +string(12) "U_ZERO_ERROR" +string(0) "" +string(0) "" +string(12) "U_ZERO_ERROR" string(0) "" diff --git a/ext/intl/tests/grapheme.phpt b/ext/intl/tests/grapheme.phpt index 18cf3fb6d5057..28234f261389f 100644 --- a/ext/intl/tests/grapheme.phpt +++ b/ext/intl/tests/grapheme.phpt @@ -325,23 +325,23 @@ function ut_main() $tests = array( - array( "abc", 3, "false" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "false" ), + array( "abc", 3, "" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "" ), array( "ao" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O", 2, $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O" ), array( $char_o_diaeresis_nfd . $char_a_ring_nfd . "a" . $char_A_ring_nfd . "bc", 2, "a" . $char_A_ring_nfd . "bc" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O", 5, "O" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_O_diaeresis_nfd, 4, $char_O_diaeresis_nfd ), array( $char_o_diaeresis_nfd . "a" . $char_a_ring_nfd . "bc", 2, $char_a_ring_nfd . "bc" ), array( "a" . $char_A_ring_nfd . "bc", 1, $char_A_ring_nfd . "bc" ), - array( "Abc", -5, "false" ), - array( $char_a_ring_nfd . "bc", 3, "false" ), - array( "abc", 4, "false" ), + array( "Abc", -5, "Abc" ), + array( $char_a_ring_nfd . "bc", 3, "" ), + array( "abc", 4, "" ), array( "abC", 2, "C" ), array( "abc", 1, "bc" ), array( "Abc", 1, 1, "b" ), array( "abc", 0, 2, "ab" ), - array( "Abc", -4, 1, "false" ), + array( "Abc", -4, 1, "A" ), array( "ababc", 1, 2, "ba" ), array( "ababc", 0, 10, "ababc" ), @@ -350,7 +350,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -1, "Op" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -2, "O" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -3, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -4, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -4, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -1, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Op" ), @@ -361,7 +361,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -6, "a" . $char_a_ring_nfd ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -7, "a" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -8, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -9, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -9, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -7, $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), @@ -371,7 +371,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -3, "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -2, "pq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -1, "q" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -999, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -999, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 8, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 7, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Op" ), @@ -382,7 +382,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 2, "a" . $char_a_ring_nfd ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 1, "a" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 0, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -999, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -999, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -1, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Op" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -2, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O" ), @@ -392,7 +392,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -6, "a" . $char_a_ring_nfd ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -7, "a" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -8, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -9, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -9, "" ), ); @@ -973,27 +973,23 @@ find "a%CC%8ABca%CC%8A" in "o%CC%88a%CC%8AaA%CC%8AbCa%CC%8Adef" - grapheme_strri function grapheme_substr($string, $start, $length = -1) {} -substring of "abc" from "3" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) - = 3 == false **FAILED** -substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = false == false +substring of "abc" from "3" - grapheme_substr = == +substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = == substring of "aoa%CC%8Abco%CC%88O" from "2" - grapheme_substr = a%CC%8Abco%CC%88O == a%CC%8Abco%CC%88O substring of "o%CC%88a%CC%8AaA%CC%8Abc" from "2" - grapheme_substr = aA%CC%8Abc == aA%CC%8Abc substring of "aa%CC%8Abco%CC%88O" from "5" - grapheme_substr = O == O -substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = false == false +substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = == substring of "aa%CC%8AbcO%CC%88" from "4" - grapheme_substr = O%CC%88 == O%CC%88 substring of "o%CC%88aa%CC%8Abc" from "2" - grapheme_substr = a%CC%8Abc == a%CC%8Abc substring of "aA%CC%8Abc" from "1" - grapheme_substr = A%CC%8Abc == A%CC%8Abc -substring of "Abc" from "-5" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) - = A%CC%8Abc == false **FAILED** -substring of "a%CC%8Abc" from "3" - grapheme_substr = false == false -substring of "abc" from "4" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) - = false == false +substring of "Abc" from "-5" - grapheme_substr = Abc == Abc +substring of "a%CC%8Abc" from "3" - grapheme_substr = == +substring of "abc" from "4" - grapheme_substr = == substring of "abC" from "2" - grapheme_substr = C == C substring of "abc" from "1" - grapheme_substr = bc == bc substring of "Abc" from "1" - grapheme_substr with length 1 = b == b substring of "abc" from "0" - grapheme_substr with length 2 = ab == ab -substring of "Abc" from "-4" - grapheme_substr with length 1: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) - = ab == false **FAILED** +substring of "Abc" from "-4" - grapheme_substr with length 1 = A == A substring of "ababc" from "1" - grapheme_substr with length 2 = ba == ba substring of "ababc" from "0" - grapheme_substr with length 10 = ababc == ababc substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length 10 = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq @@ -1001,7 +997,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr = Opq == Opq substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -1 = Op == Op substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -2 = O == O substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -3 = == -substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -4 = false == false +substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -4 = == substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -1 = aa%CC%8Abco%CC%88Op == aa%CC%8Abco%CC%88Op substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -2 = aa%CC%8Abco%CC%88O == aa%CC%8Abco%CC%88O @@ -1011,8 +1007,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -5 = substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -6 = aa%CC%8A == aa%CC%8A substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -7 = a == a substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -8 = == -substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -9: grapheme_substr(): Argument #3 ($length) must be contained in argument #1 ($string) - = == false **FAILED** +substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -9 = == substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-7" - grapheme_substr = a%CC%8Abco%CC%88Opq == a%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-6" - grapheme_substr = bco%CC%88Opq == bco%CC%88Opq @@ -1021,8 +1016,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "-4" - grapheme_substr = o%CC%88Opq == substring of "aa%CC%8Abco%CC%88Opq" from "-3" - grapheme_substr = Opq == Opq substring of "aa%CC%8Abco%CC%88Opq" from "-2" - grapheme_substr = pq == pq substring of "aa%CC%8Abco%CC%88Opq" from "-1" - grapheme_substr = q == q -substring of "aa%CC%8Abco%CC%88Opq" from "-999" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) - = q == false **FAILED** +substring of "aa%CC%8Abco%CC%88Opq" from "-999" - grapheme_substr = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 8 = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 7 = aa%CC%8Abco%CC%88Op == aa%CC%8Abco%CC%88Op substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 6 = aa%CC%8Abco%CC%88O == aa%CC%8Abco%CC%88O @@ -1032,8 +1026,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 3 = substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 2 = aa%CC%8A == aa%CC%8A substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 1 = a == a substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 0 = == -substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -999: grapheme_substr(): Argument #3 ($length) must be contained in argument #1 ($string) - = == false **FAILED** +substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -999 = == substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -1 = aa%CC%8Abco%CC%88Op == aa%CC%8Abco%CC%88Op substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -2 = aa%CC%8Abco%CC%88O == aa%CC%8Abco%CC%88O substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -3 = aa%CC%8Abco%CC%88 == aa%CC%8Abco%CC%88 @@ -1042,8 +1035,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -5 = substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -6 = aa%CC%8A == aa%CC%8A substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -7 = a == a substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -8 = == -substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -9: grapheme_substr(): Argument #3 ($length) must be contained in argument #1 ($string) - = == false **FAILED** +substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -9 = == function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {} diff --git a/ext/intl/tests/grapheme2.phpt b/ext/intl/tests/grapheme2.phpt index 90af00732fa7f..dd7bac43a8d91 100644 --- a/ext/intl/tests/grapheme2.phpt +++ b/ext/intl/tests/grapheme2.phpt @@ -325,23 +325,23 @@ function ut_main() $tests = array( - array( "abc", 3, "false" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "false" ), + array( "abc", 3, "" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "" ), array( "ao" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O", 2, $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O" ), array( $char_o_diaeresis_nfd . $char_a_ring_nfd . "a" . $char_A_ring_nfd . "bc", 2, "a" . $char_A_ring_nfd . "bc" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O", 5, "O" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd, 5, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_O_diaeresis_nfd, 4, $char_O_diaeresis_nfd ), array( $char_o_diaeresis_nfd . "a" . $char_a_ring_nfd . "bc", 2, $char_a_ring_nfd . "bc" ), array( "a" . $char_A_ring_nfd . "bc", 1, $char_A_ring_nfd . "bc" ), - array( "Abc", -5, "false" ), - array( $char_a_ring_nfd . "bc", 3, "false" ), - array( "abc", 4, "false" ), + array( "Abc", -5, "Abc" ), + array( $char_a_ring_nfd . "bc", 3, "" ), + array( "abc", 4, "" ), array( "abC", 2, "C" ), array( "abc", 1, "bc" ), array( "Abc", 1, 1, "b" ), array( "abc", 0, 2, "ab" ), - array( "Abc", -4, 1, "false" ), + array( "Abc", -4, 1, "A" ), array( "ababc", 1, 2, "ba" ), array( "ababc", 0, 10, "ababc" ), @@ -350,7 +350,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -1, "Op" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -2, "O" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -3, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -4, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 5, -4, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -1, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Op" ), @@ -361,7 +361,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -6, "a" . $char_a_ring_nfd ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -7, "a" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -8, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -9, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", 0, -9, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -7, $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), @@ -371,7 +371,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -3, "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -2, "pq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -1, "q" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -999, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -999, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 8, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 7, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Op" ), @@ -382,7 +382,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 2, "a" . $char_a_ring_nfd ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 1, "a" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, 0, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -999, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -999, "" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -1, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Op" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -2, "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O" ), @@ -392,7 +392,7 @@ function ut_main() array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -6, "a" . $char_a_ring_nfd ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -7, "a" ), array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -8, "" ), - array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -9, "false" ), + array( "a" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "Opq", -8, -9, "" ), ); @@ -961,23 +961,23 @@ find "a%CC%8ABca%CC%8A" in "o%CC%88a%CC%8AaA%CC%8AbCa%CC%8Adef" - grapheme_strri function grapheme_substr($string, $start, $length = -1) {} -substring of "abc" from "3" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) -substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = false == false +substring of "abc" from "3" - grapheme_substr = == +substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = == substring of "aoa%CC%8Abco%CC%88O" from "2" - grapheme_substr = a%CC%8Abco%CC%88O == a%CC%8Abco%CC%88O substring of "o%CC%88a%CC%8AaA%CC%8Abc" from "2" - grapheme_substr = aA%CC%8Abc == aA%CC%8Abc substring of "aa%CC%8Abco%CC%88O" from "5" - grapheme_substr = O == O -substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = false == false +substring of "aa%CC%8Abco%CC%88" from "5" - grapheme_substr = == substring of "aa%CC%8AbcO%CC%88" from "4" - grapheme_substr = O%CC%88 == O%CC%88 substring of "o%CC%88aa%CC%8Abc" from "2" - grapheme_substr = a%CC%8Abc == a%CC%8Abc substring of "aA%CC%8Abc" from "1" - grapheme_substr = A%CC%8Abc == A%CC%8Abc -substring of "Abc" from "-5" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) -substring of "a%CC%8Abc" from "3" - grapheme_substr = false == false -substring of "abc" from "4" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) +substring of "Abc" from "-5" - grapheme_substr = Abc == Abc +substring of "a%CC%8Abc" from "3" - grapheme_substr = == +substring of "abc" from "4" - grapheme_substr = == substring of "abC" from "2" - grapheme_substr = C == C substring of "abc" from "1" - grapheme_substr = bc == bc substring of "Abc" from "1" - grapheme_substr with length 1 = b == b substring of "abc" from "0" - grapheme_substr with length 2 = ab == ab -substring of "Abc" from "-4" - grapheme_substr with length 1: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) +substring of "Abc" from "-4" - grapheme_substr with length 1 = A == A substring of "ababc" from "1" - grapheme_substr with length 2 = ba == ba substring of "ababc" from "0" - grapheme_substr with length 10 = ababc == ababc substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length 10 = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq @@ -985,7 +985,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr = Opq == Opq substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -1 = Op == Op substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -2 = O == O substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -3 = == -substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -4 = false == false +substring of "aa%CC%8Abco%CC%88Opq" from "5" - grapheme_substr with length -4 = == substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -1 = aa%CC%8Abco%CC%88Op == aa%CC%8Abco%CC%88Op substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -2 = aa%CC%8Abco%CC%88O == aa%CC%8Abco%CC%88O @@ -995,7 +995,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -5 = substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -6 = aa%CC%8A == aa%CC%8A substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -7 = a == a substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -8 = == -substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -9: grapheme_substr(): Argument #3 ($length) must be contained in argument #1 ($string) +substring of "aa%CC%8Abco%CC%88Opq" from "0" - grapheme_substr with length -9 = == substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-7" - grapheme_substr = a%CC%8Abco%CC%88Opq == a%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-6" - grapheme_substr = bco%CC%88Opq == bco%CC%88Opq @@ -1004,7 +1004,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "-4" - grapheme_substr = o%CC%88Opq == substring of "aa%CC%8Abco%CC%88Opq" from "-3" - grapheme_substr = Opq == Opq substring of "aa%CC%8Abco%CC%88Opq" from "-2" - grapheme_substr = pq == pq substring of "aa%CC%8Abco%CC%88Opq" from "-1" - grapheme_substr = q == q -substring of "aa%CC%8Abco%CC%88Opq" from "-999" - grapheme_substr: grapheme_substr(): Argument #2 ($start) must be contained in argument #1 ($string) +substring of "aa%CC%8Abco%CC%88Opq" from "-999" - grapheme_substr = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 8 = aa%CC%8Abco%CC%88Opq == aa%CC%8Abco%CC%88Opq substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 7 = aa%CC%8Abco%CC%88Op == aa%CC%8Abco%CC%88Op substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 6 = aa%CC%8Abco%CC%88O == aa%CC%8Abco%CC%88O @@ -1014,7 +1014,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 3 = substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 2 = aa%CC%8A == aa%CC%8A substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 1 = a == a substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length 0 = == -substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -999: grapheme_substr(): Argument #3 ($length) must be contained in argument #1 ($string) +substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -999 = == substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -1 = aa%CC%8Abco%CC%88Op == aa%CC%8Abco%CC%88Op substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -2 = aa%CC%8Abco%CC%88O == aa%CC%8Abco%CC%88O substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -3 = aa%CC%8Abco%CC%88 == aa%CC%8Abco%CC%88 @@ -1023,7 +1023,7 @@ substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -5 = substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -6 = aa%CC%8A == aa%CC%8A substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -7 = a == a substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -8 = == -substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -9: grapheme_substr(): Argument #3 ($length) must be contained in argument #1 ($string) +substring of "aa%CC%8Abco%CC%88Opq" from "-8" - grapheme_substr with length -9 = == function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {} diff --git a/ext/intl/tests/grapheme_out_of_bounds.phpt b/ext/intl/tests/grapheme_out_of_bounds.phpt new file mode 100644 index 0000000000000..e563096d7e87b --- /dev/null +++ b/ext/intl/tests/grapheme_out_of_bounds.phpt @@ -0,0 +1,202 @@ +--TEST-- +grapheme_* functions with out-of-bounds offsets +--FILE-- +getMessage(), "\n"; +} +try { + var_dump(grapheme_stripos("foo", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strrpos("foo", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strripos("foo", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strpos("äöü", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_stripos("äöü", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strrpos("äöü", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strripos("äöü", "bar", 4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +echo "\n"; + +// Negative out of bounds. +try { + var_dump(grapheme_strpos("foo", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_stripos("foo", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strrpos("foo", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strripos("foo", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strpos("äöü", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_stripos("äöü", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strrpos("äöü", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(grapheme_strripos("äöü", "bar", -4)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +echo "\n"; + +var_dump(grapheme_substr("foo", 3)); +var_dump(grapheme_substr("foo", -3)); +var_dump(grapheme_substr("foo", 4)); +var_dump(grapheme_substr("foo", -4)); +var_dump(grapheme_substr("äöü", 3)); +var_dump(grapheme_substr("äöü", -3)); +var_dump(grapheme_substr("äöü", 4)); +var_dump(grapheme_substr("äöü", -4)); +var_dump(grapheme_substr("foo", 0, 3)); +var_dump(grapheme_substr("foo", 0, -3)); +var_dump(grapheme_substr("foo", 0, 4)); +var_dump(grapheme_substr("foo", 0, -4)); +var_dump(grapheme_substr("äöü", 0, 3)); +var_dump(grapheme_substr("äöü", 0, -3)); +var_dump(grapheme_substr("äöü", 0, 4)); +var_dump(grapheme_substr("äöü", 0, -4)); +var_dump(grapheme_substr("äöü", -4, 1)); +var_dump(grapheme_substr("äöü", -4, -1)); +var_dump(grapheme_substr("äöü", 2, -2)); + +?> +--EXPECT-- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) + +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) + +bool(false) +bool(false) +bool(false) +bool(false) + +grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) + +grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) + +string(0) "" +string(3) "foo" +string(0) "" +string(3) "foo" +string(0) "" +string(6) "äöü" +string(0) "" +string(6) "äöü" +string(3) "foo" +string(0) "" +string(3) "foo" +string(0) "" +string(6) "äöü" +string(0) "" +string(6) "äöü" +string(0) "" +string(2) "ä" +string(4) "äö" +string(0) "" diff --git a/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt b/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt new file mode 100644 index 0000000000000..956a718aae442 --- /dev/null +++ b/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt @@ -0,0 +1,21 @@ +--TEST-- +Spoofchecker attempting to pass an unknown restriction level +--SKIPIF-- + +--FILE-- +setRestrictionLevel(Spoofchecker::SINGLE_SCRIPT); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} + +?> +--EXPECT-- +Spoofchecker::setRestrictionLevel(): Argument #1 ($level) must be one of Spoofchecker::ASCII, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE, Spoofchecker::SINGLE_HIGHLY_RESTRICTIVE, Spoofchecker::SINGLE_MODERATELY_RESTRICTIVE, Spoofchecker::SINGLE_MINIMALLY_RESTRICTIVE, or Spoofchecker::UNRESTRICTIVE diff --git a/ext/json/json.stub.php b/ext/json/json.stub.php index fc7d2c1569c0f..a9b5bbf511213 100644 --- a/ext/json/json.stub.php +++ b/ext/json/json.stub.php @@ -2,9 +2,9 @@ /** @generate-function-entries */ -function json_encode(mixed $value, int $options = 0, int $depth = 512): string|false {} +function json_encode(mixed $value, int $flags = 0, int $depth = 512): string|false {} -function json_decode(string $json, ?bool $assoc = null, int $depth = 512, int $options = 0): mixed {} +function json_decode(string $json, ?bool $associative = null, int $depth = 512, int $flags = 0): mixed {} function json_last_error(): int {} diff --git a/ext/json/json_arginfo.h b/ext/json/json_arginfo.h index bbcebf2a0b907..c4b20d7013856 100644 --- a/ext/json/json_arginfo.h +++ b/ext/json/json_arginfo.h @@ -1,17 +1,17 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7dbc9b323b73714227d91cc9566cc3c0c90cd7be */ + * Stub hash: 2d1e6c422221ec7efbbd540ee777a5ce2c639943 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_json_encode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, depth, IS_LONG, 0, "512") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_decode, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, assoc, _IS_BOOL, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, associative, _IS_BOOL, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, depth, IS_LONG, 0, "512") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_json_last_error, 0, 0, IS_LONG, 0) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 03926e5a0794f..489984ba81aaa 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1001,7 +1001,7 @@ PHP_FUNCTION(ldap_connect) WRONG_PARAM_COUNT; } - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!lssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) { RETURN_THROWS(); } @@ -1009,7 +1009,7 @@ PHP_FUNCTION(ldap_connect) ssl = 1; } #else - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sl", &host, &hostlen, &port) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!l", &host, &hostlen, &port) != SUCCESS) { RETURN_THROWS(); } #endif @@ -1119,7 +1119,7 @@ PHP_FUNCTION(ldap_bind) ldap_linkdata *ld; int rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) { RETURN_THROWS(); } @@ -1175,7 +1175,7 @@ PHP_FUNCTION(ldap_bind_ext) LDAPMessage *ldap_res; int rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ssa", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen, &serverctrls) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!a", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen, &serverctrls) != SUCCESS) { RETURN_THROWS(); } @@ -1337,7 +1337,7 @@ PHP_FUNCTION(ldap_sasl_bind) size_t rc, dn_len, passwd_len, mech_len, realm_len, authc_id_len, authz_id_len, props_len; php_ldap_bictx *ctx; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|sssssss", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!s!s!s!s!", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) { RETURN_THROWS(); } @@ -1601,12 +1601,12 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope) } if (!base_dn_str) { - zend_argument_type_error(2, "must be of type string when argument #1 ($link_identifier) is a resource"); + zend_argument_type_error(2, "must be of type string when argument #1 ($ldap) is a resource"); } ldap_base_dn = zend_string_copy(base_dn_str); if (!filter_str) { - zend_argument_type_error(3, "must be of type string when argument #1 ($link_identifier) is a resource"); + zend_argument_type_error(3, "must be of type string when argument #1 ($ldap) is a resource"); } ldap_filter = zend_string_copy(filter_str); @@ -1909,9 +1909,8 @@ PHP_FUNCTION(ldap_first_attribute) ldap_linkdata *ld; ldap_resultentry *resultentry; char *attribute; - zend_long dummy_ber; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) { RETURN_THROWS(); } @@ -1941,9 +1940,8 @@ PHP_FUNCTION(ldap_next_attribute) ldap_linkdata *ld; ldap_resultentry *resultentry; char *attribute; - zend_long dummy_ber; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) { RETURN_THROWS(); } @@ -2655,7 +2653,7 @@ PHP_FUNCTION(ldap_modify_batch) modtype != LDAP_MODIFY_BATCH_REPLACE && modtype != LDAP_MODIFY_BATCH_REMOVE_ALL ) { - zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of LDAP_MODIFY_BATCH_ADD, LDAP_MODIFY_BATCH_REMOVE, LDAP_MODIFY_BATCH_REPLACE, or LDAP_MODIFY_BATCH_REMOVE_ALL", get_active_function_name()); + zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of the LDAP_MODIFY_BATCH_* constants", get_active_function_name()); RETURN_THROWS(); } @@ -3881,195 +3879,6 @@ PHP_FUNCTION(ldap_8859_to_t61) /* }}} */ #endif -#ifdef LDAP_CONTROL_PAGEDRESULTS -/* {{{ Inject paged results control*/ -PHP_FUNCTION(ldap_control_paged_result) -{ - zend_long pagesize; - zend_bool iscritical; - zval *link; - char *cookie = NULL; - size_t cookie_len = 0; - struct berval lcookie = { 0L, NULL }; - ldap_linkdata *ld; - LDAP *ldap; - BerElement *ber = NULL; - LDAPControl ctrl, *ctrlsp[2]; - int rc, myargcount = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(myargcount, "rl|bs", &link, &pagesize, &iscritical, &cookie, &cookie_len) != SUCCESS) { - RETURN_THROWS(); - } - - if (Z_TYPE_P(link) == IS_NULL) { - ldap = NULL; - } else { - if ((ld = (ldap_linkdata *)zend_fetch_resource_ex(link, "ldap link", le_link)) == NULL) { - RETURN_THROWS(); - } - ldap = ld->link; - } - - ber = ber_alloc_t(LBER_USE_DER); - if (ber == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to alloc BER encoding resources for paged results control"); - RETURN_FALSE; - } - - ctrl.ldctl_iscritical = 0; - - switch (myargcount) { - case 4: - lcookie.bv_val = cookie; - lcookie.bv_len = cookie_len; - /* fallthru */ - case 3: - ctrl.ldctl_iscritical = (int)iscritical; - /* fallthru */ - } - - if (ber_printf(ber, "{iO}", (int)pagesize, &lcookie) == LBER_ERROR) { - php_error_docref(NULL, E_WARNING, "Unable to BER printf paged results control"); - RETVAL_FALSE; - goto lcpr_error_out; - } - rc = ber_flatten2(ber, &ctrl.ldctl_value, 0); - if (rc == LBER_ERROR) { - php_error_docref(NULL, E_WARNING, "Unable to BER encode paged results control"); - RETVAL_FALSE; - goto lcpr_error_out; - } - - ctrl.ldctl_oid = LDAP_CONTROL_PAGEDRESULTS; - - if (ldap) { - /* directly set the option */ - ctrlsp[0] = &ctrl; - ctrlsp[1] = NULL; - - rc = ldap_set_option(ldap, LDAP_OPT_SERVER_CONTROLS, ctrlsp); - if (rc != LDAP_SUCCESS) { - php_error_docref(NULL, E_WARNING, "Unable to set paged results control: %s (%d)", ldap_err2string(rc), rc); - RETVAL_FALSE; - goto lcpr_error_out; - } - RETVAL_TRUE; - } else { - /* return a PHP control object */ - array_init(return_value); - - add_assoc_string(return_value, "oid", ctrl.ldctl_oid); - if (ctrl.ldctl_value.bv_len) { - add_assoc_stringl(return_value, "value", ctrl.ldctl_value.bv_val, ctrl.ldctl_value.bv_len); - } - if (ctrl.ldctl_iscritical) { - add_assoc_bool(return_value, "iscritical", ctrl.ldctl_iscritical); - } - } - -lcpr_error_out: - if (ber != NULL) { - ber_free(ber, 1); - } - return; -} -/* }}} */ - -/* {{{ Extract paged results control response */ -PHP_FUNCTION(ldap_control_paged_result_response) -{ - zval *link, *result, *cookie, *estimated; - struct berval lcookie; - int lestimated; - ldap_linkdata *ld; - LDAPMessage *ldap_result; - LDAPControl **lserverctrls, *lctrl; - BerElement *ber; - ber_tag_t tag; - int rc, lerrcode, myargcount = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(myargcount, "rr|zz", &link, &result, &cookie, &estimated) != SUCCESS) { - RETURN_THROWS(); - } - - if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) { - RETURN_THROWS(); - } - - if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) { - RETURN_THROWS(); - } - - rc = ldap_parse_result(ld->link, - ldap_result, - &lerrcode, - NULL, /* matcheddn */ - NULL, /* errmsg */ - NULL, /* referrals */ - &lserverctrls, - 0); - - if (rc != LDAP_SUCCESS) { - php_error_docref(NULL, E_WARNING, "Unable to parse result: %s (%d)", ldap_err2string(rc), rc); - RETURN_FALSE; - } - - if (lerrcode != LDAP_SUCCESS) { - php_error_docref(NULL, E_WARNING, "Result is: %s (%d)", ldap_err2string(lerrcode), lerrcode); - RETURN_FALSE; - } - - if (lserverctrls == NULL) { - php_error_docref(NULL, E_WARNING, "No server controls in result"); - RETURN_FALSE; - } - - lctrl = ldap_control_find(LDAP_CONTROL_PAGEDRESULTS, lserverctrls, NULL); - if (lctrl == NULL) { - ldap_controls_free(lserverctrls); - php_error_docref(NULL, E_WARNING, "No paged results control response in result"); - RETURN_FALSE; - } - - ber = ber_init(&lctrl->ldctl_value); - if (ber == NULL) { - ldap_controls_free(lserverctrls); - php_error_docref(NULL, E_WARNING, "Unable to alloc BER decoding resources for paged results control response"); - RETURN_FALSE; - } - - tag = ber_scanf(ber, "{io}", &lestimated, &lcookie); - (void)ber_free(ber, 1); - - if (tag == LBER_ERROR) { - ldap_controls_free(lserverctrls); - php_error_docref(NULL, E_WARNING, "Unable to decode paged results control response"); - RETURN_FALSE; - } - - if (lestimated < 0) { - ldap_controls_free(lserverctrls); - php_error_docref(NULL, E_WARNING, "Invalid paged results control response value"); - RETURN_FALSE; - } - - ldap_controls_free(lserverctrls); - if (myargcount == 4) { - ZEND_TRY_ASSIGN_REF_LONG(estimated, lestimated); - } - - if (lcookie.bv_len == 0) { - ZEND_TRY_ASSIGN_REF_EMPTY_STRING(cookie); - } else { - ZEND_TRY_ASSIGN_REF_STRINGL(cookie, lcookie.bv_val, lcookie.bv_len); - } - ldap_memfree(lcookie.bv_val); - - RETURN_TRUE; -} -/* }}} */ -#endif - /* {{{ Extended operations, Pierangelo Masarati */ #ifdef HAVE_LDAP_EXTENDED_OPERATION_S /* {{{ Extended operation */ diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index 372458fe78b9e..0aad23a16598d 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -4,281 +4,263 @@ #ifdef HAVE_ORALDAP /** @return resource|false */ -function ldap_connect(string $hostname = UNKNOWN, int $port = 389, string $wallet = UNKNOWN, string $wallet_passwd = UNKNOWN, int $authmode = GSLC_SSL_NO_AUTH) {} +function ldap_connect(?string $uri = null, int $port = 389, string $wallet = UNKNOWN, string $password = UNKNOWN, int $auth_mode = GSLC_SSL_NO_AUTH) {} #else /** @return resource|false */ -function ldap_connect(string $hostname = UNKNOWN, int $port = 389) {} +function ldap_connect(?string $uri = null, int $port = 389) {} #endif -/** @param resource $link_identifier */ -function ldap_unbind($link_identifier): bool {} +/** @param resource $ldap */ +function ldap_unbind($ldap): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @alias ldap_unbind */ -function ldap_close($link_identifier): bool {} +function ldap_close($ldap): bool {} -/** @param resource $link_identifier */ -function ldap_bind($link_identifier, string $bind_rdn = UNKNOWN, string $bind_password = UNKNOWN): bool {} +/** @param resource $ldap */ +function ldap_bind($ldap, ?string $dn = null, ?string $password = null): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_bind_ext($link_identifier, string $bind_rdn = UNKNOWN, string $bind_password = UNKNOWN, array $servercontrols = []) {} +function ldap_bind_ext($ldap, ?string $dn = null, ?string $password = null, array $controls = []) {} #ifdef HAVE_LDAP_SASL -/** @param resource $link */ -function ldap_sasl_bind($link, string $binddn = UNKNOWN, string $password = UNKNOWN, string $sasl_mech = UNKNOWN, string $sasl_realm = UNKNOWN, string $sasl_authc_id = UNKNOWN, string $sasl_authz_id = UNKNOWN, string $props = UNKNOWN): bool {} +/** @param resource $ldap */ +function ldap_sasl_bind($ldap, ?string $dn = null, ?string $password = null, ?string $mech = null, ?string $realm = null, ?string $authc_id = null, ?string $authz_id = null, ?string $props = null): bool {} #endif /** - * @param resource|array $link_identifier + * @param resource|array $ldap * @return resource|false */ -function ldap_read($link_identifier, array|string $base_dn, array|string $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {} +function ldap_read($ldap, array|string $base, array|string $filter, array $attributes = [], int $attributes_only = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $controls = []) {} /** - * @param resource|array $link_identifier + * @param resource|array $ldap * @return resource|false */ -function ldap_list($link_identifier, array|string $base_dn, array|string $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {} +function ldap_list($ldap, array|string $base, array|string $filter, array $attributes = [], int $attributes_only = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $controls = []) {} /** - * @param resource|array $link_identifier + * @param resource|array $ldap * @return resource|false */ -function ldap_search($link_identifier, array|string $base_dn, array|string $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {} +function ldap_search($ldap, array|string $base, array|string $filter, array $attributes = [], int $attributes_only = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $controls = []) {} -/** @param resource $link_identifier */ -function ldap_free_result($link_identifier): bool {} +/** @param resource $ldap */ +function ldap_free_result($ldap): bool {} /** - * @param resource $link_identifier - * @param resource $result_identifier + * @param resource $ldap + * @param resource $result */ -function ldap_count_entries($link_identifier, $result_identifier): int {} +function ldap_count_entries($ldap, $result): int {} /** - * @param resource $link_identifier - * @param resource $result_identifier + * @param resource $ldap + * @param resource $result * @return resource|false */ -function ldap_first_entry($link_identifier, $result_identifier) {} +function ldap_first_entry($ldap, $result) {} /** - * @param resource $link_identifier - * @param resource $result_identifier + * @param resource $ldap + * @param resource $result * @return resource|false */ -function ldap_next_entry($link_identifier, $result_identifier) {} +function ldap_next_entry($ldap, $result) {} /** - * @param resource $link_identifier - * @param resource $result_identifier + * @param resource $ldap + * @param resource $result */ -function ldap_get_entries($link_identifier, $result_identifier): array|false {} +function ldap_get_entries($ldap, $result): array|false {} /** - * @param resource $link_identifier - * @param resource $result_entry_identifier + * @param resource $ldap + * @param resource $entry */ -function ldap_first_attribute($link_identifier, $result_entry_identifier, int $dummy_ber = UNKNOWN): string|false {} +function ldap_first_attribute($ldap, $entry): string|false {} /** - * @param resource $link_identifier - * @param resource $result_entry_identifier + * @param resource $ldap + * @param resource $entry */ -function ldap_next_attribute($link_identifier, $result_entry_identifier, int $dummy_ber = UNKNOWN): string|false {} +function ldap_next_attribute($ldap, $entry): string|false {} /** - * @param resource $link_identifier - * @param resource $result_entry_identifier + * @param resource $ldap + * @param resource $entry */ -function ldap_get_attributes($link_identifier, $result_entry_identifier): array {} +function ldap_get_attributes($ldap, $entry): array {} /** - * @param resource $link_identifier - * @param resource $result_entry_identifier + * @param resource $ldap + * @param resource $entry */ -function ldap_get_values_len($link_identifier, $result_entry_identifier, string $attribute): array|false {} +function ldap_get_values_len($ldap, $entry, string $attribute): array|false {} /** - * @param resource $link_identifier - * @param resource $result_entry_identifier + * @param resource $ldap + * @param resource $entry * @alias ldap_get_values_len */ -function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array|false {} +function ldap_get_values($ldap, $entry, string $attribute): array|false {} /** - * @param resource $link_identifier - * @param resource $result_entry_identifier + * @param resource $ldap + * @param resource $entry */ -function ldap_get_dn($link_identifier, $result_entry_identifier): string|false {} +function ldap_get_dn($ldap, $entry): string|false {} function ldap_explode_dn(string $dn, int $with_attrib): array|false {} function ldap_dn2ufn(string $dn): string|false {} -/** @param resource $link_identifier */ -function ldap_add($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_add($ldap, string $dn, array $entry, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_add_ext($link_identifier, string $dn, array $entry, array $servercontrols = []) {} +function ldap_add_ext($ldap, string $dn, array $entry, array $controls = []) {} -/** @param resource $link_identifier */ -function ldap_delete($link_identifier, string $dn, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_delete($ldap, string $dn, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_delete_ext($link_identifier, string $dn, array $servercontrols = []) {} +function ldap_delete_ext($ldap, string $dn, array $controls = []) {} -/** @param resource $link_identifier */ -function ldap_modify_batch($link_identifier, string $dn, array $modifications_info, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_modify_batch($ldap, string $dn, array $modifications_info, array $controls = []): bool {} -/** @param resource $link_identifier */ -function ldap_mod_add($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_mod_add($ldap, string $dn, array $entry, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_mod_add_ext($link_identifier, string $dn, array $entry, array $servercontrols = []) {} +function ldap_mod_add_ext($ldap, string $dn, array $entry, array $controls = []) {} -/** @param resource $link_identifier */ -function ldap_mod_replace($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_mod_replace($ldap, string $dn, array $entry, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @alias ldap_mod_replace */ -function ldap_modify($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {} +function ldap_modify($ldap, string $dn, array $entry, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_mod_replace_ext($link_identifier, string $dn, array $entry, array $servercontrols = []) {} +function ldap_mod_replace_ext($ldap, string $dn, array $entry, array $controls = []) {} -/** @param resource $link_identifier */ -function ldap_mod_del($link_identifier, string $dn, array $entry, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_mod_del($ldap, string $dn, array $entry, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_mod_del_ext($link_identifier, string $dn, array $entry, array $servercontrols = []) {} +function ldap_mod_del_ext($ldap, string $dn, array $entry, array $controls = []) {} -/** @param resource $link */ -function ldap_errno($link): int {} +/** @param resource $ldap */ +function ldap_errno($ldap): int {} -/** @param resource $link */ -function ldap_error($link): string {} +/** @param resource $ldap */ +function ldap_error($ldap): string {} function ldap_err2str(int $errno): string {} -/** @param resource $link_identifier */ -function ldap_compare($link_identifier, string $dn, string $attribute, string $value, array $servercontrols = []): bool|int {} - - -#ifdef LDAP_CONTROL_PAGEDRESULTS -/** - * @param resource $link - * @deprecated since 7.4 - */ -function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): bool {} - -/** - * @param resource $link - * @param resource $result - * @param string $cookie - * @param int $estimated - * @deprecated since 7.4 - */ -function ldap_control_paged_result_response($link, $result, &$cookie = null, &$estimated = null): bool {} -#endif +/** @param resource $ldap */ +function ldap_compare($ldap, string $dn, string $attribute, string $value, array $controls = []): bool|int {} #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) -/** @param resource $link_identifier */ -function ldap_rename($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $servercontrols = []): bool {} +/** @param resource $ldap */ +function ldap_rename($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = []): bool {} /** - * @param resource $link_identifier + * @param resource $ldap * @return resource|false */ -function ldap_rename_ext($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn, array $servercontrols = []) {} +function ldap_rename_ext($ldap, string $dn, string $new_rdn, string $new_parent, bool $delete_old_rdn, array $controls = []) {} /** - * @param resource $link_identifier - * @param array|string|int $retval + * @param resource $ldap + * @param array|string|int $value */ -function ldap_get_option($link_identifier, int $option, &$retval = null): bool {} +function ldap_get_option($ldap, int $option, &$value = null): bool {} /** - * @param resource|null $link_identifier - * @param array|string|int|bool $newval + * @param resource|null $ldap + * @param array|string|int|bool $value */ -function ldap_set_option($link_identifier, int $option, $newval): bool {} +function ldap_set_option($ldap, int $option, $value): bool {} /** - * @param resource $link_identifier - * @param resource $result_identifier + * @param resource $ldap + * @param resource $result */ -function ldap_count_references($link_identifier, $result_identifier): int {} +function ldap_count_references($ldap, $result): int {} /** - * @param resource $link + * @param resource $ldap * @param resource $result * @return resource|false */ -function ldap_first_reference($link, $result) {} +function ldap_first_reference($ldap, $result) {} /** - * @param resource $link + * @param resource $ldap * @param resource $entry * @return resource|false */ -function ldap_next_reference($link, $entry) {} +function ldap_next_reference($ldap, $entry) {} #ifdef HAVE_LDAP_PARSE_REFERENCE /** - * @param resource $link + * @param resource $ldap * @param resource $entry * @param array $referrals */ -function ldap_parse_reference($link, $entry, &$referrals): bool {} +function ldap_parse_reference($ldap, $entry, &$referrals): bool {} #endif #ifdef HAVE_LDAP_PARSE_RESULT /** - * @param resource $link + * @param resource $ldap * @param resource $result - * @param int $errcode - * @param string $matcheddn - * @param string $errmsg + * @param int $error_code + * @param string $matched_dn + * @param string $error_message * @param array $referrals - * @param array $serverctrls + * @param array $controls */ -function ldap_parse_result($link, $result, &$errcode, &$matcheddn = null, &$errmsg = null, &$referrals = null, &$serverctrls = null): bool {} +function ldap_parse_result($ldap, $result, &$error_code, &$matched_dn = null, &$error_message = null, &$referrals = null, &$controls = null): bool {} #endif #endif #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) -/** @param resource $link */ -function ldap_set_rebind_proc($link, ?callable $callback): bool {} +/** @param resource $ldap */ +function ldap_set_rebind_proc($ldap, ?callable $callback): bool {} #endif #ifdef HAVE_LDAP_START_TLS_S -/** @param resource $link_identifier */ -function ldap_start_tls($link_identifier): bool {} +/** @param resource $ldap */ +function ldap_start_tls($ldap): bool {} #endif function ldap_escape(string $value, string $ignore = "", int $flags = 0): string {} @@ -292,39 +274,39 @@ function ldap_8859_to_t61(string $value): string|false {} #ifdef HAVE_LDAP_EXTENDED_OPERATION_S /** - * @param resource $link - * @param string $retdata - * @param string $retoid + * @param resource $ldap + * @param string $response_data + * @param string $response_oid * @return resource|bool */ -function ldap_exop($link, string $reqoid, ?string $reqdata = null, ?array $servercontrols = [], &$retdata = null, &$retoid = null) {} +function ldap_exop($ldap, string $request_oid, ?string $request_data = null, ?array $controls = [], &$response_data = null, &$response_oid = null) {} #endif #ifdef HAVE_LDAP_PASSWD /** - * @param resource $link - * @param array $serverctrls + * @param resource $ldap + * @param array $controls */ -function ldap_exop_passwd($link, string $user = "", string $oldpw = "", string $newpw = "", &$serverctrls = null): string|bool {} +function ldap_exop_passwd($ldap, string $user = "", string $old_password = "", string $new_password = "", &$controls = null): string|bool {} #endif #ifdef HAVE_LDAP_WHOAMI_S -/** @param resource $link */ -function ldap_exop_whoami($link): string|bool {} +/** @param resource $ldap */ +function ldap_exop_whoami($ldap): string|bool {} #endif #ifdef HAVE_LDAP_REFRESH_S -/** @param resource $link */ -function ldap_exop_refresh($link, string $dn, int $ttl): int|false {} +/** @param resource $ldap */ +function ldap_exop_refresh($ldap, string $dn, int $ttl): int|false {} #endif #ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT /** - * @param resource $link + * @param resource $ldap * @param resource $result - * @param string $retdata - * @param string $retoid + * @param string $response_data + * @param string $response_oid */ -function ldap_parse_exop($link, $result, &$retdata = null, &$retoid = null): bool {} +function ldap_parse_exop($ldap, $result, &$response_data = null, &$response_oid = null): bool {} #endif diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h index d610408d97423..a0b5890caddd9 100644 --- a/ext/ldap/ldap_arginfo.h +++ b/ext/ldap/ldap_arginfo.h @@ -1,65 +1,65 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: f07138972651411473c34c5ee2d0c2de94e01ada */ + * Stub hash: 42f7118d8380424cd4178759cae6cb47b6d9b44f */ #if defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "389") ZEND_ARG_TYPE_INFO(0, wallet, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, wallet_passwd, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authmode, IS_LONG, 0, "GSLC_SSL_NO_AUTH") + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth_mode, IS_LONG, 0, "GSLC_SSL_NO_AUTH") ZEND_END_ARG_INFO() #endif #if !(defined(HAVE_ORALDAP)) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "389") ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_unbind, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_END_ARG_INFO() #define arginfo_ldap_close arginfo_ldap_unbind ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_bind, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_TYPE_INFO(0, bind_rdn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, bind_password, IS_STRING, 0) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_bind_ext, 0, 0, 1) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_TYPE_INFO(0, bind_rdn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, bind_password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() #if defined(HAVE_LDAP_SASL) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_sasl_bind, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO(0, binddn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sasl_mech, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sasl_realm, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sasl_authc_id, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, sasl_authz_id, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, props, IS_STRING, 0) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dn, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mech, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, realm, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authc_id, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, authz_id, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, props, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_read, 0, 0, 3) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_TYPE_MASK(0, base_dn, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_TYPE_MASK(0, base, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, filter, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attrsonly, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes_only, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sizelimit, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timelimit, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, deref, IS_LONG, 0, "LDAP_DEREF_NEVER") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() #define arginfo_ldap_list arginfo_ldap_read @@ -69,47 +69,43 @@ ZEND_END_ARG_INFO() #define arginfo_ldap_free_result arginfo_ldap_unbind ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_count_entries, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_identifier) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, result) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_first_entry, 0, 0, 2) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_identifier) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, result) ZEND_END_ARG_INFO() #define arginfo_ldap_next_entry arginfo_ldap_first_entry ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_get_entries, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_identifier) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, result) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_first_attribute, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_entry_identifier) - ZEND_ARG_TYPE_INFO(0, dummy_ber, IS_LONG, 0) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, entry) ZEND_END_ARG_INFO() #define arginfo_ldap_next_attribute arginfo_ldap_first_attribute ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_get_attributes, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_entry_identifier) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, entry) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_get_values_len, 0, 3, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_entry_identifier) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, entry) ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_ldap_get_values arginfo_ldap_get_values_len -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_get_dn, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_entry_identifier) -ZEND_END_ARG_INFO() +#define arginfo_ldap_get_dn arginfo_ldap_first_attribute ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_explode_dn, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) @@ -121,36 +117,36 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_dn2ufn, 0, 1, MAY_BE_STRING ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_add, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, entry, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_add_ext, 0, 0, 3) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, entry, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_delete, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_delete_ext, 0, 0, 2) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_modify_batch, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, modifications_info, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() #define arginfo_ldap_mod_add arginfo_ldap_add @@ -168,11 +164,11 @@ ZEND_END_ARG_INFO() #define arginfo_ldap_mod_del_ext arginfo_ldap_add_ext ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_errno, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_error, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_err2str, 0, 1, IS_STRING, 0) @@ -180,93 +176,75 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_err2str, 0, 1, IS_STRING, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_compare, 0, 4, MAY_BE_BOOL|MAY_BE_LONG) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -#if defined(LDAP_CONTROL_PAGEDRESULTS) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_control_paged_result, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO(0, pagesize, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iscritical, _IS_BOOL, 0, "false") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookie, IS_STRING, 0, "\"\"") -ZEND_END_ARG_INFO() -#endif - -#if defined(LDAP_CONTROL_PAGEDRESULTS) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_control_paged_result_response, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, cookie, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, estimated, "null") -ZEND_END_ARG_INFO() -#endif - #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_rename, 0, 5, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, newrdn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, newparent, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, deleteoldrdn, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO(0, new_rdn, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, new_parent, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, delete_old_rdn, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_rename_ext, 0, 0, 5) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, newrdn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, newparent, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, deleteoldrdn, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO(0, new_rdn, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, new_parent, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, delete_old_rdn, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_get_option, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, retval, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, value, "null") ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_set_option, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) - ZEND_ARG_INFO(0, newval) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_count_references, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_INFO(0, result_identifier) + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_INFO(0, result) ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_first_reference, 0, 0, 2) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_INFO(0, result) ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_next_reference, 0, 0, 2) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_INFO(0, entry) ZEND_END_ARG_INFO() #endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) && defined(HAVE_LDAP_PARSE_REFERENCE) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_parse_reference, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_INFO(0, entry) ZEND_ARG_INFO(1, referrals) ZEND_END_ARG_INFO() @@ -274,26 +252,26 @@ ZEND_END_ARG_INFO() #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) && defined(HAVE_LDAP_PARSE_RESULT) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_parse_result, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(1, errcode) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, matcheddn, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errmsg, "null") + ZEND_ARG_INFO(1, error_code) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, matched_dn, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, referrals, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, serverctrls, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, controls, "null") ZEND_END_ARG_INFO() #endif #if defined(LDAP_API_FEATURE_X_OPENLDAP) && defined(HAVE_3ARG_SETREBINDPROC) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_set_rebind_proc, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) ZEND_END_ARG_INFO() #endif #if defined(HAVE_LDAP_START_TLS_S) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_start_tls, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, ldap) ZEND_END_ARG_INFO() #endif @@ -315,34 +293,34 @@ ZEND_END_ARG_INFO() #if defined(HAVE_LDAP_EXTENDED_OPERATION_S) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop, 0, 0, 2) - ZEND_ARG_INFO(0, link) - ZEND_ARG_TYPE_INFO(0, reqoid, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, reqdata, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 1, "[]") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, retdata, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, retoid, "null") + ZEND_ARG_INFO(0, ldap) + ZEND_ARG_TYPE_INFO(0, request_oid, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, request_data, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, controls, IS_ARRAY, 1, "[]") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, response_data, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, response_oid, "null") ZEND_END_ARG_INFO() #endif #if defined(HAVE_LDAP_PASSWD) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_exop_passwd, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, oldpw, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, newpw, IS_STRING, 0, "\"\"") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, serverctrls, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, old_password, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, new_password, IS_STRING, 0, "\"\"") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, controls, "null") ZEND_END_ARG_INFO() #endif #if defined(HAVE_LDAP_WHOAMI_S) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_exop_whoami, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_END_ARG_INFO() #endif #if defined(HAVE_LDAP_REFRESH_S) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ldap_exop_refresh, 0, 3, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_TYPE_INFO(0, dn, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -350,10 +328,10 @@ ZEND_END_ARG_INFO() #if defined(HAVE_LDAP_PARSE_EXTENDED_RESULT) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_parse_exop, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, link) + ZEND_ARG_INFO(0, ldap) ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, retdata, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, retoid, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, response_data, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, response_oid, "null") ZEND_END_ARG_INFO() #endif @@ -400,12 +378,6 @@ ZEND_FUNCTION(ldap_errno); ZEND_FUNCTION(ldap_error); ZEND_FUNCTION(ldap_err2str); ZEND_FUNCTION(ldap_compare); -#if defined(LDAP_CONTROL_PAGEDRESULTS) -ZEND_FUNCTION(ldap_control_paged_result); -#endif -#if defined(LDAP_CONTROL_PAGEDRESULTS) -ZEND_FUNCTION(ldap_control_paged_result_response); -#endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_FUNCTION(ldap_rename); #endif @@ -509,12 +481,6 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(ldap_error, arginfo_ldap_error) ZEND_FE(ldap_err2str, arginfo_ldap_err2str) ZEND_FE(ldap_compare, arginfo_ldap_compare) -#if defined(LDAP_CONTROL_PAGEDRESULTS) - ZEND_DEP_FE(ldap_control_paged_result, arginfo_ldap_control_paged_result) -#endif -#if defined(LDAP_CONTROL_PAGEDRESULTS) - ZEND_DEP_FE(ldap_control_paged_result_response, arginfo_ldap_control_paged_result_response) -#endif #if (LDAP_API_VERSION > 2000) || defined(HAVE_ORALDAP) ZEND_FE(ldap_rename, arginfo_ldap_rename) #endif diff --git a/ext/ldap/tests/ldap_control_paged_results_variation1.phpt b/ext/ldap/tests/ldap_control_paged_results_variation1.phpt deleted file mode 100644 index 75d147e0beb94..0000000000000 --- a/ext/ldap/tests/ldap_control_paged_results_variation1.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -ldap_ldap_control_paged_result() test (fetching the first page) ---CREDITS-- -Jean-Sebastien Hedde ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d -bool(true) -resource(%d) of type (ldap result) -array(2) { - ["count"]=> - int(1) - [0]=> - array(4) { - ["cn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(5) "userA" - } - [0]=> - string(2) "cn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userA,%s" - } -} diff --git a/ext/ldap/tests/ldap_control_paged_results_variation2.phpt b/ext/ldap/tests/ldap_control_paged_results_variation2.phpt deleted file mode 100644 index b0b6e62aff7e0..0000000000000 --- a/ext/ldap/tests/ldap_control_paged_results_variation2.phpt +++ /dev/null @@ -1,71 +0,0 @@ ---TEST-- -ldap_ldap_control_paged_result() test (fetching the first page with a pagesize=2) ---CREDITS-- -Jean-Sebastien Hedde ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d -bool(true) -resource(%d) of type (ldap result) -array(3) { - ["count"]=> - int(2) - [0]=> - array(4) { - ["cn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(5) "userA" - } - [0]=> - string(2) "cn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userA,%s" - } - [1]=> - array(4) { - ["cn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(5) "userB" - } - [0]=> - string(2) "cn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userB,%s" - } -} diff --git a/ext/ldap/tests/ldap_control_paged_results_variation3.phpt b/ext/ldap/tests/ldap_control_paged_results_variation3.phpt deleted file mode 100644 index de904f051f996..0000000000000 --- a/ext/ldap/tests/ldap_control_paged_results_variation3.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -ldap_ldap_control_paged_result() test (fetching the first page then the next final page) ---CREDITS-- -Jean-Sebastien Hedde ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d - -Deprecated: Function ldap_control_paged_result_response() is deprecated in %s.php on line %d - -Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d -bool(true) -resource(%d) of type (ldap result) -array(3) { - ["count"]=> - int(2) - [0]=> - array(4) { - ["cn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(5) "userA" - } - [0]=> - string(2) "cn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userA,%s" - } - [1]=> - array(4) { - ["cn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(5) "userB" - } - [0]=> - string(2) "cn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userB,%s" - } -} -bool(true) -bool(true) -resource(%d) of type (ldap result) -array(2) { - ["count"]=> - int(1) - [0]=> - array(4) { - ["cn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(5) "userC" - } - [0]=> - string(2) "cn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userC,cn=userB,%s" - } -} diff --git a/ext/ldap/tests/ldap_parse_result_controls.phpt b/ext/ldap/tests/ldap_parse_result_controls.phpt index 63ef9e69d772a..2a5f7e1d3b152 100644 --- a/ext/ldap/tests/ldap_parse_result_controls.phpt +++ b/ext/ldap/tests/ldap_parse_result_controls.phpt @@ -19,8 +19,8 @@ insert_dummy_data($link, $base); $dn = "$base"; $filter = "(cn=user*)"; var_dump( - ldap_control_paged_result($link, 1), - $result = ldap_search($link, $dn, $filter, array('cn')), + $result = ldap_search($link, $dn, $filter, array('cn'), 0, 0, 0, LDAP_DEREF_NEVER, + [['oid' => LDAP_CONTROL_PAGEDRESULTS, 'iscritical' => TRUE, 'value' => ['size' => 1]]]), ldap_parse_result($link, $result, $errcode, $dn, $errmsg, $refs, $ctrls), $ctrls[LDAP_CONTROL_PAGEDRESULTS]['oid'], $ctrls[LDAP_CONTROL_PAGEDRESULTS]['value']['size'], @@ -36,8 +36,6 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); remove_dummy_data($link, $base); ?> --EXPECTF-- -Deprecated: Function ldap_control_paged_result() is deprecated in %s.php on line %d -bool(true) resource(%d) of type (ldap result) bool(true) string(22) "1.2.840.113556.1.4.319" diff --git a/ext/ldap/tests/ldap_search_error.phpt b/ext/ldap/tests/ldap_search_error.phpt index cc4653f2b7bf2..7041c66746b01 100644 --- a/ext/ldap/tests/ldap_search_error.phpt +++ b/ext/ldap/tests/ldap_search_error.phpt @@ -46,6 +46,6 @@ bool(false) Warning: ldap_search(): Array initialization wrong in %s on line %d bool(false) -ldap_search(): Argument #1 ($link_identifier) cannot be empty -ldap_search(): Argument #2 ($base_dn) must have the same number of elements as the links array +ldap_search(): Argument #1 ($ldap) cannot be empty +ldap_search(): Argument #2 ($base) must have the same number of elements as the links array ldap_search(): Argument #3 ($filter) must have the same number of elements as the links array diff --git a/ext/ldap/tests/ldap_set_option_error.phpt b/ext/ldap/tests/ldap_set_option_error.phpt index f97193e22b581..fba37df6ef34d 100644 --- a/ext/ldap/tests/ldap_set_option_error.phpt +++ b/ext/ldap/tests/ldap_set_option_error.phpt @@ -38,6 +38,6 @@ var_dump(ldap_set_option($link, 999999, 999999)); --EXPECT-- bool(false) ValueError: ldap_set_option(): Control must have an "oid" key -TypeError: ldap_set_option(): Argument #3 ($newval) must contain only arrays, where each array is a control -TypeError: ldap_set_option(): Argument #3 ($newval) must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, string given +TypeError: ldap_set_option(): Argument #3 ($value) must contain only arrays, where each array is a control +TypeError: ldap_set_option(): Argument #3 ($value) must be of type array for the LDAP_OPT_CLIENT_CONTROLS option, string given bool(false) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 274feec35ef5b..ba992af930be6 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1307,7 +1307,7 @@ PHP_FUNCTION(mb_http_input) return; default: zend_argument_value_error(1, - "must be one of \"G\", \"P\", \"C\", \"S\", \"I\" or \"L\""); + "must be one of \"G\", \"P\", \"C\", \"S\", \"I\", or \"L\""); RETURN_THROWS(); } } @@ -2596,8 +2596,7 @@ PHP_FUNCTION(mb_convert_case) } if (case_mode < 0 || case_mode > PHP_UNICODE_CASE_MODE_MAX) { - zend_argument_value_error(2, "must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD," - " MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE"); + zend_argument_value_error(2, "must be one of the MB_CASE_* constants"); RETURN_THROWS(); } diff --git a/ext/mbstring/mbstring.stub.php b/ext/mbstring/mbstring.stub.php index 74f86404cf4eb..14bf595fcfc2d 100644 --- a/ext/mbstring/mbstring.stub.php +++ b/ext/mbstring/mbstring.stub.php @@ -17,13 +17,13 @@ function mb_substitute_character(string|int|null $substitute_character = null): function mb_preferred_mime_name(string $encoding): string|false {} /** @param array $result */ -function mb_parse_str(string $encoded_string, &$result): bool {} +function mb_parse_str(string $string, &$result): bool {} -function mb_output_handler(string $contents, int $status): string {} +function mb_output_handler(string $string, int $status): string {} -function mb_str_split(string $str, int $split_length = 1, ?string $encoding = null): array {} +function mb_str_split(string $string, int $length = 1, ?string $encoding = null): array {} -function mb_strlen(string $str, ?string $encoding = null): int {} +function mb_strlen(string $string, ?string $encoding = null): int {} function mb_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false {} @@ -33,94 +33,94 @@ function mb_stripos(string $haystack, string $needle, int $offset = 0, ?string $ function mb_strripos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false {} -function mb_strstr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {} +function mb_strstr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {} -function mb_strrchr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {} +function mb_strrchr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {} -function mb_stristr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {} +function mb_stristr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {} -function mb_strrichr(string $haystack, string $needle, bool $part = false, ?string $encoding = null): string|false {} +function mb_strrichr(string $haystack, string $needle, bool $before_needle = false, ?string $encoding = null): string|false {} function mb_substr_count(string $haystack, string $needle, ?string $encoding = null): int {} -function mb_substr(string $str, int $start, ?int $length = null, ?string $encoding = null): string {} +function mb_substr(string $string, int $start, ?int $length = null, ?string $encoding = null): string {} -function mb_strcut(string $str, int $start, ?int $length = null, ?string $encoding = null): string {} +function mb_strcut(string $string, int $start, ?int $length = null, ?string $encoding = null): string {} -function mb_strwidth(string $str, ?string $encoding = null): int {} +function mb_strwidth(string $string, ?string $encoding = null): int {} -function mb_strimwidth(string $str, int $start, int $width, string $trim_marker = "", ?string $encoding = null): string {} +function mb_strimwidth(string $string, int $start, int $width, string $trim_marker = "", ?string $encoding = null): string {} -function mb_convert_encoding(array|string $str, string $to, array|string|null $from = null): array|string|false {} +function mb_convert_encoding(array|string $string, string $to_encoding, array|string|null $from_encoding = null): array|string|false {} -function mb_convert_case(string $source_string, int $mode, ?string $encoding = null): string {} +function mb_convert_case(string $string, int $mode, ?string $encoding = null): string {} -function mb_strtoupper(string $source_string, ?string $encoding = null): string {} +function mb_strtoupper(string $string, ?string $encoding = null): string {} -function mb_strtolower(string $source_string, ?string $encoding = null): string {} +function mb_strtolower(string $string, ?string $encoding = null): string {} -function mb_detect_encoding(string $str, array|string|null $encoding_list = null, bool $strict = false): string|false {} +function mb_detect_encoding(string $string, array|string|null $encodings = null, bool $strict = false): string|false {} function mb_list_encodings(): array {} function mb_encoding_aliases(string $encoding): array {} -function mb_encode_mimeheader(string $str, ?string $charset = null, ?string $transfer = null, string $linefeed = "\r\n", int $indent = 0): string {} +function mb_encode_mimeheader(string $string, ?string $charset = null, ?string $transfer_encoding = null, string $newline = "\r\n", int $indent = 0): string {} function mb_decode_mimeheader(string $string): string {} -function mb_convert_kana(string $str, string $option = "KV", ?string $encoding = null): string {} +function mb_convert_kana(string $string, string $mode = "KV", ?string $encoding = null): string {} -function mb_convert_variables(string $to, array|string $from, mixed &$var, mixed &...$vars): string|false {} +function mb_convert_variables(string $to_encoding, array|string $from_encoding, mixed &$var, mixed &...$vars): string|false {} -function mb_encode_numericentity(string $string, array $convmap, ?string $encoding = null, bool $is_hex = false): string {} +function mb_encode_numericentity(string $string, array $map, ?string $encoding = null, bool $hex = false): string {} -function mb_decode_numericentity(string $string, array $convmap, ?string $encoding = null): string {} +function mb_decode_numericentity(string $string, array $map, ?string $encoding = null): string {} -function mb_send_mail(string $to, string $subject, string $message, array|string $additional_headers = [], ?string $additional_parameters = null): bool {} +function mb_send_mail(string $to, string $subject, string $message, array|string $additional_headers = [], ?string $additional_params = null): bool {} function mb_get_info(string $type = "all"): array|string|int|false {} -function mb_check_encoding(array|string|null $var = null, ?string $encoding = null): bool {} +function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool {} -function mb_scrub(string $str, ?string $encoding = null): string {} +function mb_scrub(string $string, ?string $encoding = null): string {} -function mb_ord(string $str, ?string $encoding = null): int|false {} +function mb_ord(string $string, ?string $encoding = null): int|false {} -function mb_chr(int $cp, ?string $encoding = null): string|false {} +function mb_chr(int $codepoint, ?string $encoding = null): string|false {} #ifdef HAVE_MBREGEX function mb_regex_encoding(?string $encoding = null): string|bool {} -/** @param array $registers */ -function mb_ereg(string $pattern, string $string, &$registers = null): int|false {} +/** @param array $matches */ +function mb_ereg(string $pattern, string $string, &$matches = null): int|false {} -/** @param array $registers */ -function mb_eregi(string $pattern, string $string, &$registers = null): int|false {} +/** @param array $matches */ +function mb_eregi(string $pattern, string $string, &$matches = null): int|false {} -function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $option = null): string|false|null {} +function mb_ereg_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {} -function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $option = null): string|false|null {} +function mb_eregi_replace(string $pattern, string $replacement, string $string, ?string $options = null): string|false|null {} -function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $option = null): string|false|null {} +function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = null): string|false|null {} function mb_split(string $pattern, string $string, int $limit = -1): array|false {} -function mb_ereg_match(string $pattern, string $string, ?string $option = null): bool {} +function mb_ereg_match(string $pattern, string $string, ?string $options = null): bool {} -function mb_ereg_search(?string $pattern = null, ?string $option = null): bool {} +function mb_ereg_search(?string $pattern = null, ?string $options = null): bool {} -function mb_ereg_search_pos(?string $pattern = null, ?string $option = null): array|false {} +function mb_ereg_search_pos(?string $pattern = null, ?string $options = null): array|false {} -function mb_ereg_search_regs(?string $pattern = null, ?string $option = null): array|false {} +function mb_ereg_search_regs(?string $pattern = null, ?string $options = null): array|false {} -function mb_ereg_search_init(string $string, ?string $pattern = null, ?string $option = null): bool {} +function mb_ereg_search_init(string $string, ?string $pattern = null, ?string $options = null): bool {} function mb_ereg_search_getregs(): array|false {} function mb_ereg_search_getpos(): int {} -function mb_ereg_search_setpos(int $position): bool {} +function mb_ereg_search_setpos(int $offset): bool {} function mb_regex_set_options(?string $options = null): string {} #endif diff --git a/ext/mbstring/mbstring_arginfo.h b/ext/mbstring/mbstring_arginfo.h index 27b692c26f617..ca91c5cd6fec5 100644 --- a/ext/mbstring/mbstring_arginfo.h +++ b/ext/mbstring/mbstring_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: e02a0588d1f46fa96452558e35ea904907b8bdf2 */ + * Stub hash: 3e5b45cf71fe75bde026062816cb28eceea4aa38 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_language, 0, 0, MAY_BE_STRING|MAY_BE_BOOL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, language, IS_STRING, 1, "null") @@ -28,23 +28,23 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_preferred_mime_name, 0, 1, MA ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_parse_str, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, encoded_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_output_handler, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, contents, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, status, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_str_split, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, split_length, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strlen, 0, 1, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -64,7 +64,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_strstr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, part, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, before_needle, _IS_BOOL, 0, "false") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -81,7 +81,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_substr_count, 0, 2, IS_LONG, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_substr, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") @@ -92,7 +92,7 @@ ZEND_END_ARG_INFO() #define arginfo_mb_strwidth arginfo_mb_strlen ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strimwidth, 0, 3, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, trim_marker, IS_STRING, 0, "\"\"") @@ -100,27 +100,27 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strimwidth, 0, 3, IS_STRING, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_encoding, 0, 2, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_MASK(0, str, MAY_BE_ARRAY|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) - ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_MASK(0, string, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, to_encoding, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, from_encoding, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_convert_case, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, source_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_strtoupper, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, source_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #define arginfo_mb_strtolower arginfo_mb_strtoupper ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_detect_encoding, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_MASK(0, encoding_list, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, encodings, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() @@ -132,10 +132,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encoding_aliases, 0, 1, IS_AR ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_mimeheader, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charset, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, transfer, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, linefeed, IS_STRING, 0, "\"\\r\\n\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, transfer_encoding, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, newline, IS_STRING, 0, "\"\\r\\n\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, indent, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -144,28 +144,28 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_decode_mimeheader, 0, 1, IS_S ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_convert_kana, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 0, "\"KV\"") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"KV\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_convert_variables, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) - ZEND_ARG_TYPE_MASK(0, from, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, to_encoding, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, from_encoding, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_INFO(1, var, IS_MIXED, 0) ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_encode_numericentity, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, convmap, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, map, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, is_hex, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hex, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_decode_numericentity, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, convmap, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, map, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -174,7 +174,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_send_mail, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, additional_headers, MAY_BE_ARRAY|MAY_BE_STRING, "[]") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_parameters, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_params, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_get_info, 0, 0, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE) @@ -182,22 +182,19 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_get_info, 0, 0, MAY_BE_ARRAY| ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_check_encoding, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_MASK(0, var, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_MASK(0, value, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_scrub, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") -ZEND_END_ARG_INFO() +#define arginfo_mb_scrub arginfo_mb_strtoupper ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ord, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_chr, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, cp, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, codepoint, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -211,7 +208,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, registers, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, matches, "null") ZEND_END_ARG_INFO() #endif @@ -224,7 +221,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace, 0, 3, MAY_BE_ST ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, replacement, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif @@ -237,7 +234,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace_callback, 0, 3, ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif @@ -253,21 +250,21 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_match, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif #if defined(HAVE_MBREGEX) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif #if defined(HAVE_MBREGEX) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_search_pos, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif @@ -279,7 +276,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_init, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif @@ -295,7 +292,7 @@ ZEND_END_ARG_INFO() #if defined(HAVE_MBREGEX) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_setpos, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/mbstring/tests/bug79149.phpt b/ext/mbstring/tests/bug79149.phpt index c057ed0ad7d0f..b8a7bb0e3c5eb 100644 --- a/ext/mbstring/tests/bug79149.phpt +++ b/ext/mbstring/tests/bug79149.phpt @@ -24,8 +24,8 @@ try { ?> --EXPECTF-- -mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "0" +mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "0" Warning: Array to string conversion in %s on line %d -mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "Array" -mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "foo" +mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "Array" +mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "foo" diff --git a/ext/mbstring/tests/mb_convert_case_various_mode.phpt b/ext/mbstring/tests/mb_convert_case_various_mode.phpt index cd278ae52fff8..50653687aacd7 100644 --- a/ext/mbstring/tests/mb_convert_case_various_mode.phpt +++ b/ext/mbstring/tests/mb_convert_case_various_mode.phpt @@ -31,4 +31,4 @@ string(13) "FOO BAR SPAß" string(13) "foo bar spaß" string(13) "Foo Bar Spaß" string(13) "foo bar spaß" -mb_convert_case(): Argument #2 ($mode) must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD, MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE +mb_convert_case(): Argument #2 ($mode) must be one of the MB_CASE_* constants diff --git a/ext/mbstring/tests/mb_convert_encoding.phpt b/ext/mbstring/tests/mb_convert_encoding.phpt index 40b1dfed882b3..1f39d21b15ca8 100644 --- a/ext/mbstring/tests/mb_convert_encoding.phpt +++ b/ext/mbstring/tests/mb_convert_encoding.phpt @@ -124,4 +124,4 @@ JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== == INVALID PARAMETER == INT: 1234 EUC-JP: -mb_convert_encoding(): Argument #2 ($to) must be a valid encoding, "BAD" given +mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "BAD" given diff --git a/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt b/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt index 7b7d8217c3b0b..6fe5adbc35f11 100644 --- a/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt @@ -23,5 +23,5 @@ try { ?> --EXPECT-- -mb_convert_encoding(): Argument #3 ($from) must specify at least one encoding -mb_convert_encoding(): Argument #3 ($from) must specify at least one encoding +mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding +mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt b/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt index 4dbbd9f26ffed..29807bfa384d7 100644 --- a/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt @@ -22,5 +22,5 @@ try { ?> --EXPECT-- -mb_convert_variables(): Argument #2 ($from) must specify at least one encoding -mb_convert_variables(): Argument #2 ($from) must specify at least one encoding +mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding +mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_decode_numericentity.phpt b/ext/mbstring/tests/mb_decode_numericentity.phpt index 91b324924774a..b28a875f8a77f 100644 --- a/ext/mbstring/tests/mb_decode_numericentity.phpt +++ b/ext/mbstring/tests/mb_decode_numericentity.phpt @@ -49,4 +49,4 @@ aÅ’bÅ“cÅ dÅ¡e€fg � � föo -mb_decode_numericentity(): Argument #2 ($convmap) must have a multiple of 4 elements +mb_decode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements diff --git a/ext/mbstring/tests/mb_detect_encoding.phpt b/ext/mbstring/tests/mb_detect_encoding.phpt index 2134f3c8b578a..71c44c16427ce 100644 --- a/ext/mbstring/tests/mb_detect_encoding.phpt +++ b/ext/mbstring/tests/mb_detect_encoding.phpt @@ -108,4 +108,4 @@ SJIS: SJIS == INVALID PARAMETER == INT: EUC-JP EUC-JP: EUC-JP -mb_detect_encoding(): Argument #2 ($encoding_list) contains invalid encoding "BAD" +mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "BAD" diff --git a/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt b/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt index 28dbc5baa659c..2f9e8b82ade6d 100644 --- a/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt @@ -22,5 +22,5 @@ try { ?> --EXPECT-- -mb_detect_encoding(): Argument #2 ($encoding_list) must specify at least one encoding -mb_detect_encoding(): Argument #2 ($encoding_list) must specify at least one encoding +mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding +mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_encode_numericentity.phpt b/ext/mbstring/tests/mb_encode_numericentity.phpt index f7e8002383a2b..417b099f65c25 100644 --- a/ext/mbstring/tests/mb_encode_numericentity.phpt +++ b/ext/mbstring/tests/mb_encode_numericentity.phpt @@ -31,4 +31,4 @@ try { ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦ aŒbœcŠdše€fg föo -mb_encode_numericentity(): Argument #2 ($convmap) must have a multiple of 4 elements +mb_encode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements diff --git a/ext/mbstring/tests/mb_ereg_search_setpos.phpt b/ext/mbstring/tests/mb_ereg_search_setpos.phpt index 3b73025489fc2..94e55f1febfd7 100644 --- a/ext/mbstring/tests/mb_ereg_search_setpos.phpt +++ b/ext/mbstring/tests/mb_ereg_search_setpos.phpt @@ -36,7 +36,7 @@ foreach($positions as $pos) { ?> --EXPECT-- bool(true) -mb_ereg_search_setpos(): Argument #1 ($position) is out of range +mb_ereg_search_setpos(): Argument #1 ($offset) is out of range * Position: 5 : bool(true) @@ -47,11 +47,11 @@ bool(true) int(20) * Position: 21 : -mb_ereg_search_setpos(): Argument #1 ($position) is out of range +mb_ereg_search_setpos(): Argument #1 ($offset) is out of range int(20) * Position: 25 : -mb_ereg_search_setpos(): Argument #1 ($position) is out of range +mb_ereg_search_setpos(): Argument #1 ($offset) is out of range int(20) * Position: 0 : @@ -67,5 +67,5 @@ bool(true) int(0) * Position: -30 : -mb_ereg_search_setpos(): Argument #1 ($position) is out of range +mb_ereg_search_setpos(): Argument #1 ($offset) is out of range int(0) diff --git a/ext/mbstring/tests/mb_http_input.phpt b/ext/mbstring/tests/mb_http_input.phpt index e6bb0528ec428..d1fba60f3ff49 100644 --- a/ext/mbstring/tests/mb_http_input.phpt +++ b/ext/mbstring/tests/mb_http_input.phpt @@ -43,4 +43,4 @@ array(1) { string(10) "ISO-8859-1" } string(10) "ISO-8859-1" -mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I" or "L" +mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" diff --git a/ext/mbstring/tests/mb_ord.phpt b/ext/mbstring/tests/mb_ord.phpt index 8785a29dfcfed..8336d573bef21 100644 --- a/ext/mbstring/tests/mb_ord.phpt +++ b/ext/mbstring/tests/mb_ord.phpt @@ -56,7 +56,7 @@ try { bool(true) bool(true) bool(true) -mb_ord(): Argument #1 ($str) must not be empty +mb_ord(): Argument #1 ($string) must not be empty mb_ord(): Argument #2 ($encoding) must be a valid encoding, "typo" given mb_ord(): Argument #2 ($encoding) must be a valid encoding, "pass" given mb_ord() does not support the "JIS" encoding diff --git a/ext/mbstring/tests/mb_send_mail_null_bytes.phpt b/ext/mbstring/tests/mb_send_mail_null_bytes.phpt index 221daf68ceea8..061451e3b84a4 100644 --- a/ext/mbstring/tests/mb_send_mail_null_bytes.phpt +++ b/ext/mbstring/tests/mb_send_mail_null_bytes.phpt @@ -35,4 +35,4 @@ mb_send_mail(): Argument #1 ($to) must not contain any null bytes mb_send_mail(): Argument #2 ($subject) must not contain any null bytes mb_send_mail(): Argument #3 ($message) must not contain any null bytes mb_send_mail(): Argument #4 ($additional_headers) must not contain any null bytes -mb_send_mail(): Argument #5 ($additional_parameters) must not contain any null bytes +mb_send_mail(): Argument #5 ($additional_params) must not contain any null bytes diff --git a/ext/mbstring/tests/mb_str_split_error_conditions.phpt b/ext/mbstring/tests/mb_str_split_error_conditions.phpt index 77f04aad09cd7..b1b56672f3d01 100644 --- a/ext/mbstring/tests/mb_str_split_error_conditions.phpt +++ b/ext/mbstring/tests/mb_str_split_error_conditions.phpt @@ -28,6 +28,6 @@ try { ?> --EXPECT-- -mb_str_split(): Argument #2 ($split_length) must be greater than 0 -mb_str_split(): Argument #2 ($split_length) must be greater than 0 +mb_str_split(): Argument #2 ($length) must be greater than 0 +mb_str_split(): Argument #2 ($length) must be greater than 0 mb_str_split(): Argument #3 ($encoding) must be a valid encoding, "BAD_ENCODING" given diff --git a/ext/mbstring/tests/mb_str_unknown_encoding.phpt b/ext/mbstring/tests/mb_str_unknown_encoding.phpt index 5c07c3521cfe1..64f94871e4655 100644 --- a/ext/mbstring/tests/mb_str_unknown_encoding.phpt +++ b/ext/mbstring/tests/mb_str_unknown_encoding.phpt @@ -144,7 +144,7 @@ try { --EXPECT-- mb_chr(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given mb_convert_case(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given -mb_convert_encoding(): Argument #3 ($from) contains invalid encoding "UTF-0" +mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "UTF-0" mb_convert_kana(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given mb_decode_numericentity(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given mb_ord(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 9eb1885ea6ffb..05ffffa926a10 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -47,6 +47,8 @@ static PHP_GINIT_FUNCTION(mysqli); } \ } +#define ERROR_ARG_POS(arg_num) (getThis() ? (arg_num-1) : (arg_num)) + static HashTable classes; static zend_object_handlers mysqli_object_handlers; static zend_object_handlers mysqli_object_driver_handlers; @@ -1168,8 +1170,8 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) { - php_error_docref(NULL, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH"); - RETURN_FALSE; + zend_argument_value_error(ERROR_ARG_POS(2), "must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH"); + RETURN_THROWS(); } php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype); diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index 9d557fe7462e0..5c7ae9bf987f3 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -10,7 +10,7 @@ class mysqli { public function __construct( ?string $host = null, - ?string $user = null, + ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, @@ -21,7 +21,7 @@ public function __construct( * @return bool * @alias mysqli_autocommit */ - public function autocommit(bool $mode) {} + public function autocommit(bool $enable) {} /** * @return bool @@ -33,7 +33,7 @@ public function begin_transaction(int $flags = 0, ?string $name = null) {} * @return bool * @alias mysqli_change_user */ - public function change_user(string $user, string $password, ?string $database) {} + public function change_user(string $username, string $password, ?string $database) {} /** * @return string|null @@ -59,7 +59,7 @@ public function commit(int $flags = -1, ?string $name = null) {} */ public function connect( ?string $host = null, - ?string $user = null, + ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, @@ -76,7 +76,7 @@ public function dump_debug_info() {} * @return bool * @alias mysqli_debug */ - public function debug(string $debug_options) {} + public function debug(string $options) {} /** * @return object|null @@ -120,7 +120,7 @@ public function init() {} * @return bool * @alias mysqli_kill */ - public function kill(int $connection_id) {} + public function kill(int $process_id) {} /** * @return bool @@ -151,7 +151,7 @@ public function ping() {} * @return int|false * @alias mysqli_poll */ - public static function poll(?array &$read, ?array &$write, array &$error, int $sec, int $usec = 0) {} + public static function poll(?array &$read, ?array &$write, array &$error, int $seconds, int $microseconds = 0) {} #endif /** @@ -172,7 +172,7 @@ public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT) {} */ public function real_connect( ?string $host = null, - ?string $user = null, + ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, @@ -184,7 +184,7 @@ public function real_connect( * @return string * @alias mysqli_real_escape_string */ - public function real_escape_string(string $string_to_escape) {} + public function real_escape_string(string $string) {} #if defined(MYSQLI_USE_MYSQLND) /** @@ -198,7 +198,7 @@ public function reap_async_query() {} * @return string * @alias mysqli_real_escape_string */ - public function escape_string(string $string_to_escape) {} + public function escape_string(string $string) {} /** * @return bool @@ -256,10 +256,10 @@ public function set_opt(int $option, $value) {} */ public function ssl_set( string $key, - string $cert, - string $certificate_authority, - string $certificate_authority_path, - string $cipher + string $certificate, + string $ca_certificate, + string $ca_path, + string $cipher_algos ) {} /** @@ -278,7 +278,7 @@ public function stmt_init() {} * @return mysqli_result|false * @alias mysqli_store_result */ - public function store_result(int $flags = 0) {} + public function store_result(int $mode = 0) {} /** * @return bool @@ -296,12 +296,12 @@ public function use_result() {} * @return bool * @alias mysqli_refresh */ - public function refresh(int $options) {} + public function refresh(int $flags) {} } class mysqli_result implements IteratorAggregate { - public function __construct(object $mysqli_link, int $result_mode = MYSQLI_STORE_RESULT) {} + public function __construct(mysqli $mysql, int $result_mode = MYSQLI_STORE_RESULT) {} /** * @return void @@ -337,21 +337,21 @@ public function fetch_fields() {} * @return object|false * @alias mysqli_fetch_field_direct */ - public function fetch_field_direct(int $field_nr) {} + public function fetch_field_direct(int $index) {} #if defined(MYSQLI_USE_MYSQLND) /** * @return array|false * @alias mysqli_fetch_all */ - public function fetch_all(int $result_type = MYSQLI_NUM) {} + public function fetch_all(int $mode = MYSQLI_NUM) {} #endif /** * @return array|null|false * @alias mysqli_fetch_array */ - public function fetch_array(int $result_type = MYSQLI_BOTH) {} + public function fetch_array(int $mode = MYSQLI_BOTH) {} /** * @return array|null @@ -363,7 +363,7 @@ public function fetch_assoc() {} * @return object|null * @alias mysqli_fetch_object */ - public function fetch_object(string $class_name = "stdClass", array $params = []) {} + public function fetch_object(string $class = "stdClass", array $params = []) {} /** * @return array|null @@ -375,7 +375,7 @@ public function fetch_row() {} * @return bool * @alias mysqli_field_seek */ - public function field_seek(int $field_nr) {} + public function field_seek(int $index) {} /** * @return void @@ -388,19 +388,19 @@ public function getIterator(): Iterator; class mysqli_stmt { - public function __construct(mysqli $mysqli_link, ?string $statement = null) {} + public function __construct(mysqli $mysql, ?string $query = null) {} /** * @return int|false * @alias mysqli_stmt_attr_get */ - public function attr_get(int $attr) {} + public function attr_get(int $attribute) {} /** * @return bool * @alias mysqli_stmt_attr_set */ - public function attr_set(int $attr, int $mode_in) {} + public function attr_set(int $attribute, int $value) {} /** * @return bool @@ -474,7 +474,7 @@ public function num_rows() {} * @return bool * @alias mysqli_stmt_send_long_data */ - public function send_long_data(int $param_nr, string $data) {} + public function send_long_data(int $param_num, string $data) {} /** * @return void @@ -511,7 +511,7 @@ public function get_result() {} final class mysqli_warning { - protected function __construct(object $mysqli_link) {} + private function __construct() {} public function next(): bool {} } @@ -520,23 +520,23 @@ final class mysqli_sql_exception extends RuntimeException { } -function mysqli_affected_rows(mysqli $mysql_link): int|string {} +function mysqli_affected_rows(mysqli $mysql): int|string {} -function mysqli_autocommit(mysqli $mysql_link, bool $mode): bool {} +function mysqli_autocommit(mysqli $mysql, bool $enable): bool {} -function mysqli_begin_transaction(mysqli $mysql_link, int $flags = 0, ?string $name = null): bool {} +function mysqli_begin_transaction(mysqli $mysql, int $flags = 0, ?string $name = null): bool {} -function mysqli_change_user(mysqli $mysql_link, string $user, string $password, ?string $database): bool {} +function mysqli_change_user(mysqli $mysql, string $username, string $password, ?string $database): bool {} -function mysqli_character_set_name(mysqli $mysql_link): ?string {} +function mysqli_character_set_name(mysqli $mysql): ?string {} -function mysqli_close(mysqli $mysql_link): bool {} +function mysqli_close(mysqli $mysql): bool {} -function mysqli_commit(mysqli $mysql_link, int $flags = -1, ?string $name = null): bool {} +function mysqli_commit(mysqli $mysql, int $flags = -1, ?string $name = null): bool {} function mysqli_connect( ?string $host = null, - ?string $user = null, + ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, @@ -547,112 +547,112 @@ function mysqli_connect_errno(): int {} function mysqli_connect_error(): ?string {} -function mysqli_data_seek(mysqli_result $mysql_result, int $offset): bool {} +function mysqli_data_seek(mysqli_result $result, int $offset): bool {} -function mysqli_dump_debug_info(mysqli $mysql_link): bool {} +function mysqli_dump_debug_info(mysqli $mysql): bool {} function mysqli_debug(string $debug): bool {} -function mysqli_errno(mysqli $mysql_link): int {} +function mysqli_errno(mysqli $mysql): int {} -function mysqli_error(mysqli $mysql_link): ?string {} +function mysqli_error(mysqli $mysql): ?string {} -function mysqli_error_list(mysqli $mysql_link): array {} +function mysqli_error_list(mysqli $mysql): array {} -function mysqli_stmt_execute(mysqli_stmt $mysql_stmt): bool {} +function mysqli_stmt_execute(mysqli_stmt $stmt): bool {} /** @alias mysqli_stmt_execute */ -function mysqli_execute(mysqli_stmt $mysql_stmt): bool {} +function mysqli_execute(mysqli_stmt $stmt): bool {} -function mysqli_fetch_field(mysqli_result $mysql_result): object|false {} +function mysqli_fetch_field(mysqli_result $result): object|false {} -function mysqli_fetch_fields(mysqli_result $mysql_result): array {} +function mysqli_fetch_fields(mysqli_result $result): array {} -function mysqli_fetch_field_direct(mysqli_result $mysql_result, int $offset): object|false {} +function mysqli_fetch_field_direct(mysqli_result $result, int $offset): object|false {} -function mysqli_fetch_lengths(mysqli_result $mysql_result): array|false {} +function mysqli_fetch_lengths(mysqli_result $result): array|false {} #if defined(MYSQLI_USE_MYSQLND) -function mysqli_fetch_all(mysqli_result $mysql_result, int $mode = MYSQLI_NUM): array|false {} +function mysqli_fetch_all(mysqli_result $result, int $mode = MYSQLI_NUM): array|false {} #endif -function mysqli_fetch_array(mysqli_result $mysql_result, int $fetchtype = MYSQLI_BOTH): array|null|false {} +function mysqli_fetch_array(mysqli_result $result, int $mode = MYSQLI_BOTH): array|null|false {} -function mysqli_fetch_assoc(mysqli_result $mysql_result): ?array {} +function mysqli_fetch_assoc(mysqli_result $result): ?array {} -function mysqli_fetch_object(mysqli_result $mysqli_result, string $class_name = "stdClass", array $params = []): ?object {} +function mysqli_fetch_object(mysqli_result $result, string $class = "stdClass", array $params = []): ?object {} -function mysqli_fetch_row(mysqli_result $mysqli_result): ?array {} +function mysqli_fetch_row(mysqli_result $result): ?array {} -function mysqli_field_count(mysqli $mysqli_link): int {} +function mysqli_field_count(mysqli $mysql): int {} -function mysqli_field_seek(mysqli_result $mysqli_result, int $field_nr): bool {} +function mysqli_field_seek(mysqli_result $result, int $index): bool {} -function mysqli_field_tell(mysqli_result $mysqli_result): int {} +function mysqli_field_tell(mysqli_result $result): int {} -function mysqli_free_result(mysqli_result $mysqli_result): void {} +function mysqli_free_result(mysqli_result $result): void {} #if defined(MYSQLI_USE_MYSQLND) -function mysqli_get_connection_stats(mysqli $mysqli_link): array {} +function mysqli_get_connection_stats(mysqli $mysql): array {} function mysqli_get_client_stats(): array {} #endif -function mysqli_get_charset(mysqli $mysqli_link): ?object {} +function mysqli_get_charset(mysqli $mysql): ?object {} -function mysqli_get_client_info(?mysqli $mysqli_link = null): ?string {} +function mysqli_get_client_info(?mysqli $mysql = null): ?string {} function mysqli_get_client_version(): int {} function mysqli_get_links_stats(): array {} -function mysqli_get_host_info(mysqli $mysqli_link): string {} +function mysqli_get_host_info(mysqli $mysql): string {} -function mysqli_get_proto_info(mysqli $mysqli_link): int {} +function mysqli_get_proto_info(mysqli $mysql): int {} -function mysqli_get_server_info(mysqli $mysqli_link): string {} +function mysqli_get_server_info(mysqli $mysql): string {} -function mysqli_get_server_version(mysqli $mysqli_link): int {} +function mysqli_get_server_version(mysqli $mysql): int {} -function mysqli_get_warnings(mysqli $mysqli_link): mysqli_warning|false {} +function mysqli_get_warnings(mysqli $mysql): mysqli_warning|false {} function mysqli_init(): mysqli|false {} -function mysqli_info(mysqli $mysqli_link): ?string {} +function mysqli_info(mysqli $mysql): ?string {} -function mysqli_insert_id(mysqli $mysqli_link): int|string {} +function mysqli_insert_id(mysqli $mysql): int|string {} -function mysqli_kill(mysqli $mysqli_link, int $connection_id): bool {} +function mysqli_kill(mysqli $mysql, int $process_id): bool {} -function mysqli_more_results(mysqli $mysqli_link): bool {} +function mysqli_more_results(mysqli $mysql): bool {} -function mysqli_multi_query(mysqli $mysqli_link, string $query): bool {} +function mysqli_multi_query(mysqli $mysql, string $query): bool {} -function mysqli_next_result(mysqli $mysqli_link): bool {} +function mysqli_next_result(mysqli $mysql): bool {} -function mysqli_num_fields(mysqli_result $mysql_result): int {} +function mysqli_num_fields(mysqli_result $result): int {} -function mysqli_num_rows(mysqli_result $mysqli_result): int|string {} +function mysqli_num_rows(mysqli_result $result): int|string {} /** @param string|int $value */ -function mysqli_options(mysqli $mysqli_link, int $option, $value): bool {} +function mysqli_options(mysqli $mysql, int $option, $value): bool {} -function mysqli_ping(mysqli $mysqli_link): bool {} +function mysqli_ping(mysqli $mysql): bool {} #if defined(MYSQLI_USE_MYSQLND) -function mysqli_poll(?array &$read, ?array &$write, array &$error, int $sec, int $usec = 0): int|false {} +function mysqli_poll(?array &$read, ?array &$write, array &$error, int $seconds, int $microseconds = 0): int|false {} #endif -function mysqli_prepare(mysqli $mysqli_link, string $query): mysqli_stmt|false {} +function mysqli_prepare(mysqli $mysql, string $query): mysqli_stmt|false {} function mysqli_report(int $flags): bool {} -function mysqli_query(mysqli $mysqli_link, string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} +function mysqli_query(mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} function mysqli_real_connect( - mysqli $mysqli_link, + mysqli $mysql, ?string $host = null, - ?string $user = null, + ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, @@ -660,112 +660,112 @@ function mysqli_real_connect( int $flags = 0 ): bool {} -function mysqli_real_escape_string(mysqli $mysqli_link, string $string_to_escape): string {} +function mysqli_real_escape_string(mysqli $mysql, string $string): string {} -function mysqli_real_query(mysqli $mysqli_link, string $query): bool {} +function mysqli_real_query(mysqli $mysql, string $query): bool {} #if defined(MYSQLI_USE_MYSQLND) -function mysqli_reap_async_query(mysqli $mysqli_link): mysqli_result|bool {} +function mysqli_reap_async_query(mysqli $mysql): mysqli_result|bool {} #endif -function mysqli_release_savepoint(mysqli $mysqli_link, string $name): bool {} +function mysqli_release_savepoint(mysqli $mysql, string $name): bool {} -function mysqli_rollback(mysqli $mysqli_link, int $flags = 0, ?string $name = null): bool {} +function mysqli_rollback(mysqli $mysql, int $flags = 0, ?string $name = null): bool {} -function mysqli_savepoint(mysqli $mysqli_link, string $name): bool {} +function mysqli_savepoint(mysqli $mysql, string $name): bool {} -function mysqli_select_db(mysqli $mysqli_link, string $dbname): bool {} +function mysqli_select_db(mysqli $mysql, string $database): bool {} -function mysqli_set_charset(mysqli $mysqli_link, string $charset): bool {} +function mysqli_set_charset(mysqli $mysql, string $charset): bool {} -function mysqli_stmt_affected_rows(mysqli_stmt $mysql_stmt): int|string {} +function mysqli_stmt_affected_rows(mysqli_stmt $stmt): int|string {} -function mysqli_stmt_attr_get(mysqli_stmt $mysql_stmt, int $attr): int {} +function mysqli_stmt_attr_get(mysqli_stmt $stmt, int $attribute): int {} -function mysqli_stmt_attr_set(mysqli_stmt $mysql_stmt, int $attr, int $mode_in): bool {} +function mysqli_stmt_attr_set(mysqli_stmt $stmt, int $attribute, int $value): bool {} -function mysqli_stmt_bind_param(mysqli_stmt $mysql_stmt, string $types, mixed &...$vars): bool {} +function mysqli_stmt_bind_param(mysqli_stmt $stmt, string $types, mixed &...$vars): bool {} -function mysqli_stmt_bind_result(mysqli_stmt $mysql_stmt, mixed &...$vars): bool {} +function mysqli_stmt_bind_result(mysqli_stmt $stmt, mixed &...$vars): bool {} -function mysqli_stmt_close(mysqli_stmt $mysql_stmt): bool {} +function mysqli_stmt_close(mysqli_stmt $stmt): bool {} -function mysqli_stmt_data_seek(mysqli_stmt $mysql_stmt, int $offset): void {} +function mysqli_stmt_data_seek(mysqli_stmt $stmt, int $offset): void {} -function mysqli_stmt_errno(mysqli_stmt $mysql_stmt): int {} +function mysqli_stmt_errno(mysqli_stmt $stmt): int {} -function mysqli_stmt_error(mysqli_stmt $mysql_stmt): ?string {} +function mysqli_stmt_error(mysqli_stmt $stmt): ?string {} -function mysqli_stmt_error_list(mysqli_stmt $mysql_stmt): array {} +function mysqli_stmt_error_list(mysqli_stmt $stmt): array {} -function mysqli_stmt_fetch(mysqli_stmt $mysql_stmt): ?bool {} +function mysqli_stmt_fetch(mysqli_stmt $stmt): ?bool {} -function mysqli_stmt_field_count(mysqli_stmt $mysql_stmt): int {} +function mysqli_stmt_field_count(mysqli_stmt $stmt): int {} -function mysqli_stmt_free_result(mysqli_stmt $mysql_stmt): void {} +function mysqli_stmt_free_result(mysqli_stmt $stmt): void {} #if defined(MYSQLI_USE_MYSQLND) -function mysqli_stmt_get_result(mysqli_stmt $mysql_stmt): mysqli_result|false {} +function mysqli_stmt_get_result(mysqli_stmt $stmt): mysqli_result|false {} #endif -function mysqli_stmt_get_warnings(mysqli_stmt $mysql_stmt): mysqli_warning|false {} +function mysqli_stmt_get_warnings(mysqli_stmt $stmt): mysqli_warning|false {} -function mysqli_stmt_init(mysqli $mysql_link): mysqli_stmt|false {} +function mysqli_stmt_init(mysqli $mysql): mysqli_stmt|false {} -function mysqli_stmt_insert_id(mysqli_stmt $mysql_stmt): int|string {} +function mysqli_stmt_insert_id(mysqli_stmt $stmt): int|string {} #if defined(MYSQLI_USE_MYSQLND) -function mysqli_stmt_more_results(mysqli_stmt $mysql_stmt): bool {} +function mysqli_stmt_more_results(mysqli_stmt $stmt): bool {} -function mysqli_stmt_next_result(mysqli_stmt $mysql_stmt): bool {} +function mysqli_stmt_next_result(mysqli_stmt $stmt): bool {} #endif -function mysqli_stmt_num_rows(mysqli_stmt $mysql_stmt): int|string {} +function mysqli_stmt_num_rows(mysqli_stmt $stmt): int|string {} -function mysqli_stmt_param_count(mysqli_stmt $mysql_stmt): int {} +function mysqli_stmt_param_count(mysqli_stmt $stmt): int {} -function mysqli_stmt_prepare(mysqli_stmt $mysql_stmt, string $query): bool {} +function mysqli_stmt_prepare(mysqli_stmt $stmt, string $query): bool {} -function mysqli_stmt_reset(mysqli_stmt $mysql_stmt): bool {} +function mysqli_stmt_reset(mysqli_stmt $stmt): bool {} -function mysqli_stmt_result_metadata(mysqli_stmt $mysql_stmt): mysqli_result|false {} +function mysqli_stmt_result_metadata(mysqli_stmt $stmt): mysqli_result|false {} -function mysqli_stmt_send_long_data(mysqli_stmt $mysql_stmt, int $param_nr, string $data): bool {} +function mysqli_stmt_send_long_data(mysqli_stmt $stmt, int $param_num, string $data): bool {} -function mysqli_stmt_store_result(mysqli_stmt $mysql_stmt): bool {} +function mysqli_stmt_store_result(mysqli_stmt $stmt): bool {} -function mysqli_stmt_sqlstate(mysqli_stmt $mysql_stmt): ?string {} +function mysqli_stmt_sqlstate(mysqli_stmt $stmt): ?string {} -function mysqli_sqlstate(mysqli $mysqli_link): ?string {} +function mysqli_sqlstate(mysqli $mysql): ?string {} function mysqli_ssl_set( - mysqli $mysql_link, + mysqli $mysql, string $key, - string $cert, - string $certificate_authority, - string $certificate_authority_path, - string $cipher + string $certificate, + string $ca_certificate, + string $ca_path, + string $cipher_algos ): bool {} -function mysqli_stat(mysqli $mysql_link): string|false {} +function mysqli_stat(mysqli $mysql): string|false {} -function mysqli_store_result(mysqli $mysql_link, int $flags = 0): mysqli_result|false {} +function mysqli_store_result(mysqli $mysql, int $mode = 0): mysqli_result|false {} -function mysqli_thread_id(mysqli $mysql_link): int {} +function mysqli_thread_id(mysqli $mysql): int {} function mysqli_thread_safe(): bool {} -function mysqli_use_result(mysqli $mysql_link): mysqli_result|false {} +function mysqli_use_result(mysqli $mysql): mysqli_result|false {} -function mysqli_warning_count(mysqli $mysql_link): int {} +function mysqli_warning_count(mysqli $mysql): int {} -function mysqli_refresh(mysqli $mysqli_link, int $options): bool {} +function mysqli_refresh(mysqli $mysql, int $flags): bool {} /** @alias mysqli_real_escape_string */ -function mysqli_escape_string(mysqli $mysqli_link, string $string_to_escape): string {} +function mysqli_escape_string(mysqli $mysql, string $string): string {} /** * @param string|int $value * @alias mysqli_options */ -function mysqli_set_opt(mysqli $mysqli_link, int $option, $value): bool {} +function mysqli_set_opt(mysqli $mysql, int $option, $value): bool {} diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 2263c75434e34..91915809428a0 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -93,7 +93,7 @@ mysqli_escape_string_for_tx_name_in_comment(const char * const name) { *p_copy++ = v; } else if (warned == FALSE) { - php_error_docref(NULL, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+"); + php_error_docref(NULL, E_WARNING, "Transaction name has been truncated, since it can only contain the A-Z, a-z, 0-9, \"\\\", \"-\", \"_\", and \"=\" characters"); warned = TRUE; } ++p_orig; @@ -230,7 +230,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int num_vars, zval *a break; default: - php_error_docref(NULL, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[ofs], i + num_extra_args + 1); + zend_argument_value_error(num_extra_args, "must only contain the \"b\", \"d\", \"i\", \"s\" type specifiers"); rc = 1; goto end_1; } @@ -292,8 +292,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int num_vars, zval *a type = MYSQL_TYPE_VAR_STRING; break; default: - /* We count parameters from 1 */ - php_error_docref(NULL, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[i], i + num_extra_args + 1); + zend_argument_value_error(num_extra_args, "must only contain the \"b\", \"d\", \"i\", \"s\" type specifiers"); ret = FAIL; mysqlnd_stmt_free_param_bind(stmt->stmt, params); goto end; @@ -2270,8 +2269,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set) case CURSOR_TYPE_SCROLLABLE: break; default: - zend_argument_value_error(ERROR_ARG_POS(3), "must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, " - "MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE " + zend_argument_value_error(ERROR_ARG_POS(3), "must be one of the MYSQLI_CURSOR_TYPE_* constants " "for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE"); RETURN_THROWS(); } diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index a0228f56aea86..2666df942e374 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -1,45 +1,45 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7657a5373cc27d878b1ac1f11d371f77fe243a6a */ + * Stub hash: 7687edcf18fa03c0ae95ac4b3d32c196790ba65e */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_autocommit, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_begin_transaction, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_change_user, 0, 4, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_character_set_name, 0, 1, IS_STRING, 1) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_close, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_commit, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_connect, 0, 0, mysqli, MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, host, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, database, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 1, "null") @@ -53,7 +53,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_connect_error, 0, 0, IS_S ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_data_seek, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -64,84 +64,80 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_debug, 0, 1, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_errno, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_error arginfo_mysqli_character_set_name ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_error_list, 0, 1, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_execute, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_execute arginfo_mysqli_stmt_execute ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_field, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_fields, 0, 1, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_field_direct, 0, 2, MAY_BE_OBJECT|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_lengths, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_all, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_NUM") ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_array, 0, 1, MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetchtype, IS_LONG, 0, "MYSQLI_BOTH") + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_BOTH") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_assoc, 0, 1, IS_ARRAY, 1) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_object, 0, 1, IS_OBJECT, 1) - ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 0, "\"stdClass\"") + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class, IS_STRING, 0, "\"stdClass\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_row, 0, 1, IS_ARRAY, 1) - ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) -ZEND_END_ARG_INFO() +#define arginfo_mysqli_fetch_row arginfo_mysqli_fetch_assoc -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_field_count, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) -ZEND_END_ARG_INFO() +#define arginfo_mysqli_field_count arginfo_mysqli_errno ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_field_seek, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) - ZEND_ARG_TYPE_INFO(0, field_nr, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_field_tell, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_free_result, 0, 1, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_connection_stats, 0, 1, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() #endif @@ -151,11 +147,11 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_charset, 0, 1, IS_OBJECT, 1) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_client_info, 0, 0, IS_STRING, 1) - ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, mysqli_link, mysqli, 1, "null") + ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, mysql, mysqli, 1, "null") ZEND_END_ARG_INFO() #define arginfo_mysqli_get_client_version arginfo_mysqli_connect_errno @@ -164,74 +160,66 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_links_stats, 0, 0, IS ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_host_info, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_get_proto_info arginfo_mysqli_field_count +#define arginfo_mysqli_get_proto_info arginfo_mysqli_errno #define arginfo_mysqli_get_server_info arginfo_mysqli_get_host_info -#define arginfo_mysqli_get_server_version arginfo_mysqli_field_count +#define arginfo_mysqli_get_server_version arginfo_mysqli_errno ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_get_warnings, 0, 1, mysqli_warning, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_init, 0, 0, mysqli, MAY_BE_FALSE) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_info, 0, 1, IS_STRING, 1) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) -ZEND_END_ARG_INFO() +#define arginfo_mysqli_info arginfo_mysqli_character_set_name -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_insert_id, 0, 1, MAY_BE_LONG|MAY_BE_STRING) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) -ZEND_END_ARG_INFO() +#define arginfo_mysqli_insert_id arginfo_mysqli_affected_rows ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_kill, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, connection_id, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_more_results, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) -ZEND_END_ARG_INFO() +#define arginfo_mysqli_more_results arginfo_mysqli_close ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_multi_query, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_next_result arginfo_mysqli_more_results +#define arginfo_mysqli_next_result arginfo_mysqli_close -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_num_fields, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, mysql_result, mysqli_result, 0) -ZEND_END_ARG_INFO() +#define arginfo_mysqli_num_fields arginfo_mysqli_field_tell ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_num_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) - ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0) + ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_options, 0, 3, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -#define arginfo_mysqli_ping arginfo_mysqli_more_results +#define arginfo_mysqli_ping arginfo_mysqli_close #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_poll, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, sec, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, usec, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_prepare, 0, 2, mysqli_stmt, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -240,15 +228,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_report, 0, 1, _IS_BOOL, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_query, 0, 2, mysqli_result, MAY_BE_BOOL) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_mode, IS_LONG, 0, "MYSQLI_STORE_RESULT") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_real_connect, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, host, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, database, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 1, "null") @@ -257,115 +245,111 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_real_connect, 0, 1, _IS_B ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_real_escape_string, 0, 2, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, string_to_escape, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_real_query arginfo_mysqli_multi_query #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_reap_async_query, 0, 1, mysqli_result, MAY_BE_BOOL) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_release_savepoint, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_rollback, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") -ZEND_END_ARG_INFO() +#define arginfo_mysqli_rollback arginfo_mysqli_begin_transaction #define arginfo_mysqli_savepoint arginfo_mysqli_release_savepoint ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_select_db, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, dbname, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_set_charset, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, charset, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_stmt_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_attr_get, 0, 2, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) - ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_attr_set, 0, 3, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) - ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, mode_in, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_bind_param, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_ARG_TYPE_INFO(0, types, IS_STRING, 0) ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_bind_result, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_close arginfo_mysqli_stmt_execute ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_data_seek, 0, 2, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_errno, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_error, 0, 1, IS_STRING, 1) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_error_list, 0, 1, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_fetch, 0, 1, _IS_BOOL, 1) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_field_count arginfo_mysqli_stmt_errno ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_free_result, 0, 1, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_get_result, 0, 1, mysqli_result, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_get_warnings, 0, 1, mysqli_warning, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_init, 0, 1, mysqli_stmt, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_insert_id arginfo_mysqli_stmt_affected_rows #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_more_results, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() #endif @@ -378,19 +362,19 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_param_count arginfo_mysqli_stmt_errno ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_prepare, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_reset arginfo_mysqli_stmt_execute ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_stmt_result_metadata, 0, 1, mysqli_result, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_send_long_data, 0, 3, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0) - ZEND_ARG_TYPE_INFO(0, param_nr, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0) + ZEND_ARG_TYPE_INFO(0, param_num, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -398,24 +382,24 @@ ZEND_END_ARG_INFO() #define arginfo_mysqli_stmt_sqlstate arginfo_mysqli_stmt_error -#define arginfo_mysqli_sqlstate arginfo_mysqli_info +#define arginfo_mysqli_sqlstate arginfo_mysqli_character_set_name ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_ssl_set, 0, 6, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cert, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, certificate_authority, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, certificate_authority_path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, certificate, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ca_certificate, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ca_path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algos, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_stat, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_store_result, 0, 1, mysqli_result, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #define arginfo_mysqli_thread_id arginfo_mysqli_errno @@ -424,14 +408,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_thread_safe, 0, 0, _IS_BO ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_use_result, 0, 1, mysqli_result, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_warning_count arginfo_mysqli_errno ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_refresh, 0, 2, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_mysqli_escape_string arginfo_mysqli_real_escape_string @@ -440,7 +424,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, host, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, database, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 1, "null") @@ -448,7 +432,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli___construct, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_autocommit, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) @@ -457,7 +441,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_change_user, 0, 0, 3) - ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1) ZEND_END_ARG_INFO() @@ -477,7 +461,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_dump_debug_info arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_debug, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, debug_options, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_mysqli_get_charset arginfo_class_mysqli_character_set_name @@ -496,7 +480,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_init arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_kill, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, connection_id, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, process_id, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_multi_query, 0, 0, 1) @@ -514,8 +498,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_poll, 0, 0, 4) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, sec, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, usec, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #endif @@ -528,7 +512,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, host, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, database, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 1, "null") @@ -537,7 +521,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_escape_string, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, string_to_escape, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) @@ -573,10 +557,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 0, 5) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cert, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, certificate_authority, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, certificate_authority_path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, certificate, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ca_certificate, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ca_path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algos, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_mysqli_stat arginfo_class_mysqli_character_set_name @@ -584,7 +568,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_stmt_init arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_store_result, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_END_ARG_INFO() #define arginfo_class_mysqli_thread_safe arginfo_class_mysqli_character_set_name @@ -592,11 +576,11 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_use_result arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_refresh, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mysqli_link, IS_OBJECT, 0) + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_mode, IS_LONG, 0, "MYSQLI_STORE_RESULT") ZEND_END_ARG_INFO() @@ -613,23 +597,23 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_result_fetch_fields arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_field_direct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, field_nr, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() #if defined(MYSQLI_USE_MYSQLND) ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_all, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "MYSQLI_NUM") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_NUM") ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_array, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "MYSQLI_BOTH") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_BOTH") ZEND_END_ARG_INFO() #define arginfo_class_mysqli_result_fetch_assoc arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_object, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 0, "\"stdClass\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class, IS_STRING, 0, "\"stdClass\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() @@ -643,17 +627,17 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_mysqli_result_getIterator, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, statement, IS_STRING, 1, "null") + ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, query, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_set, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, mode_in, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_bind_param, 0, 0, 1) @@ -688,7 +672,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_stmt_num_rows arginfo_class_mysqli_character_set_name ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_send_long_data, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, param_nr, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, param_num, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -704,9 +688,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_stmt_get_result arginfo_class_mysqli_get_connection_stats #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_warning___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, mysqli_link, IS_OBJECT, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_mysqli_warning___construct arginfo_class_mysqli_character_set_name #define arginfo_class_mysqli_warning_next arginfo_mysqli_thread_safe @@ -1075,7 +1057,7 @@ static const zend_function_entry class_mysqli_stmt_methods[] = { static const zend_function_entry class_mysqli_warning_methods[] = { - ZEND_ME(mysqli_warning, __construct, arginfo_class_mysqli_warning___construct, ZEND_ACC_PROTECTED) + ZEND_ME(mysqli_warning, __construct, arginfo_class_mysqli_warning___construct, ZEND_ACC_PRIVATE) ZEND_ME(mysqli_warning, next, arginfo_class_mysqli_warning_next, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 85c08c5b2f7da..5bbb1d38888cd 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -639,7 +639,7 @@ PHP_FUNCTION(mysqli_query) if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT && MYSQLI_STORE_RESULT != (resultmode & ~(MYSQLI_ASYNC | MYSQLI_STORE_RESULT_COPY_DATA)) ) { - zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT" + zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT" #ifdef MYSQLI_USE_MYSQLND " with MYSQLI_ASYNC as an optional bitmask flag" #endif diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index 16cb0ebdfb8c6..c99b3df5df894 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -254,67 +254,12 @@ static int mysqli_warning_errno(mysqli_object *obj, zval *retval, zend_bool quie } /* }}} */ -/* {{{ mysqli_warning_construct(object obj) */ PHP_METHOD(mysqli_warning, __construct) { - zval *z; - mysqli_object *obj; -#ifndef MYSQLI_USE_MYSQLND - MYSQL *hdl; -#endif - MYSQLI_WARNING *w; - MYSQLI_RESOURCE *mysqli_resource; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &z) == FAILURE) { - RETURN_THROWS(); - } - obj = Z_MYSQLI_P(z); - - if (obj->zo.ce == mysqli_link_class_entry) { - MY_MYSQL *mysql; - MYSQLI_FETCH_RESOURCE_CONN(mysql, z, MYSQLI_STATUS_VALID); - if (mysql_warning_count(mysql->mysql)) { -#ifndef MYSQLI_USE_MYSQLND - w = php_get_warnings(mysql->mysql); -#else - w = php_get_warnings(mysql->mysql->data); -#endif - } else { - php_error_docref(NULL, E_WARNING, "No warnings found"); - RETURN_FALSE; - } - } else if (obj->zo.ce == mysqli_stmt_class_entry) { - MY_STMT *stmt; - MYSQLI_FETCH_RESOURCE_STMT(stmt, z, MYSQLI_STATUS_VALID); -#ifndef MYSQLI_USE_MYSQLND - hdl = mysqli_stmt_get_connection(stmt->stmt); - if (mysql_warning_count(hdl)) { - w = php_get_warnings(hdl); -#else - if (mysqlnd_stmt_warning_count(stmt->stmt)) { - w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt)); -#endif - } else { - php_error_docref(NULL, E_WARNING, "No warnings found"); - RETURN_FALSE; - } - } else { - php_error_docref(NULL, E_WARNING, "Invalid class argument"); - RETURN_FALSE; - } - - mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); - mysqli_resource->ptr = mysqli_resource->info = (void *)w; - mysqli_resource->status = MYSQLI_STATUS_VALID; - - if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry)) { - MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry); - } else { - (Z_MYSQLI_P(getThis()))->ptr = mysqli_resource; - } + ZEND_PARSE_PARAMETERS_NONE(); + zend_throw_error(NULL, "Cannot directly construct mysqli_warning"); } -/* }}} */ /* {{{ mysqli_warning_property_entries */ const mysqli_property_entry mysqli_warning_property_entries[] = { diff --git a/ext/mysqli/tests/mysqli_class_mysqli_warning.phpt b/ext/mysqli/tests/mysqli_class_mysqli_warning.phpt deleted file mode 100644 index 045d2b18c3de9..0000000000000 --- a/ext/mysqli/tests/mysqli_class_mysqli_warning.phpt +++ /dev/null @@ -1,127 +0,0 @@ ---TEST-- -Interface of the class mysqli_warning - TODO ---SKIPIF-- - ---FILE-- -stmt_init(); - $warning = new mysqli_warning($stmt); - - $obj = new stdClass(); - $warning = new mysqli_warning($obj); - - include("table.inc"); - $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); - $res = $mysqli->query('INSERT INTO test(id, label) VALUES (1, "zz")'); - $warning = mysqli_get_warnings($mysqli); - - printf("Parent class:\n"); - var_dump(get_parent_class($warning)); - - printf("\nMethods:\n"); - $methods = get_class_methods($warning); - $expected_methods = array( - 'next' => true, - ); - - foreach ($methods as $k => $method) { - if (isset($expected_methods[$method])) { - unset($methods[$k]); - unset($expected_methods[$method]); - } - } - if (!empty($methods)) { - printf("Dumping list of unexpected methods.\n"); - var_dump($methods); - } - if (!empty($expected_methods)) { - printf("Dumping list of missing methods.\n"); - var_dump($expected_methods); - } - if (empty($methods) && empty($expected_methods)) - printf("ok\n"); - - printf("\nClass variables:\n"); - $variables = get_class_vars(get_class($mysqli)); - sort($variables); - foreach ($variables as $k => $var) - printf("%s\n", $var); - - printf("\nObject variables:\n"); - $variables = get_object_vars($mysqli); - foreach ($variables as $k => $var) - printf("%s\n", $var); - - printf("\nMagic, magic properties:\n"); - - assert('' === $warning->message); - printf("warning->message = '%s'\n", $warning->message); - - assert('' === $warning->sqlstate); - printf("warning->sqlstate= '%s'\n", $warning->sqlstate); - - assert(0 === $warning->errno); - printf("warning->errno = '%s'\n", $warning->errno); - - printf("\nAccess to undefined properties:\n"); - printf("warning->unknown = '%s'\n", @$warning->unknown); - - print "done!"; -?> ---CLEAN-- - ---EXPECTF-- -Warning: Wrong parameter count for mysqli_warning::mysqli_warning() in %s on line %d - -Warning: mysqli_warning::mysqli_warning(): Argument #1 must be of type object, null given in %s on line %d - -Warning: Wrong parameter count for mysqli_warning::mysqli_warning() in %s on line %d - -Warning: mysqli_warning::mysqli_warning(): mysqli object is already closed in %s on line %d -mysqli_stmt object is not fully initialized -mysqli_stmt object is not fully initialized - -Warning: mysqli_warning::mysqli_warning(): Invalid class argument in /home/nixnutz/php6_mysqlnd/ext/mysqli/tests/mysqli_class_mysqli_warning.php on line 19 - -Warning: mysqli_warning::mysqli_warning(): No warnings found in %s on line %d -Parent class: -bool(false) - -Methods: -ok - -Class variables: - -Object variables: - -Magic, magic properties: -warning->message = '' -warning->sqlstate= '' -warning->errno = '' - -Access to undefined properties: - -warning->unknown = '' -done! diff --git a/ext/mysqli/tests/mysqli_commit_oo.phpt b/ext/mysqli/tests/mysqli_commit_oo.phpt index 6377fdf5a91c8..e4cfbe47943ad 100644 --- a/ext/mysqli/tests/mysqli_commit_oo.phpt +++ b/ext/mysqli/tests/mysqli_commit_oo.phpt @@ -76,15 +76,13 @@ if (!have_innodb($link)) if (!$mysqli->commit(0 , "tx_name0123")) { printf("[012] [%d] %s\n", $mysqli->errno, $mysqli->error); } - if (!$mysqli->commit(0 , "*/ nonsense")) { - printf("[013] [%d] %s\n", $mysqli->errno, $mysqli->error); - } - if (!$mysqli->commit(0 , "tx_name ulf вендел")) { - printf("[014] [%d] %s\n", $mysqli->errno, $mysqli->error); - } - if (!$mysqli->commit(0 , "tx_name \t\n\r\b")) { - printf("[015] [%d] %s\n", $mysqli->errno, $mysqli->error); - } + + var_dump($mysqli->commit(0 , "*/ nonsense")); + + var_dump($mysqli->commit(0 , "tx_name ulf вендел")); + + var_dump($mysqli->commit(0 , "tx_name \t\n\r\b")); + if (!$mysqli->commit(MYSQLI_TRANS_COR_AND_CHAIN | MYSQLI_TRANS_COR_NO_RELEASE , "tx_name")) { printf("[016] [%d] %s\n", $mysqli->errno, $mysqli->error); } @@ -105,10 +103,13 @@ if (!have_innodb($link)) --EXPECTF-- mysqli object is not fully initialized -Warning: mysqli::commit(): Transaction name truncated. Must be only [0-9A-Za-z\-_=]+ in %s on line %d +Warning: mysqli::commit(): Transaction name has been truncated, since it can only contain the A-Z, a-z, 0-9, "\", "-", "_", and "=" characters in %s on line %d +bool(true) -Warning: mysqli::commit(): Transaction name truncated. Must be only [0-9A-Za-z\-_=]+ in %s on line %d +Warning: mysqli::commit(): Transaction name has been truncated, since it can only contain the A-Z, a-z, 0-9, "\", "-", "_", and "=" characters in %s on line %d +bool(true) -Warning: mysqli::commit(): Transaction name truncated. Must be only [0-9A-Za-z\-_=]+ in %s on line %d +Warning: mysqli::commit(): Transaction name has been truncated, since it can only contain the A-Z, a-z, 0-9, "\", "-", "_", and "=" characters in %s on line %d +bool(true) my_mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt index 358dc2ae8b1aa..df522f2eeb580 100644 --- a/ext/mysqli/tests/mysqli_fetch_all_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all_oo.phpt @@ -435,6 +435,6 @@ array(1) { string(1) "1" } } -mysqli_result::fetch_all(): Argument #1 ($result_type) must be one of MYSQLI_FETCH_NUM, MYSQLI_FETCH_ASSOC, or MYSQLI_FETCH_BOTH +mysqli_result::fetch_all(): Argument #1 ($mode) must be one of MYSQLI_FETCH_NUM, MYSQLI_FETCH_ASSOC, or MYSQLI_FETCH_BOTH mysqli_result object is already closed done! diff --git a/ext/mysqli/tests/mysqli_fetch_array.phpt b/ext/mysqli/tests/mysqli_fetch_array.phpt index c2046f1821e65..c5805552606b7 100644 --- a/ext/mysqli/tests/mysqli_fetch_array.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array.phpt @@ -48,15 +48,17 @@ require_once('skipifconnectfailure.inc'); $illegal_mode = mt_rand(-10000, 10000); } while (in_array($illegal_mode, array(MYSQLI_ASSOC, MYSQLI_NUM, MYSQLI_BOTH))); // NOTE: for BC reasons with ext/mysql, ext/mysqli accepts invalid result modes. - $tmp = mysqli_fetch_array($res, $illegal_mode); - if (false !== $tmp) - printf("[013] Expecting boolean/false although, got %s/%s. [%d] %s\n", - gettype($tmp), $tmp, mysqli_errno($link), mysqli_error($link)); + try { + mysqli_fetch_array($res, $illegal_mode); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } - $tmp = mysqli_fetch_array($res, $illegal_mode); - if (false !== $tmp) - printf("[014] Expecting boolean/false, got %s/%s. [%d] %s\n", - gettype($tmp), $tmp, mysqli_errno($link), mysqli_error($link)); + try { + mysqli_fetch_array($res, $illegal_mode); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } mysqli_free_result($res); @@ -357,9 +359,7 @@ array(11) { ["e"]=> string(1) "1" } - -Warning: mysqli_fetch_array(): The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH in %s on line %d - -Warning: mysqli_fetch_array(): The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH in %s on line %d +mysqli_fetch_array(): Argument #2 ($mode) must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH +mysqli_fetch_array(): Argument #2 ($mode) must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH mysqli_result object is already closed done! diff --git a/ext/mysqli/tests/mysqli_fetch_array_oo.phpt b/ext/mysqli/tests/mysqli_fetch_array_oo.phpt index 6bf2b0f4c02df..dad5917888c4f 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_oo.phpt @@ -55,15 +55,17 @@ require_once('skipifconnectfailure.inc'); $illegal_mode = mt_rand(-10000, 10000); } while (in_array($illegal_mode, array(MYSQLI_ASSOC, MYSQLI_NUM, MYSQLI_BOTH))); // NOTE: for BC reasons with ext/mysql, ext/mysqli accepts invalid result modes. - $tmp = $res->fetch_array($illegal_mode); - if (false !== $tmp) - printf("[013] Expecting boolean/false although, got %s/%s. [%d] %s\n", - gettype($tmp), $tmp, $mysqli->errno, $mysqli->error); + try { + $res->fetch_array($illegal_mode); + } catch (Error $exception) { + echo $exception->getMessage() . "\n"; + } - $tmp = $res->fetch_array($illegal_mode); - if (false !== $tmp) - printf("[014] Expecting boolean/false, got %s/%s. [%d] %s\n", - gettype($tmp), $tmp, $mysqli->errno, $mysqli->error); + try { + $res->fetch_array($illegal_mode); + } catch (Error $exception) { + echo $exception->getMessage() . "\n"; + } $res->free_result(); @@ -353,9 +355,7 @@ array(11) { ["e"]=> string(1) "1" } - -Warning: mysqli_result::fetch_array(): The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH in %s on line %d - -Warning: mysqli_result::fetch_array(): The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH in %s on line %d +mysqli_result::fetch_array(): Argument #1 ($mode) must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH +mysqli_result::fetch_array(): Argument #1 ($mode) must be one of MYSQLI_NUM, MYSQLI_ASSOC, or MYSQLI_BOTH mysqli_result object is already closed done! diff --git a/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt index 1f94eefd388d5..e07ec40ad0320 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_direct_oo.phpt @@ -57,7 +57,7 @@ require_once('skipifconnectfailure.inc'); ?> --EXPECTF-- mysqli object is not fully initialized -mysqli_result::fetch_field_direct(): Argument #1 ($field_nr) must be greater than or equal to 0 +mysqli_result::fetch_field_direct(): Argument #1 ($index) must be greater than or equal to 0 object(stdClass)#%d (13) { ["name"]=> string(2) "ID" @@ -86,6 +86,6 @@ object(stdClass)#%d (13) { ["decimals"]=> int(%d) } -mysqli_result::fetch_field_direct(): Argument #1 ($field_nr) must be less than the number of fields for this result set +mysqli_result::fetch_field_direct(): Argument #1 ($index) must be less than the number of fields for this result set mysqli_result object is already closed done! diff --git a/ext/mysqli/tests/mysqli_fetch_object.phpt b/ext/mysqli/tests/mysqli_fetch_object.phpt index a234aee4c8a5c..f5708ac55853d 100644 --- a/ext/mysqli/tests/mysqli_fetch_object.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object.phpt @@ -148,5 +148,5 @@ NULL NULL mysqli_result object is already closed [0] mysqli_fetch_object(): Argument #3 ($params) must be of type array, string given in %s on line %d -mysqli_fetch_object(): Argument #2 ($class_name) must be a valid class name, this_class_does_not_exist given +mysqli_fetch_object(): Argument #2 ($class) must be a valid class name, this_class_does_not_exist given done! diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index b00c485950004..f402db82d87b3 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -139,5 +139,5 @@ Exception: Too few arguments to function mysqli_fetch_object_construct::__constr NULL NULL mysqli_result object is already closed -mysqli_result::fetch_object(): Argument #1 ($class_name) must be a valid class name, this_class_does_not_exist given +mysqli_result::fetch_object(): Argument #1 ($class) must be a valid class name, this_class_does_not_exist given done! diff --git a/ext/mysqli/tests/mysqli_field_seek.phpt b/ext/mysqli/tests/mysqli_field_seek.phpt index 0a0b02273efc8..8b0516a6a05ff 100644 --- a/ext/mysqli/tests/mysqli_field_seek.phpt +++ b/ext/mysqli/tests/mysqli_field_seek.phpt @@ -122,7 +122,7 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -mysqli_field_seek(): Argument #2 ($field_nr) must be greater than or equal to 0 +mysqli_field_seek(): Argument #2 ($index) must be greater than or equal to 0 object(stdClass)#%d (13) { ["name"]=> string(2) "id" @@ -210,7 +210,7 @@ object(stdClass)#%d (13) { int(0) } int(2) -mysqli_field_seek(): Argument #2 ($field_nr) must be less than the number of fields for this result set +mysqli_field_seek(): Argument #2 ($index) must be less than the number of fields for this result set bool(false) bool(true) object(stdClass)#%d (13) { diff --git a/ext/mysqli/tests/mysqli_field_tell.phpt b/ext/mysqli/tests/mysqli_field_tell.phpt index 79cfc04885191..d489e4068e863 100644 --- a/ext/mysqli/tests/mysqli_field_tell.phpt +++ b/ext/mysqli/tests/mysqli_field_tell.phpt @@ -88,9 +88,9 @@ object(stdClass)#%d (13) { } bool(false) int(1) -mysqli_field_seek(): Argument #2 ($field_nr) must be less than the number of fields for this result set +mysqli_field_seek(): Argument #2 ($index) must be less than the number of fields for this result set int(1) -mysqli_field_seek(): Argument #2 ($field_nr) must be greater than or equal to 0 +mysqli_field_seek(): Argument #2 ($index) must be greater than or equal to 0 int(1) bool(true) int(0) diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt index 40ca9eaa1af96..bec08cc1e1d3b 100644 --- a/ext/mysqli/tests/mysqli_kill.phpt +++ b/ext/mysqli/tests/mysqli_kill.phpt @@ -80,7 +80,7 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 string(%d) "%s" bool(false) object(mysqli)#%d (%d) { @@ -131,10 +131,10 @@ object(mysqli)#%d (%d) { ["warning_count"]=> int(0) } -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 array(1) { ["id"]=> string(1) "1" } -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 done! diff --git a/ext/mysqli/tests/mysqli_poll.phpt b/ext/mysqli/tests/mysqli_poll.phpt index c786a8166b305..7ff77f71c8e90 100644 --- a/ext/mysqli/tests/mysqli_poll.phpt +++ b/ext/mysqli/tests/mysqli_poll.phpt @@ -114,8 +114,8 @@ if (!$IS_MYSQLND) print "done!"; ?> --EXPECTF-- -mysqli_poll(): Argument #4 ($sec) must be greater than or equal to 0 -mysqli_poll(): Argument #5 ($usec) must be greater than or equal to 0 +mysqli_poll(): Argument #4 ($seconds) must be greater than or equal to 0 +mysqli_poll(): Argument #5 ($microseconds) must be greater than or equal to 0 [012 + 6] Rejecting thread %d: 0/ [013 + 6] Rejecting thread %d: 0/ [014 + 6] Rejecting thread %d: 0/ diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index 90fc24cf9c852..e2f6de3995dfe 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -125,6 +125,6 @@ array(1) { string(1) "a" } string(1) "a" -mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT%S +mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT%S mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_report.phpt b/ext/mysqli/tests/mysqli_report.phpt index 5aa695f8f2ae1..dda3c3ec734b2 100644 --- a/ext/mysqli/tests/mysqli_report.phpt +++ b/ext/mysqli/tests/mysqli_report.phpt @@ -287,12 +287,12 @@ require_once('skipifconnectfailure.inc'); Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'BAR; FOO' at line 1 in %s on line %d Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 Warning: mysqli_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 Warning: mysqli_stmt_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d [013] Access denied for user '%s'@'%s' (using password: YES) diff --git a/ext/mysqli/tests/mysqli_report_wo_ps.phpt b/ext/mysqli/tests/mysqli_report_wo_ps.phpt index 7f0295dd44c71..c1ba3e4756cf1 100644 --- a/ext/mysqli/tests/mysqli_report_wo_ps.phpt +++ b/ext/mysqli/tests/mysqli_report_wo_ps.phpt @@ -113,10 +113,10 @@ Warning: mysqli_multi_query(): (%d/%d): You have an error in your SQL syntax; ch Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 Warning: mysqli_real_query(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d -mysqli_kill(): Argument #2 ($connection_id) must be greater than 0 +mysqli_kill(): Argument #2 ($process_id) must be greater than 0 [011] Access denied for user '%s'@'%s' (using password: YES) [014] Access denied for user '%s'@'%s' (using password: YES) done! diff --git a/ext/mysqli/tests/mysqli_stmt_attr_get.phpt b/ext/mysqli/tests/mysqli_stmt_attr_get.phpt index aea6c91ad00de..2b35eb88c567b 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_get.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_get.phpt @@ -52,7 +52,7 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECT-- -mysqli_stmt_attr_get(): Argument #2 ($attr) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE +mysqli_stmt_attr_get(): Argument #2 ($attribute) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE mysqli_stmt object is already closed mysqli_stmt object is already closed mysqli_stmt object is already closed diff --git a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt index 16d789f37f7fd..0edbc578e8f61 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt @@ -242,9 +242,9 @@ require_once("connect.inc"); ?> --EXPECT-- Error: mysqli_stmt object is not fully initialized -mysqli_stmt_attr_set(): Argument #2 ($attr) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE -mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH +mysqli_stmt_attr_set(): Argument #2 ($attribute) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE +mysqli_stmt::attr_set(): Argument #2 ($value) must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH bool(true) -mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE -mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be greater than 0 for attribute MYSQLI_STMT_ATTR_PREFETCH_ROWS +mysqli_stmt::attr_set(): Argument #2 ($value) must be one of the MYSQLI_CURSOR_TYPE_* constants for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE +mysqli_stmt::attr_set(): Argument #2 ($value) must be greater than 0 for attribute MYSQLI_STMT_ATTR_PREFETCH_ROWS done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param.phpt index 237b722646750..f3f11511ca181 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param.phpt @@ -83,16 +83,14 @@ require_once('skipifconnectfailure.inc'); } try { - if (!false === ($tmp = mysqli_stmt_bind_param($stmt, "aa", $id, $label))) - printf("[006] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - } catch (\ArgumentCountError $e) { + mysqli_stmt_bind_param($stmt, "aa", $id, $label); + } catch (ValueError $e) { echo $e->getMessage() . \PHP_EOL; } try { - if (!false === ($tmp = mysqli_stmt_bind_param($stmt, "ia", $id, $label))) - printf("[007] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - } catch (\ArgumentCountError $e) { + mysqli_stmt_bind_param($stmt, "ia", $id, $label); + } catch (ValueError $e) { echo $e->getMessage() . \PHP_EOL; } @@ -414,7 +412,7 @@ require_once('skipifconnectfailure.inc'); ---EXPECTF-- +--EXPECT-- The number of variables must match the number of parameters in the prepared statement mysqli_stmt_bind_param(): Argument #2 ($types) cannot be empty The number of elements in the type definition string must match the number of bind variables @@ -422,8 +420,6 @@ The number of variables must match the number of parameters in the prepared stat The number of elements in the type definition string must match the number of bind variables The number of variables must match the number of parameters in the prepared statement The number of elements in the type definition string must match the number of bind variables - -Warning: mysqli_stmt_bind_param(): Undefined fieldtype a (parameter 3) in %s on line %d - -Warning: mysqli_stmt_bind_param(): Undefined fieldtype a (parameter 4) in %s on line %d +mysqli_stmt_bind_param(): Argument #2 ($types) must only contain the "b", "d", "i", "s" type specifiers +mysqli_stmt_bind_param(): Argument #2 ($types) must only contain the "b", "d", "i", "s" type specifiers done! diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index b9139cb6e1979..0fce3502fc299 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt @@ -108,5 +108,5 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECT-- -mysqli_stmt_send_long_data(): Argument #2 ($param_nr) must be greater than or equal to 0 +mysqli_stmt_send_long_data(): Argument #2 ($param_num) must be greater than or equal to 0 done! diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 5915e1266e5d4..35cc3f55fc0ac 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -2054,7 +2054,7 @@ mysqlnd_escape_string_for_tx_name_in_comment(const char * const name) { *p_copy++ = v; } else if (warned == FALSE) { - php_error_docref(NULL, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+"); + php_error_docref(NULL, E_WARNING, "Transaction name has been truncated, since it can only contain the A-Z, a-z, 0-9, \"\\\", \"-\", \"_\", and \"=\" characters"); warned = TRUE; } ++p_orig; diff --git a/ext/odbc/odbc.stub.php b/ext/odbc/odbc.stub.php index 9316f1d7e41ce..667d5e88b76a2 100644 --- a/ext/odbc/odbc.stub.php +++ b/ext/odbc/odbc.stub.php @@ -17,7 +17,7 @@ function odbc_longreadlen($result_id, int $length): bool {} function odbc_prepare($connection_id, string $query) {} /** @param resource $result_id */ -function odbc_execute($result_id, array $parameters_array = UNKNOWN): bool {} +function odbc_execute($result_id, array $parameters_array = []): bool {} /** @param resource $result_id */ function odbc_cursor($result_id): string|false {} @@ -31,14 +31,14 @@ function odbc_data_source($connection_id, int $fetch_type): array|false {} * @param resource $connection_id * @return resource|false */ -function odbc_exec($connection_id, string $query, int $flags = UNKNOWN) {} +function odbc_exec($connection_id, string $query) {} /** * @param resource $connection_id * @return resource|false * @alias odbc_exec */ -function odbc_do($connection_id, string $query, int $flags = UNKNOWN) {} +function odbc_do($connection_id, string $query) {} #ifdef PHP_ODBC_HAVE_FETCH_HASH /** @param resource $result */ @@ -55,7 +55,7 @@ function odbc_fetch_array($result, int $rownumber = -1): array|false {} function odbc_fetch_into($result_id, &$result_array, int $rownumber = 0): int|false {} /** @param resource $result_id */ -function odbc_fetch_row($result_id, int $row_number = UNKNOWN): bool {} +function odbc_fetch_row($result_id, ?int $row_number = null): bool {} /** @param resource $result_id */ function odbc_result($result_id, string|int $field): string|bool|null {} @@ -116,11 +116,11 @@ function odbc_commit($connection_id): bool {} /** @param resource $connection_id */ function odbc_rollback($connection_id): bool {} -/** @param resource $connection_id */ -function odbc_error($connection_id = UNKNOWN): string {} +/** @param resource|null $connection_id */ +function odbc_error($connection_id = null): string {} -/** @param resource $connection_id */ -function odbc_errormsg($connection_id = UNKNOWN): string {} +/** @param resource|null $connection_id */ +function odbc_errormsg($connection_id = null): string {} /** @param resource $conn_id */ function odbc_setoption($conn_id, int $which, int $option, int $value): bool {} @@ -129,13 +129,13 @@ function odbc_setoption($conn_id, int $which, int $option, int $value): bool {} * @param resource $connection_id * @return resource|false */ -function odbc_tables($connection_id, ?string $qualfier = null, string $owner = UNKNOWN, string $name = UNKNOWN, string $table_types = UNKNOWN) {} +function odbc_tables($connection_id, ?string $catalog = null, ?string $schema = null, ?string $name = null, ?string $table_types = null) {} /** * @param resource $connection_id * @return resource|false */ -function odbc_columns($connection_id, ?string $qualifier = null, string $owner = UNKNOWN, string $table_name = UNKNOWN, string $column_name = UNKNOWN) {} +function odbc_columns($connection_id, ?string $catalog = null, ?string $schema = null, ?string $table_name = null, ?string $column_name = null) {} /** * @param resource $connection_id @@ -147,47 +147,46 @@ function odbc_gettypeinfo($connection_id, int $data_type = 0) {} * @param resource $connection_id * @return resource|false */ -function odbc_primarykeys($connection_id, ?string $qualifier, string $owner, string $table) {} +function odbc_primarykeys($connection_id, ?string $catalog, string $schema, string $table) {} #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /** * @param resource $connection_id * @return resource|false */ -function odbc_procedurecolumns($connection_id, ?string $qualifier = null, string $owner = UNKNOWN, string $proc = UNKNOWN, string $column = UNKNOWN) {} +function odbc_procedurecolumns($connection_id, ?string $catalog = null, ?string $schema = null, ?string $proc = null, ?string $column = null) {} /** * @param resource $connection_id * @return resource|false */ -function odbc_procedures($connection_id, ?string $qualifier = null, string $owner = UNKNOWN, string $name = UNKNOWN) {} +function odbc_procedures($connection_id, ?string $catalog = null, ?string $schema = null, ?string $name = null) {} /** * @param resource $connection_id * @return resource|false */ -function odbc_foreignkeys($connection_id, ?string $pk_qualifier, string $pk_owner, string $pk_table, string $fk_qualifier, string $fk_owner, string $fk_table) {} +function odbc_foreignkeys($connection_id, ?string $pk_catalog, string $pk_schema, string $pk_table, string $fk_catalog, string $fk_schema, string $fk_table) {} #endif /** - * @see https://bugs.php.net/bug.php?id=78470 * @param resource $connection_id * @return resource|false */ -function odbc_specialcolumns($connection_id, int $type, ?string $qualifier, string $owner, string $table, int $scope) {} +function odbc_specialcolumns($connection_id, int $type, ?string $catalog, string $schema, string $table, int $scope, int $nullable) {} /** * @param resource $connection_id * @return resource|false */ -function odbc_statistics($connection_id, ?string $qualfier, string $owner, string $name, int $unique, int $accuracy) {} +function odbc_statistics($connection_id, ?string $catalog, string $schema, string $name, int $unique, int $accuracy) {} #if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) /** * @param resource $connection_id * @return resource|false */ -function odbc_tableprivileges($connection_id, ?string $qualifier, string $owner, string $name) {} +function odbc_tableprivileges($connection_id, ?string $catalog, string $schema, string $name) {} /** * @param resource $connection_id diff --git a/ext/odbc/odbc_arginfo.h b/ext/odbc/odbc_arginfo.h index 7d42c63530a09..ad2fbf48b02a4 100644 --- a/ext/odbc/odbc_arginfo.h +++ b/ext/odbc/odbc_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 57db79b23d127851f985d9b6280b113637384a68 */ + * Stub hash: 53069f42e460cfea8e2daf499277f6ceb9c760f7 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() @@ -21,7 +21,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_execute, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, result_id) - ZEND_ARG_TYPE_INFO(0, parameters_array, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, parameters_array, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_odbc_cursor, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) @@ -35,13 +35,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_odbc_data_source, 0, 2, MAY_BE_A ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_exec, 0, 0, 2) - ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) -ZEND_END_ARG_INFO() +#define arginfo_odbc_exec arginfo_odbc_prepare -#define arginfo_odbc_do arginfo_odbc_exec +#define arginfo_odbc_do arginfo_odbc_prepare #if defined(PHP_ODBC_HAVE_FETCH_HASH) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_odbc_fetch_object, 0, 1, stdClass, MAY_BE_FALSE) @@ -65,7 +61,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_fetch_row, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, result_id) - ZEND_ARG_TYPE_INFO(0, row_number, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_odbc_result, 0, 2, MAY_BE_STRING|MAY_BE_BOOL|MAY_BE_NULL) @@ -140,7 +136,7 @@ ZEND_END_ARG_INFO() #define arginfo_odbc_rollback arginfo_odbc_commit ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_error, 0, 0, IS_STRING, 0) - ZEND_ARG_INFO(0, connection_id) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, connection_id, "null") ZEND_END_ARG_INFO() #define arginfo_odbc_errormsg arginfo_odbc_error @@ -154,18 +150,18 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_tables, 0, 0, 1) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, qualfier, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, table_types, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, catalog, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, schema, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, table_types, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_columns, 0, 0, 1) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, qualifier, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, column_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, catalog, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, schema, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, table_name, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column_name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_gettypeinfo, 0, 0, 1) @@ -175,55 +171,56 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_primarykeys, 0, 0, 4) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO(0, qualifier, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, catalog, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) ZEND_END_ARG_INFO() #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_procedurecolumns, 0, 0, 1) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, qualifier, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, proc, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, column, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, catalog, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, schema, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, proc, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_procedures, 0, 0, 1) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, qualifier, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, catalog, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, schema, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #endif #if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_foreignkeys, 0, 0, 7) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO(0, pk_qualifier, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, pk_owner, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, pk_catalog, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, pk_schema, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, pk_table, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, fk_qualifier, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, fk_owner, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, fk_catalog, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, fk_schema, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, fk_table, IS_STRING, 0) ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_specialcolumns, 0, 0, 6) +ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_specialcolumns, 0, 0, 7) ZEND_ARG_INFO(0, connection_id) ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, qualifier, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, catalog, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, scope, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, nullable, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_statistics, 0, 0, 6) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO(0, qualfier, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, catalog, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, unique, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, accuracy, IS_LONG, 0) @@ -232,8 +229,8 @@ ZEND_END_ARG_INFO() #if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_tableprivileges, 0, 0, 4) ZEND_ARG_INFO(0, connection_id) - ZEND_ARG_TYPE_INFO(0, qualifier, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, catalog, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 6636a810433d7..d058fd0191d2e 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -964,7 +964,7 @@ PHP_FUNCTION(odbc_prepare) PHP_FUNCTION(odbc_execute) { zval *pv_res, *tmp; - HashTable *pv_param_ht; + HashTable *pv_param_ht = (HashTable *) &zend_empty_array; typedef struct params_t { SQLLEN vallen; int fp; @@ -974,10 +974,10 @@ PHP_FUNCTION(odbc_execute) unsigned char otype; SQLSMALLINT ctype; odbc_result *result; - int numArgs = ZEND_NUM_ARGS(), i, ne; + int i, ne; RETCODE rc; - if (zend_parse_parameters(numArgs, "r|h", &pv_res, &pv_param_ht) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|h/", &pv_res, &pv_param_ht) == FAILURE) { RETURN_THROWS(); } @@ -985,15 +985,9 @@ PHP_FUNCTION(odbc_execute) RETURN_THROWS(); } - /* XXX check for already bound parameters*/ - if (result->numparams > 0 && numArgs == 1) { - php_error_docref(NULL, E_WARNING, "No parameters to SQL statement given"); - RETURN_FALSE; - } - if (result->numparams > 0) { if ((ne = zend_hash_num_elements(pv_param_ht)) < result->numparams) { - php_error_docref(NULL, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); + php_error_docref(NULL, E_WARNING, "Not enough parameters (%d should be %d) given", ne, result->numparams); RETURN_FALSE; } @@ -1294,7 +1288,6 @@ PHP_FUNCTION(odbc_data_source) PHP_FUNCTION(odbc_exec) { zval *pv_conn; - zend_long pv_flags; char *query; size_t query_len; odbc_result *result = NULL; @@ -1304,7 +1297,7 @@ PHP_FUNCTION(odbc_exec) SQLUINTEGER scrollopts; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &pv_conn, &query, &query_len, &pv_flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pv_conn, &query, &query_len) == FAILURE) { RETURN_THROWS(); } @@ -1683,22 +1676,20 @@ PHP_FUNCTION(solid_fetch_prev) /* {{{ Fetch a row */ PHP_FUNCTION(odbc_fetch_row) { - SQLLEN rownum; odbc_result *result; RETCODE rc; zval *pv_res; - zend_long pv_row = 1; + zend_long pv_row; + zend_bool pv_row_is_null = 1; #ifdef HAVE_SQL_EXTENDED_FETCH SQLULEN crow; SQLUSMALLINT RowStatus[1]; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_res, &pv_row) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l!", &pv_res, &pv_row, &pv_row_is_null) == FAILURE) { RETURN_THROWS(); } - rownum = pv_row; - if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) { RETURN_THROWS(); } @@ -1710,8 +1701,8 @@ PHP_FUNCTION(odbc_fetch_row) #ifdef HAVE_SQL_EXTENDED_FETCH if (result->fetch_abs) { - if (ZEND_NUM_ARGS() > 1) { - rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,rownum,&crow,RowStatus); + if (!pv_row_is_null) { + rc = SQLExtendedFetch(result->stmt,SQL_FETCH_ABSOLUTE,(SQLLEN)pv_row,&crow,RowStatus); } else { rc = SQLExtendedFetch(result->stmt,SQL_FETCH_NEXT,1,&crow,RowStatus); } @@ -1723,8 +1714,8 @@ PHP_FUNCTION(odbc_fetch_row) RETURN_FALSE; } - if (ZEND_NUM_ARGS() > 1) { - result->fetched = rownum; + if (!pv_row_is_null) { + result->fetched = (SQLLEN)pv_row; } else { result->fetched++; } @@ -1879,6 +1870,7 @@ PHP_FUNCTION(odbc_result) if (rc != SQL_SUCCESS_WITH_INFO) { field_str = zend_string_truncate(field_str, result->values[field_ind].vallen, 0); } + ZSTR_VAL(field_str)[ZSTR_LEN(field_str)] = '\0'; RETURN_NEW_STR(field_str); break; @@ -2175,15 +2167,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int /* Persistent connections: two list-types le_pconn, le_conn and a plist * where hashed connection info is stored together with index pointer to * the actual link of type le_pconn in the list. Only persistent - * connections get hashed up. Normal connections use existing pconnections. - * Maybe this has to change with regard to transactions on pconnections? - * Possibly set autocommit to on on request shutdown. - * - * We do have to hash non-persistent connections, and reuse connections. - * In the case where two connects were being made, without closing the first - * connect, access violations were occurring. This is because some of the - * "globals" in this module should actually be per-connection variables. I - * simply fixed things to get them working for now. Shane + * connections get hashed up. */ /* {{{ odbc_do_connect */ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) @@ -2192,8 +2176,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) size_t db_len, uid_len, pwd_len; zend_long pv_opt = SQL_CUR_DEFAULT; odbc_connection *db_conn; - char *hashed_details; - int hashed_len, cur_opt; + int cur_opt; /* Now an optional 4th parameter specifying the cursor type * defaulting to the cursors default @@ -2220,20 +2203,15 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) persistent = 0; } - hashed_len = spprintf(&hashed_details, 0, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); - - /* FIXME the idea of checking to see if our connection is already persistent - is good, but it adds a lot of overhead to non-persistent connections. We - should look and see if we can fix that somehow */ - /* try to find if we already have this link in our persistent list, - * no matter if it is to be persistent or not - */ - try_and_get_another_connection: if (persistent) { + char *hashed_details; + int hashed_len; zend_resource *le; + hashed_len = spprintf(&hashed_details, 0, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); + /* the link is not in the persistent list */ if ((le = zend_hash_str_find_ptr(&EG(persistent_list), hashed_details, hashed_len)) == NULL) { if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) { @@ -2262,9 +2240,8 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) db_conn->res = zend_register_resource(db_conn, le_pconn); RETVAL_RES(db_conn->res); } else { /* found connection */ - if (le->type != le_pconn) { - RETURN_FALSE; - } + ZEND_ASSERT(le->type == le_pconn); + /* * check to see if the connection is still valid */ @@ -2295,50 +2272,22 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } } } + efree(hashed_details); db_conn->res = zend_register_resource(db_conn, le_pconn); RETVAL_RES(db_conn->res); } else { /* non persistent */ - zend_resource *index_ptr, new_index_ptr; - - if ((index_ptr = zend_hash_str_find_ptr(&EG(regular_list), hashed_details, hashed_len)) != NULL) { - zend_ulong conn_id; - zend_resource *p; - - if (index_ptr->type != le_index_ptr) { - RETURN_FALSE; - } - conn_id = (zend_ulong)index_ptr->ptr; - p = zend_hash_index_find_ptr(&EG(regular_list), conn_id); /* check if the connection is still there */ - - if (p && p->ptr && (p->type == le_conn || p->type == le_pconn)) { - GC_ADDREF(p); - RETVAL_RES(p); - efree(hashed_details); - return; - } else { - zend_hash_str_del(&EG(regular_list), hashed_details, hashed_len); - } - } if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) { php_error_docref(NULL, E_WARNING,"Too many open connections (%ld)",ODBCG(num_links)); - efree(hashed_details); RETURN_FALSE; } if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 0)) { - efree(hashed_details); RETURN_FALSE; } db_conn->res = zend_register_resource(db_conn, le_conn); RETVAL_RES(db_conn->res); - new_index_ptr.ptr = (void *)(zend_uintptr_t)Z_RES_HANDLE_P(return_value); - new_index_ptr.type = le_index_ptr; - - zend_hash_str_update_mem(&EG(regular_list), hashed_details, hashed_len, (void *) &new_index_ptr, - sizeof(zend_resource)); ODBCG(num_links)++; } - efree(hashed_details); } /* }}} */ @@ -2645,14 +2594,14 @@ PHP_FUNCTION(odbc_rollback) static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode) { odbc_connection *conn; - zval *pv_handle; + zval *pv_handle = NULL; char *ret; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pv_handle) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r!", &pv_handle) == FAILURE) { RETURN_THROWS(); } - if (ZEND_NUM_ARGS() == 1) { + if (pv_handle) { if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_handle), "ODBC-Link", le_conn, le_pconn))) { RETURN_THROWS(); } @@ -2757,7 +2706,7 @@ PHP_FUNCTION(odbc_tables) size_t cat_len = 0, schema_len = 0, table_len = 0, type_len = 0; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!s!", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len, &type, &type_len) == FAILURE) { RETURN_THROWS(); } @@ -2782,7 +2731,7 @@ PHP_FUNCTION(odbc_tables) } /* This hack is needed to access table information in Access databases (fmk) */ - if (table && table_len && schema && schema_len == 0) { + if (schema && schema_len == 0 && table && table_len) { schema = NULL; } @@ -2793,7 +2742,7 @@ PHP_FUNCTION(odbc_tables) (SQLCHAR *) type, SAFE_SQL_NTS(type)); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTables"); + odbc_sql_error(conn, result->stmt, "SQLTables"); efree(result); RETURN_FALSE; } @@ -2825,7 +2774,7 @@ PHP_FUNCTION(odbc_columns) size_t cat_len = 0, schema_len = 0, table_len = 0, column_len = 0; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!s!", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len, &column, &column_len) == FAILURE) { RETURN_THROWS(); } @@ -2863,7 +2812,7 @@ PHP_FUNCTION(odbc_columns) (SQLCHAR *) column, (SQLSMALLINT) column_len); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumns"); + odbc_sql_error(conn, result->stmt, "SQLColumns"); efree(result); RETURN_FALSE; } @@ -2927,7 +2876,7 @@ PHP_FUNCTION(odbc_columnprivileges) (SQLCHAR *) column, SAFE_SQL_NTS(column)); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumnPrivileges"); + odbc_sql_error(conn, result->stmt, "SQLColumnPrivileges"); efree(result); RETURN_FALSE; } @@ -3006,7 +2955,7 @@ PHP_FUNCTION(odbc_foreignkeys) (SQLCHAR *) ftable, SAFE_SQL_NTS(ftable) ); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLForeignKeys"); + odbc_sql_error(conn, result->stmt, "SQLForeignKeys"); efree(result); RETURN_FALSE; } @@ -3067,7 +3016,7 @@ PHP_FUNCTION(odbc_gettypeinfo) rc = SQLGetTypeInfo(result->stmt, data_type ); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLGetTypeInfo"); + odbc_sql_error(conn, result->stmt, "SQLGetTypeInfo"); efree(result); RETURN_FALSE; } @@ -3128,7 +3077,7 @@ PHP_FUNCTION(odbc_primarykeys) (SQLCHAR *) table, SAFE_SQL_NTS(table) ); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLPrimaryKeys"); + odbc_sql_error(conn, result->stmt, "SQLPrimaryKeys"); efree(result); RETURN_FALSE; } @@ -3161,11 +3110,7 @@ PHP_FUNCTION(odbc_procedurecolumns) size_t cat_len = 0, schema_len = 0, proc_len = 0, col_len = 0; RETCODE rc; - if (ZEND_NUM_ARGS() != 1 && ZEND_NUM_ARGS() != 5) { - WRONG_PARAM_COUNT; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!s!", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len, &col, &col_len) == FAILURE) { RETURN_THROWS(); } @@ -3196,7 +3141,7 @@ PHP_FUNCTION(odbc_procedurecolumns) (SQLCHAR *) col, SAFE_SQL_NTS(col) ); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedureColumns"); + odbc_sql_error(conn, result->stmt, "SQLProcedureColumns"); efree(result); RETURN_FALSE; } @@ -3230,11 +3175,7 @@ PHP_FUNCTION(odbc_procedures) size_t cat_len = 0, schema_len = 0, proc_len = 0; RETCODE rc; - if (ZEND_NUM_ARGS() != 1 && ZEND_NUM_ARGS() != 4) { - WRONG_PARAM_COUNT; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) { RETURN_THROWS(); } @@ -3263,7 +3204,7 @@ PHP_FUNCTION(odbc_procedures) (SQLCHAR *) proc, SAFE_SQL_NTS(proc) ); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedures"); + odbc_sql_error(conn, result->stmt, "SQLProcedures"); efree(result); RETURN_FALSE; } @@ -3298,7 +3239,7 @@ PHP_FUNCTION(odbc_specialcolumns) SQLUSMALLINT type, scope, nullable; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls!ssl", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls!ssll", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len, &name, &name_len, &vscope, &vnullable) == FAILURE) { RETURN_THROWS(); } @@ -3334,7 +3275,7 @@ PHP_FUNCTION(odbc_specialcolumns) nullable); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLSpecialColumns"); + odbc_sql_error(conn, result->stmt, "SQLSpecialColumns"); efree(result); RETURN_FALSE; } @@ -3403,7 +3344,7 @@ PHP_FUNCTION(odbc_statistics) reserved); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLStatistics"); + odbc_sql_error(conn, result->stmt, "SQLStatistics"); efree(result); RETURN_FALSE; } @@ -3465,7 +3406,7 @@ PHP_FUNCTION(odbc_tableprivileges) (SQLCHAR *) table, SAFE_SQL_NTS(table)); if (rc == SQL_ERROR) { - odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTablePrivileges"); + odbc_sql_error(conn, result->stmt, "SQLTablePrivileges"); efree(result); RETURN_FALSE; } diff --git a/ext/odbc/tests/bug78470.phpt b/ext/odbc/tests/bug78470.phpt new file mode 100644 index 0000000000000..d905b95667906 --- /dev/null +++ b/ext/odbc/tests/bug78470.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #78470 (odbc_specialcolumns() no longer accepts $nullable) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +resource(%d) of type (odbc result) diff --git a/ext/odbc/tests/bug80147.phpt b/ext/odbc/tests/bug80147.phpt new file mode 100644 index 0000000000000..26e27c534ebac --- /dev/null +++ b/ext/odbc/tests/bug80147.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #80147 (BINARY strings may not be properly zero-terminated) +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +string(8) "whatever" diff --git a/ext/odbc/tests/bug80152.phpt b/ext/odbc/tests/bug80152.phpt new file mode 100644 index 0000000000000..719ec3a516864 --- /dev/null +++ b/ext/odbc/tests/bug80152.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #80152 (odbc_execute() moves internal pointer of $params) +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(0) +int(0) diff --git a/ext/odbc/tests/odbc_columns_001.phpt b/ext/odbc/tests/odbc_columns_001.phpt index fbbc3e2e0334a..374a9bf6ea8c7 100644 --- a/ext/odbc/tests/odbc_columns_001.phpt +++ b/ext/odbc/tests/odbc_columns_001.phpt @@ -12,8 +12,13 @@ $conn = odbc_connect($dsn, $user, $pass); var_dump($result = odbc_columns($conn, '', '', '', '')); var_dump(odbc_fetch_row($result)); +var_dump($result = odbc_columns($conn)); +var_dump(odbc_fetch_row($result)); +var_dump(odbc_free_result($result)); + var_dump($result = odbc_columns($conn, NULL, NULL, NULL, NULL)); var_dump(odbc_fetch_row($result)); +var_dump(odbc_free_result($result)); var_dump($result = odbc_columns($conn, 'FOO', 'FOO', 'FOO', 'FOO')); var_dump(odbc_fetch_row($result)); @@ -23,6 +28,10 @@ var_dump(odbc_fetch_row($result)); resource(%d) of type (odbc result) bool(false) resource(%d) of type (odbc result) -bool(false) +bool(true) +bool(true) +resource(%d) of type (odbc result) +bool(true) +bool(true) resource(%d) of type (odbc result) bool(false) diff --git a/ext/odbc/tests/odbc_data_source_001.phpt b/ext/odbc/tests/odbc_data_source_001.phpt index d92a44252b6f4..a641d07b74131 100644 --- a/ext/odbc/tests/odbc_data_source_001.phpt +++ b/ext/odbc/tests/odbc_data_source_001.phpt @@ -24,7 +24,6 @@ var_dump(odbc_data_source($conn, SQL_FETCH_FIRST)); ?> --EXPECTF-- odbc_data_source(): Argument #2 ($fetch_type) must be either SQL_FETCH_FIRST or SQL_FETCH_NEXT -bool(false) array(%d) { %a } diff --git a/ext/odbc/tests/odbc_tables_001.phpt b/ext/odbc/tests/odbc_tables_001.phpt index 6b922f25e6576..420c41cda882e 100644 --- a/ext/odbc/tests/odbc_tables_001.phpt +++ b/ext/odbc/tests/odbc_tables_001.phpt @@ -12,18 +12,26 @@ $conn = odbc_connect($dsn, $user, $pass); var_dump($result = odbc_tables($conn, '', '', '', '')); var_dump(odbc_fetch_row($result)); +var_dump($result = odbc_tables($conn)); +var_dump(odbc_fetch_row($result)); +var_dump(odbc_free_result($result)); + var_dump($result = odbc_tables($conn, NULL, NULL, NULL, NULL)); var_dump(odbc_fetch_row($result)); +var_dump(odbc_free_result($result)); var_dump($result = odbc_tables($conn, 'FOO', 'FOO', 'FOO', 'FOO')); var_dump(odbc_fetch_row($result)); - ?> --EXPECTF-- resource(%d) of type (odbc result) bool(false) resource(%d) of type (odbc result) -bool(false) +bool(true) +bool(true) +resource(%d) of type (odbc result) +bool(true) +bool(true) resource(%d) of type (odbc result) bool(false) diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index 6b8cb33f5690b..e3b4da720c4d1 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -97,7 +97,7 @@ static const func_info_t func_infos[] = { F1("zend_version", MAY_BE_STRING), FN("func_get_arg", UNKNOWN_INFO), FN("func_get_args", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY), - F1("get_class_vars", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF), + F1("get_class_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF), F1("get_class_methods", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("get_included_files", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), FN("set_error_handler", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT), @@ -160,7 +160,7 @@ static const func_info_t func_infos[] = { F1("str_word_count", MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("str_split", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("strpbrk", MAY_BE_FALSE | MAY_BE_STRING), - FN("substr_replace", MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING), + FN("substr_replace", MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING), F1("quotemeta", MAY_BE_STRING), F1("ucwords", MAY_BE_STRING), F1("addcslashes", MAY_BE_STRING), @@ -175,7 +175,7 @@ static const func_info_t func_infos[] = { #if HAVE_NL_LANGINFO F1("nl_langinfo", MAY_BE_FALSE | MAY_BE_STRING), #endif - F1("soundex", MAY_BE_FALSE | MAY_BE_STRING), + F1("soundex", MAY_BE_STRING), F1("chr", MAY_BE_STRING), F1("str_getcsv", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING), F1("strchr", MAY_BE_FALSE | MAY_BE_STRING), @@ -188,7 +188,7 @@ static const func_info_t func_infos[] = { F1("urldecode", MAY_BE_STRING), F1("rawurlencode", MAY_BE_STRING), F1("rawurldecode", MAY_BE_STRING), - F1("http_build_query", MAY_BE_FALSE | MAY_BE_STRING), + F1("http_build_query", MAY_BE_STRING), #if defined(HAVE_SYMLINK) || defined(PHP_WIN32) F1("readlink", MAY_BE_FALSE | MAY_BE_STRING), #endif @@ -213,7 +213,7 @@ static const func_info_t func_infos[] = { F1("base64_encode", MAY_BE_STRING), F1("password_hash", MAY_BE_STRING), F1("password_get_info", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), - F1("convert_uuencode", MAY_BE_FALSE | MAY_BE_STRING), + F1("convert_uuencode", MAY_BE_STRING), F1("convert_uudecode", MAY_BE_FALSE | MAY_BE_STRING), F1("pow", MAY_BE_LONG | MAY_BE_DOUBLE | MAY_BE_OBJECT), F1("decbin", MAY_BE_STRING), @@ -316,15 +316,15 @@ static const func_info_t func_infos[] = { F1("get_meta_tags", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING), F1("stream_get_meta_data", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY), F1("stream_get_line", MAY_BE_FALSE | MAY_BE_STRING), - F1("stream_get_wrappers", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), - F1("stream_get_transports", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), + F1("stream_get_wrappers", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), + F1("stream_get_transports", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("stream_resolve_include_path", MAY_BE_FALSE | MAY_BE_STRING), F1("get_headers", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), F1("socket_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY), F1("realpath", MAY_BE_FALSE | MAY_BE_STRING), F1("fsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE), FN("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE), - F1("pack", MAY_BE_FALSE | MAY_BE_STRING), + F1("pack", MAY_BE_STRING), F1("unpack", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY), F1("get_browser", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_OBJECT | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY), F1("crypt", MAY_BE_STRING), @@ -344,7 +344,7 @@ static const func_info_t func_infos[] = { F0("syslog", MAY_BE_TRUE), F0("closelog", MAY_BE_TRUE), #endif - F1("metaphone", MAY_BE_FALSE | MAY_BE_STRING), + F1("metaphone", MAY_BE_STRING), F1("ob_get_flush", MAY_BE_FALSE | MAY_BE_STRING), F1("ob_get_clean", MAY_BE_FALSE | MAY_BE_STRING), F1("ob_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY), @@ -409,7 +409,7 @@ static const func_info_t func_infos[] = { F1("str_rot13", MAY_BE_STRING), F1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_OBJECT), - F1("stream_bucket_new", MAY_BE_FALSE | MAY_BE_OBJECT), + F1("stream_bucket_new", MAY_BE_OBJECT), F1("sys_get_temp_dir", MAY_BE_STRING), /* ext/date */ @@ -702,16 +702,16 @@ static const func_info_t func_infos[] = { F1("pg_execute", MAY_BE_FALSE | MAY_BE_RESOURCE), FN("pg_last_notice", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY ), F1("pg_field_table", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING), - F1("pg_field_name", MAY_BE_FALSE | MAY_BE_STRING), - F1("pg_field_type", MAY_BE_FALSE | MAY_BE_STRING), - F1("pg_field_type_oid", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING), + F1("pg_field_name", MAY_BE_STRING), + F1("pg_field_type", MAY_BE_STRING), + F1("pg_field_type_oid", MAY_BE_LONG | MAY_BE_STRING), F1("pg_fetch_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING), F1("pg_fetch_row", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING), F1("pg_fetch_assoc", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING), F1("pg_fetch_array", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING), F1("pg_fetch_object", MAY_BE_FALSE | MAY_BE_OBJECT), - F1("pg_fetch_all", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY), - F1("pg_fetch_all_columns", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING), + F1("pg_fetch_all", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY), + F1("pg_fetch_all_columns", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING), F1("pg_last_oid", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING), F1("pg_lo_create", MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING), F1("pg_lo_open", MAY_BE_FALSE | MAY_BE_RESOURCE), @@ -720,7 +720,7 @@ static const func_info_t func_infos[] = { F1("pg_copy_to", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING), F1("pg_escape_string", MAY_BE_STRING), F1("pg_escape_bytea", MAY_BE_STRING), - F1("pg_unescape_bytea", MAY_BE_FALSE | MAY_BE_STRING), + F1("pg_unescape_bytea", MAY_BE_STRING), F1("pg_escape_literal", MAY_BE_FALSE | MAY_BE_STRING), F1("pg_escape_identifier", MAY_BE_FALSE | MAY_BE_STRING), F1("pg_result_error", MAY_BE_FALSE | MAY_BE_STRING), diff --git a/ext/opcache/Optimizer/zend_func_info.h b/ext/opcache/Optimizer/zend_func_info.h index 97f60ad37e60f..13dd2e3127c38 100644 --- a/ext/opcache/Optimizer/zend_func_info.h +++ b/ext/opcache/Optimizer/zend_func_info.h @@ -35,6 +35,12 @@ #define ZEND_FUNC_HAS_EXTENDED_STMT (1<<11) #define ZEND_SSA_TSSA (1<<12) /* used by tracing JIT */ +#define ZEND_FUNC_JIT_ON_FIRST_EXEC (1<<13) /* used by JIT */ +#define ZEND_FUNC_JIT_ON_PROF_REQUEST (1<<14) /* used by JIT */ +#define ZEND_FUNC_JIT_ON_HOT_COUNTERS (1<<15) /* used by JIT */ +#define ZEND_FUNC_JIT_ON_HOT_TRACE (1<<16) /* used by JIT */ + + typedef struct _zend_func_info zend_func_info; typedef struct _zend_call_info zend_call_info; diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 23ea50a4e3c49..340c19764f46d 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4160,6 +4160,7 @@ static void preload_fix_trait_methods(zend_class_entry *ce) static int preload_optimize(zend_persistent_script *script) { zend_class_entry *ce; + zend_persistent_script *tmp_script; zend_shared_alloc_init_xlat_table(); @@ -4169,8 +4170,8 @@ static int preload_optimize(zend_persistent_script *script) } } ZEND_HASH_FOREACH_END(); - ZEND_HASH_FOREACH_PTR(preload_scripts, script) { - ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) { + ZEND_HASH_FOREACH_PTR(preload_scripts, tmp_script) { + ZEND_HASH_FOREACH_PTR(&tmp_script->script.class_table, ce) { if (ce->ce_flags & ZEND_ACC_TRAIT) { preload_register_trait_methods(ce); } @@ -4486,7 +4487,6 @@ static int accel_preload(const char *config, zend_bool in_child) } zend_end_try(); PG(open_basedir) = orig_open_basedir; - CG(compiler_options) = orig_compiler_options; accelerator_orig_compile_file = preload_orig_compile_file; ZCG(enabled) = 1; @@ -4725,6 +4725,7 @@ static int accel_preload(const char *config, zend_bool in_child) } finish: + CG(compiler_options) = orig_compiler_options; zend_hash_destroy(preload_scripts); efree(preload_scripts); preload_scripts = NULL; diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 348f15c4fccdf..111b5f47e9075 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -3452,7 +3452,12 @@ static void zend_jit_cleanup_func_info(zend_op_array *op_array) if (JIT_G(trigger) == ZEND_JIT_ON_FIRST_EXEC || JIT_G(trigger) == ZEND_JIT_ON_PROF_REQUEST || JIT_G(trigger) == ZEND_JIT_ON_HOT_COUNTERS) { - memset(func_info, 0, sizeof(zend_func_info)); + func_info->num = 0; + func_info->flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC + | ZEND_FUNC_JIT_ON_PROF_REQUEST + | ZEND_FUNC_JIT_ON_HOT_COUNTERS + | ZEND_FUNC_JIT_ON_HOT_TRACE; + memset(&func_info->ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); } else { ZEND_SET_FUNC_INFO(op_array, NULL); } @@ -3621,9 +3626,55 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend /* JIT-ed code is going to be called by VM */ } +static void zend_jit_setup_hot_counters_ex(zend_op_array *op_array, zend_cfg *cfg) +{ + if (JIT_G(hot_func)) { + zend_op *opline = op_array->opcodes; + + if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { + while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) { + opline++; + } + } + + opline->handler = (const void*)zend_jit_func_hot_counter_handler; + } + + if (JIT_G(hot_loop)) { + uint32_t i; + + for (i = 0; i < cfg->blocks_count; i++) { + if ((cfg->blocks[i].flags & ZEND_BB_REACHABLE) && + (cfg->blocks[i].flags & ZEND_BB_LOOP_HEADER)) { + op_array->opcodes[cfg->blocks[i].start].handler = + (const void*)zend_jit_loop_hot_counter_handler; + } + } + } +} + +static int zend_jit_restart_hot_counters(zend_op_array *op_array) +{ + zend_jit_op_array_hot_extension *jit_extension; + zend_cfg cfg; + uint32_t i; + + jit_extension = (zend_jit_op_array_hot_extension*)ZEND_FUNC_INFO(op_array); + for (i = 0; i < op_array->last; i++) { + op_array->opcodes[i].handler = jit_extension->orig_handlers[i]; + } + + if (zend_jit_build_cfg(op_array, &cfg) != SUCCESS) { + return FAILURE; + } + + zend_jit_setup_hot_counters_ex(op_array, &cfg); + + return SUCCESS; +} + static int zend_jit_setup_hot_counters(zend_op_array *op_array) { - zend_op *opline = op_array->opcodes; zend_jit_op_array_hot_extension *jit_extension; zend_cfg cfg; uint32_t i; @@ -3637,31 +3688,14 @@ static int zend_jit_setup_hot_counters(zend_op_array *op_array) jit_extension = (zend_jit_op_array_hot_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_hot_extension) + (op_array->last - 1) * sizeof(void*)); memset(&jit_extension->func_info, 0, sizeof(zend_func_info)); + jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_HOT_COUNTERS; jit_extension->counter = &zend_jit_hot_counters[zend_jit_op_array_hash(op_array) & (ZEND_HOT_COUNTERS_COUNT - 1)]; for (i = 0; i < op_array->last; i++) { jit_extension->orig_handlers[i] = op_array->opcodes[i].handler; } ZEND_SET_FUNC_INFO(op_array, (void*)jit_extension); - if (JIT_G(hot_func)) { - if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { - while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) { - opline++; - } - } - - opline->handler = (const void*)zend_jit_func_hot_counter_handler; - } - - if (JIT_G(hot_loop)) { - for (i = 0; i < cfg.blocks_count; i++) { - if ((cfg.blocks[i].flags & ZEND_BB_REACHABLE) && - (cfg.blocks[i].flags & ZEND_BB_LOOP_HEADER)) { - op_array->opcodes[cfg.blocks[i].start].handler = - (const void*)zend_jit_loop_hot_counter_handler; - } - } - } + zend_jit_setup_hot_counters_ex(op_array, &cfg); zend_shared_alloc_register_xlat_entry(op_array->opcodes, jit_extension); @@ -3680,6 +3714,12 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script) zend_jit_op_array_extension *jit_extension; zend_op *opline = op_array->opcodes; + if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { + ZEND_SET_FUNC_INFO(op_array, NULL); + zend_error(E_WARNING, "Preloading is incompatible with first-exec and profile triggered JIT"); + return SUCCESS; + } + /* Set run-time JIT handler */ ZEND_ASSERT(zend_jit_runtime_jit_handler != NULL); if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { @@ -3689,6 +3729,7 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script) } jit_extension = (zend_jit_op_array_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_extension)); memset(&jit_extension->func_info, 0, sizeof(zend_func_info)); + jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_FIRST_EXEC; jit_extension->orig_handler = (void*)opline->handler; ZEND_SET_FUNC_INFO(op_array, (void*)jit_extension); opline->handler = (const void*)zend_jit_runtime_jit_handler; @@ -3699,6 +3740,12 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script) zend_jit_op_array_extension *jit_extension; zend_op *opline = op_array->opcodes; + if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { + ZEND_SET_FUNC_INFO(op_array, NULL); + zend_error(E_WARNING, "Preloading is incompatible with first-exec and profile triggered JIT"); + return SUCCESS; + } + ZEND_ASSERT(zend_jit_profile_jit_handler != NULL); if (op_array->function_name) { if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { @@ -3708,6 +3755,7 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script *script) } jit_extension = (zend_jit_op_array_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_extension)); memset(&jit_extension->func_info, 0, sizeof(zend_func_info)); + jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_PROF_REQUEST; jit_extension->orig_handler = (void*)opline->handler; ZEND_SET_FUNC_INFO(op_array, (void*)jit_extension); opline->handler = (const void*)zend_jit_profile_jit_handler; @@ -4257,6 +4305,59 @@ ZEND_EXT_API void zend_jit_deactivate(void) } } +static void zend_jit_restart_preloaded_op_array(zend_op_array *op_array) +{ + zend_func_info *func_info = ZEND_FUNC_INFO(op_array); + + if (!func_info) { + return; + } + + if (func_info->flags & ZEND_FUNC_JIT_ON_HOT_TRACE) { + zend_jit_restart_hot_trace_counters(op_array); + } else if (func_info->flags & ZEND_FUNC_JIT_ON_HOT_COUNTERS) { + zend_jit_restart_hot_counters(op_array); +#if 0 + // TODO: We have to restore handlers for some inner basic-blocks, but we didn't store them ??? + } else if (func_info->flags & (ZEND_FUNC_JIT_ON_FIRST_EXEC|ZEND_FUNC_JIT_ON_PROF_REQUEST)) { + zend_op *opline = op_array->opcodes; + zend_jit_op_array_extension *jit_extension = + (zend_jit_op_array_extension*)func_info; + + if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { + while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) { + opline++; + } + } + if (func_info->flags & ZEND_FUNC_JIT_ON_FIRST_EXEC) { + opline->handler = (const void*)zend_jit_runtime_jit_handler; + } else { + opline->handler = (const void*)zend_jit_profile_jit_handler; + } +#endif + } +} + +static void zend_jit_restart_preloaded_script(zend_persistent_script *script) +{ + zend_class_entry *ce; + zend_op_array *op_array; + + zend_jit_restart_preloaded_op_array(&script->script.main_op_array); + + ZEND_HASH_FOREACH_PTR(&script->script.function_table, op_array) { + zend_jit_restart_preloaded_op_array(op_array); + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) { + ZEND_HASH_FOREACH_PTR(&ce->function_table, op_array) { + if (op_array->type == ZEND_USER_FUNCTION) { + zend_jit_restart_preloaded_op_array(op_array); + } + } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); +} + ZEND_EXT_API void zend_jit_restart(void) { if (dasm_buf) { @@ -4267,6 +4368,18 @@ ZEND_EXT_API void zend_jit_restart(void) zend_jit_trace_restart(); + if (ZCSG(preload_script)) { + zend_jit_restart_preloaded_script(ZCSG(preload_script)); + if (ZCSG(saved_scripts)) { + zend_persistent_script **p = ZCSG(saved_scripts); + + while (*p) { + zend_jit_restart_preloaded_script(*p); + p++; + } + } + } + zend_jit_protect(); } } diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 0bbdb949a8a7a..e1cf4ffb8dba8 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -142,7 +142,6 @@ int ZEND_FASTCALL zend_jit_check_constant(const zval *key); _(RECURSIVE_CALL, "recursive call") \ _(RECURSIVE_RET, "recursive return") \ _(RETURN, "return") \ - _(RETURN_HALT, "return from interpreter") \ _(INTERPRETER, "exit to VM interpreter") \ _(LINK, "link to another trace") \ /* compilation and linking successful */ \ @@ -158,12 +157,12 @@ int ZEND_FASTCALL zend_jit_check_constant(const zval *key); _(DEEP_RECURSION, "deep recursion") \ _(LOOP_UNROLL, "loop unroll limit reached") \ _(LOOP_EXIT, "exit from loop") \ + _(RECURSION_EXIT, "return from recursive function") \ _(BLACK_LIST, "trace blacklisted") \ _(INNER_LOOP, "inner loop") /* trace it */ \ _(COMPILED_LOOP, "compiled loop") \ _(TRAMPOLINE, "trampoline call") \ _(BAD_FUNC, "bad function call") \ - _(HALT, "exit from interpreter") \ _(COMPILER_ERROR, "JIT compilation error") \ /* no recoverable error (blacklist immediately) */ \ _(NO_SHM, "insufficient shared memory") \ @@ -176,6 +175,7 @@ int ZEND_FASTCALL zend_jit_check_constant(const zval *key); typedef enum _zend_jit_trace_stop { ZEND_JIT_TRACE_STOP(ZEND_JIT_TRACE_STOP_NAME) + ZEND_JIT_TRACE_HALT = 0x40 } zend_jit_trace_stop; #define ZEND_JIT_TRACE_STOP_OK(ret) \ @@ -427,6 +427,9 @@ struct _zend_jit_trace_stack_frame { #define TRACE_FRAME_NO_NEED_REKEASE_THIS(frame) \ ((frame)->_info & TRACE_FRAME_MASK_NO_NEED_RELEASE_THIS) +#define TRACE_FRAME_SET_UNKNOWN_NUM_ARGS(frame) do { \ + (frame)->_info |= (0xffffu << TRACE_FRAME_SHIFT_NUM_ARGS); \ + } while (0) #define TRACE_FRAME_SET_RETURN_SSA_VAR(frame, var) do { \ (frame)->_info = var; \ } while (0) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 4edb08e08f9b0..caf162e44d480 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -486,7 +486,12 @@ static zend_ssa *zend_jit_trace_build_ssa(const zend_op_array *op_array, zend_sc jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); - memset(&jit_extension->func_info, 0, sizeof(jit_extension->func_info)); + jit_extension->func_info.num = 0; + jit_extension->func_info.flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC + | ZEND_FUNC_JIT_ON_PROF_REQUEST + | ZEND_FUNC_JIT_ON_HOT_COUNTERS + | ZEND_FUNC_JIT_ON_HOT_TRACE; + memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); ssa = &jit_extension->func_info.ssa; if (JIT_G(opt_level) >= ZEND_JIT_LEVEL_OPT_FUNC) { @@ -2005,7 +2010,8 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin ssa_var_info[phi->ssa_var].type = t & ~MAY_BE_GUARD; } } else if ((t1 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF)) == (t & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF))) { - if (!(t1 & MAY_BE_GUARD)) { + if (!(t1 & MAY_BE_GUARD) + || is_checked_guard(tssa, ssa_opcodes, phi->sources[1], phi->ssa_var)) { ssa_var_info[phi->ssa_var].type = t & ~MAY_BE_GUARD; ssa_var_info[phi->sources[0]].type = t | MAY_BE_GUARD; } @@ -2027,18 +2033,22 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin if (UNEXPECTED(JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_TSSA)) { if (parent_trace) { - fprintf(stderr, "---- TRACE %d TSSA start (side trace %d/%d) %s() %s:%d\n", + fprintf(stderr, "---- TRACE %d TSSA start (side trace %d/%d) %s%s%s() %s:%d\n", ZEND_JIT_TRACE_NUM, parent_trace, exit_num, + trace_buffer->op_array->scope ? ZSTR_VAL(trace_buffer->op_array->scope->name) : "", + trace_buffer->op_array->scope ? "::" : "", trace_buffer->op_array->function_name ? ZSTR_VAL(trace_buffer->op_array->function_name) : "$main", ZSTR_VAL(trace_buffer->op_array->filename), trace_buffer[1].opline->lineno); } else { - fprintf(stderr, "---- TRACE %d TSSA start (%s) %s() %s:%d\n", + fprintf(stderr, "---- TRACE %d TSSA start (%s) %s%s%s() %s:%d\n", ZEND_JIT_TRACE_NUM, zend_jit_trace_star_desc(trace_buffer->start), + trace_buffer->op_array->scope ? ZSTR_VAL(trace_buffer->op_array->scope->name) : "", + trace_buffer->op_array->scope ? "::" : "", trace_buffer->op_array->function_name ? ZSTR_VAL(trace_buffer->op_array->function_name) : "$main", ZSTR_VAL(trace_buffer->op_array->filename), @@ -5091,6 +5101,13 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } } goto done; + case ZEND_SEND_ARRAY: + case ZEND_SEND_UNPACK: + if (JIT_G(current_frame) + && JIT_G(current_frame)->call) { + TRACE_FRAME_SET_UNKNOWN_NUM_ARGS(JIT_G(current_frame)->call); + } + break; default: break; } @@ -5315,6 +5332,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par while (prev_opline->opcode == ZEND_EXT_FCALL_BEGIN || prev_opline->opcode == ZEND_TICKS) { prev_opline--; } + JIT_G(current_frame) = call; if ((prev_opline->opcode == ZEND_SEND_ARRAY || prev_opline->opcode == ZEND_SEND_UNPACK || prev_opline->opcode == ZEND_CHECK_UNDEF_ARGS) @@ -5322,10 +5340,12 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par && (p->op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0 && ((p+1)->op == ZEND_JIT_TRACE_VM || (p+1)->op == ZEND_JIT_TRACE_END) - && TRACE_FRAME_NUM_ARGS(call) < p->op_array->num_args + && (TRACE_FRAME_NUM_ARGS(call) < 0 + || TRACE_FRAME_NUM_ARGS(call) < p->op_array->num_args) && !zend_jit_trace_opline_guard(&dasm_state, (p+1)->opline)) { goto jit_failure; } + JIT_G(current_frame) = frame; } } @@ -5613,8 +5633,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } else { zend_jit_trace_return(&dasm_state, 0); } - } else if (p->stop == ZEND_JIT_TRACE_STOP_RETURN - || p->stop == ZEND_JIT_TRACE_STOP_RETURN_HALT) { + } else if (p->stop == ZEND_JIT_TRACE_STOP_RETURN) { zend_jit_trace_return(&dasm_state, 0); } else { // TODO: not implemented ??? @@ -5654,7 +5673,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } } } else if (p->stop == ZEND_JIT_TRACE_STOP_LINK - || p->stop == ZEND_JIT_TRACE_STOP_RETURN_HALT || p->stop == ZEND_JIT_TRACE_STOP_INTERPRETER) { if (opline && (opline->opcode == ZEND_DO_UCALL @@ -5695,7 +5713,12 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); - memset(&jit_extension->func_info, 0, sizeof(jit_extension->func_info)); + jit_extension->func_info.num = 0; + jit_extension->func_info.flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC + | ZEND_FUNC_JIT_ON_PROF_REQUEST + | ZEND_FUNC_JIT_ON_HOT_COUNTERS + | ZEND_FUNC_JIT_ON_HOT_TRACE; + memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa)); } zend_arena_release(&CG(arena), checkpoint); @@ -5765,6 +5788,7 @@ static zend_jit_trace_stop zend_jit_compile_root_trace(zend_jit_trace_rec *trace { zend_jit_trace_stop ret; const void *handler; + uint8_t orig_trigger; zend_jit_trace_info *t = NULL; zend_jit_trace_exit_info exit_info[ZEND_JIT_TRACE_MAX_EXITS]; @@ -5795,8 +5819,13 @@ static zend_jit_trace_stop zend_jit_compile_root_trace(zend_jit_trace_rec *trace t->exit_info = exit_info; t->stack_map = NULL; + orig_trigger = JIT_G(trigger); + JIT_G(trigger) = ZEND_JIT_ON_HOT_TRACE; + handler = zend_jit_trace(trace_buffer, 0, 0); + JIT_G(trigger) = orig_trigger; + if (handler) { zend_jit_trace_exit_info *shared_exit_info = NULL; @@ -6219,9 +6248,11 @@ int ZEND_FASTCALL zend_jit_trace_hot_root(zend_execute_data *execute_data, const } if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_START) { - fprintf(stderr, "---- TRACE %d start (%s) %s() %s:%d\n", + fprintf(stderr, "---- TRACE %d start (%s) %s%s%s() %s:%d\n", trace_num, zend_jit_trace_star_desc(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags), + EX(func)->op_array.scope ? ZSTR_VAL(EX(func)->op_array.scope->name) : "", + EX(func)->op_array.scope ? "::" : "", EX(func)->op_array.function_name ? ZSTR_VAL(EX(func)->op_array.function_name) : "$main", ZSTR_VAL(EX(func)->op_array.filename), @@ -6238,14 +6269,40 @@ int ZEND_FASTCALL zend_jit_trace_hot_root(zend_execute_data *execute_data, const ZEND_OP_TRACE_INFO(opline, offset)->trace_flags & ZEND_JIT_TRACE_START_MASK, 0); JIT_G(tracing) = 0; + if (stop & ZEND_JIT_TRACE_HALT) { + ret = -1; + } + stop &= ~ZEND_JIT_TRACE_HALT; + + if (UNEXPECTED(trace_buffer[1].opline != orig_opline)) { + orig_opline = trace_buffer[1].opline; + op_array = (zend_op_array*)trace_buffer[0].op_array; + jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); + offset = jit_extension->offset; + if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_START) { + const zend_op_array *op_array = trace_buffer[0].op_array; + const zend_op *opline = trace_buffer[1].opline; + zend_jit_op_array_trace_extension *jit_extension = + (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); + size_t offset = jit_extension->offset; + + fprintf(stderr, "---- TRACE %d start (%s) %s%s%s() %s:%d\n", + trace_num, + zend_jit_trace_star_desc(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags), + op_array->scope ? ZSTR_VAL(op_array->scope->name) : "", + op_array->scope ? "::" : "", + op_array->function_name ? + ZSTR_VAL(op_array->function_name) : "$main", + ZSTR_VAL(op_array->filename), + opline->lineno); + } + } + if (UNEXPECTED(JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_BYTECODE)) { zend_jit_dump_trace(trace_buffer, NULL); } if (ZEND_JIT_TRACE_STOP_OK(stop)) { - if (stop == ZEND_JIT_TRACE_STOP_RETURN_HALT) { - ret = -1; - } if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_STOP) { if (stop == ZEND_JIT_TRACE_STOP_LINK) { uint32_t idx = trace_buffer[1].last; @@ -6270,9 +6327,6 @@ int ZEND_FASTCALL zend_jit_trace_hot_root(zend_execute_data *execute_data, const goto abort; } } else { - if (stop == ZEND_JIT_TRACE_STOP_HALT) { - ret = -1; - } abort: if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_ABORT) { fprintf(stderr, "---- TRACE %d abort (%s)\n", @@ -6359,6 +6413,7 @@ static zend_jit_trace_stop zend_jit_compile_side_trace(zend_jit_trace_rec *trace { zend_jit_trace_stop ret; const void *handler; + uint8_t orig_trigger; zend_jit_trace_info *t; zend_jit_trace_exit_info exit_info[ZEND_JIT_TRACE_MAX_EXITS]; @@ -6391,8 +6446,13 @@ static zend_jit_trace_stop zend_jit_compile_side_trace(zend_jit_trace_rec *trace t->exit_info = exit_info; t->stack_map = NULL; + orig_trigger = JIT_G(trigger); + JIT_G(trigger) = ZEND_JIT_ON_HOT_TRACE; + handler = zend_jit_trace(trace_buffer, parent_num, exit_num); + JIT_G(trigger) = orig_trigger; + if (handler) { zend_jit_trace_exit_info *shared_exit_info = NULL; @@ -6490,8 +6550,10 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3 } if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_START) { - fprintf(stderr, "---- TRACE %d start (side trace %d/%d) %s() %s:%d\n", + fprintf(stderr, "---- TRACE %d start (side trace %d/%d) %s%s%s() %s:%d\n", trace_num, parent_num, exit_num, + EX(func)->op_array.scope ? ZSTR_VAL(EX(func)->op_array.scope->name) : "", + EX(func)->op_array.scope ? "::" : "", EX(func)->op_array.function_name ? ZSTR_VAL(EX(func)->op_array.function_name) : "$main", ZSTR_VAL(EX(func)->op_array.filename), @@ -6527,14 +6589,36 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3 stop = zend_jit_trace_execute(execute_data, EX(opline), trace_buffer, ZEND_JIT_TRACE_START_SIDE, is_megamorphic); JIT_G(tracing) = 0; + if (stop & ZEND_JIT_TRACE_HALT) { + ret = -1; + } + stop &= ~ZEND_JIT_TRACE_HALT; + + if (UNEXPECTED(trace_buffer->start != ZEND_JIT_TRACE_START_SIDE)) { + if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_START) { + const zend_op_array *op_array = trace_buffer[0].op_array; + const zend_op *opline = trace_buffer[1].opline; + zend_jit_op_array_trace_extension *jit_extension = + (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); + size_t offset = jit_extension->offset; + + fprintf(stderr, "---- TRACE %d start (%s) %s%s%s() %s:%d\n", + trace_num, + zend_jit_trace_star_desc(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags), + op_array->scope ? ZSTR_VAL(op_array->scope->name) : "", + op_array->scope ? "::" : "", + op_array->function_name ? + ZSTR_VAL(op_array->function_name) : "$main", + ZSTR_VAL(op_array->filename), + opline->lineno); + } + } + if (UNEXPECTED(JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_BYTECODE)) { zend_jit_dump_trace(trace_buffer, NULL); } if (ZEND_JIT_TRACE_STOP_OK(stop)) { - if (stop == ZEND_JIT_TRACE_STOP_RETURN_HALT) { - ret = -1; - } if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_STOP) { if (stop == ZEND_JIT_TRACE_STOP_LINK) { uint32_t idx = trace_buffer[1].last; @@ -6548,7 +6632,7 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3 zend_jit_trace_stop_description[stop]); } } - if (EXPECTED(stop != ZEND_JIT_TRACE_STOP_LOOP)) { + if (EXPECTED(trace_buffer->start == ZEND_JIT_TRACE_START_SIDE)) { stop = zend_jit_compile_side_trace(trace_buffer, parent_num, exit_num, polymorphism); } else { const zend_op_array *op_array = trace_buffer[0].op_array; @@ -6568,9 +6652,6 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3 goto abort; } } else { - if (stop == ZEND_JIT_TRACE_STOP_HALT) { - ret = -1; - } abort: if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_ABORT) { fprintf(stderr, "---- TRACE %d abort (%s)\n", @@ -6585,6 +6666,10 @@ int ZEND_FASTCALL zend_jit_trace_hot_side(zend_execute_data *execute_data, uint3 parent_num, exit_num); } } + if (ZEND_JIT_TRACE_STOP_REPEAT(stop)) { + execute_data = EG(current_execute_data); + return zend_jit_trace_hot_root(execute_data, EX(opline)); + } } if (JIT_G(debug) & (ZEND_JIT_DEBUG_TRACE_STOP|ZEND_JIT_DEBUG_TRACE_ABORT|ZEND_JIT_DEBUG_TRACE_COMPILED|ZEND_JIT_DEBUG_TRACE_BLACKLIST)) { @@ -6656,9 +6741,11 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf if (UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF)) { /* Undefined array index or property */ if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT) { - fprintf(stderr, " TRACE %d exit %d %s() %s:%d\n", + fprintf(stderr, " TRACE %d exit %d %s%s%s() %s:%d\n", trace_num, exit_num, + EX(func)->op_array.scope ? ZSTR_VAL(EX(func)->op_array.scope->name) : "", + EX(func)->op_array.scope ? "::" : "", EX(func)->op_array.function_name ? ZSTR_VAL(EX(func)->op_array.function_name) : "$main", ZSTR_VAL(EX(func)->op_array.filename), @@ -6718,9 +6805,11 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf EX(opline) < EX(func)->op_array.opcodes + EX(func)->op_array.last); if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT) { - fprintf(stderr, " TRACE %d exit %d %s() %s:%d\n", + fprintf(stderr, " TRACE %d exit %d %s%s%s() %s:%d\n", trace_num, exit_num, + EX(func)->op_array.scope ? ZSTR_VAL(EX(func)->op_array.scope->name) : "", + EX(func)->op_array.scope ? "::" : "", EX(func)->op_array.function_name ? ZSTR_VAL(EX(func)->op_array.function_name) : "$main", ZSTR_VAL(EX(func)->op_array.filename), @@ -6756,6 +6845,26 @@ static zend_always_inline uint8_t zend_jit_trace_supported(const zend_op *opline } } +static int zend_jit_restart_hot_trace_counters(zend_op_array *op_array) +{ + zend_jit_op_array_trace_extension *jit_extension; + uint32_t i; + + jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); + for (i = 0; i < op_array->last; i++) { + jit_extension->trace_info[i].trace_flags &= + ZEND_JIT_TRACE_START_LOOP | ZEND_JIT_TRACE_START_ENTER | ZEND_JIT_TRACE_UNSUPPORTED; + if (jit_extension->trace_info[i].trace_flags == ZEND_JIT_TRACE_START_LOOP) { + op_array->opcodes[i].handler = (const void*)zend_jit_loop_trace_counter_handler; + } else if (jit_extension->trace_info[i].trace_flags == ZEND_JIT_TRACE_START_ENTER) { + op_array->opcodes[i].handler = (const void*)zend_jit_func_trace_counter_handler; + } else { + op_array->opcodes[i].handler = jit_extension->trace_info[i].orig_handler; + } + } + return SUCCESS; +} + static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array) { zend_op *opline; @@ -6766,6 +6875,7 @@ static int zend_jit_setup_hot_trace_counters(zend_op_array *op_array) jit_extension = (zend_jit_op_array_trace_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_trace_extension) + (op_array->last - 1) * sizeof(zend_op_trace_info)); memset(&jit_extension->func_info, 0, sizeof(zend_func_info)); + jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_HOT_TRACE; jit_extension->op_array = op_array; jit_extension->offset = (char*)jit_extension->trace_info - (char*)op_array->opcodes; for (i = 0; i < op_array->last; i++) { diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index 6cb8df08d9da1..48df7ff108092 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -416,57 +416,20 @@ static int zend_jit_trace_has_recursive_ret(zend_execute_data *ex, const zend_op return 0; } -static int zend_jit_trace_bad_inner_loop(const zend_op *opline) +static uint8_t zend_jit_trace_bad_stop_event(const zend_op *opline, int count) { const zend_op **cache_opline = JIT_G(bad_root_cache_opline); uint8_t *cache_count = JIT_G(bad_root_cache_count); uint8_t *cache_stop = JIT_G(bad_root_cache_stop); uint32_t i; - for (i = 0; i < ZEND_JIT_TRACE_BAD_ROOT_SLOTS; i++) { - if (cache_opline[i] == opline) { - if ((cache_stop[i] == ZEND_JIT_TRACE_STOP_INNER_LOOP - || cache_stop[i] == ZEND_JIT_TRACE_STOP_LOOP_EXIT) - && cache_count[i] > JIT_G(blacklist_root_trace) / 2) { - return 1; - } - break; - } + if (count < 0) { + count = 0; } - return 0; -} - -static int zend_jit_trace_bad_compiled_loop(const zend_op *opline) -{ - const zend_op **cache_opline = JIT_G(bad_root_cache_opline); - uint8_t *cache_count = JIT_G(bad_root_cache_count); - uint8_t *cache_stop = JIT_G(bad_root_cache_stop); - uint32_t i; - - for (i = 0; i < ZEND_JIT_TRACE_BAD_ROOT_SLOTS; i++) { - if (cache_opline[i] == opline) { - if (cache_stop[i] == ZEND_JIT_TRACE_STOP_COMPILED_LOOP - && cache_count[i] >= JIT_G(blacklist_root_trace) - 1) { - return 1; - } - break; - } - } - return 0; -} - -static int zend_jit_trace_bad_loop_exit(const zend_op *opline) -{ - const zend_op **cache_opline = JIT_G(bad_root_cache_opline); - uint8_t *cache_count = JIT_G(bad_root_cache_count); - uint8_t *cache_stop = JIT_G(bad_root_cache_stop); - uint32_t i; - for (i = 0; i < ZEND_JIT_TRACE_BAD_ROOT_SLOTS; i++) { if (cache_opline[i] == opline) { - if (cache_stop[i] == ZEND_JIT_TRACE_STOP_LOOP_EXIT - && cache_count[i] >= JIT_G(blacklist_root_trace) - 1) { - return 1; + if (cache_count[i] >= count) { + return cache_stop[i]; } break; } @@ -502,7 +465,9 @@ static int zend_jit_trace_record_fake_init_call_ex(zend_execute_data *call, zend && (func->op_array.fn_flags & ZEND_ACC_CLOSURE)) { jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(&func->op_array); - if (UNEXPECTED(!jit_extension || (func->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE))) { + if (UNEXPECTED(!jit_extension + || !(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE) + || (func->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE))) { return -1; } func = (zend_function*)jit_extension->op_array; @@ -540,6 +505,15 @@ static int zend_jit_trace_call_level(const zend_execute_data *call) return call_level; } +static int zend_jit_trace_subtrace(zend_jit_trace_rec *trace_buffer, int start, int end, uint8_t event, const zend_op_array *op_array, const zend_op *opline) +{ + int idx; + + TRACE_START(ZEND_JIT_TRACE_START, event, op_array, opline); + memmove(trace_buffer + idx, trace_buffer + start, (end - start) * sizeof(zend_jit_trace_rec)); + return idx + (end - start); +} + /* * Trace Linking Rules * =================== @@ -579,6 +553,7 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, #endif const zend_op *orig_opline, *end_opline; zend_jit_trace_stop stop = ZEND_JIT_TRACE_STOP_ERROR; + zend_jit_trace_stop halt = 0; int level = 0; int ret_level = 0; int call_level; @@ -589,10 +564,15 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, int idx, count; uint8_t trace_flags, op1_type, op2_type, op3_type; zend_class_entry *ce1, *ce2; + const zend_op *link_to_enter_opline = NULL; + int backtrack_link_to_enter = -1; int backtrack_recursion = -1; int backtrack_ret_recursion = -1; int backtrack_ret_recursion_level = 0; int loop_unroll_limit = 0; + int last_loop = -1; + int last_loop_level = -1; + const zend_op *last_loop_opline = NULL; uint32_t megamorphic = 0; const zend_op_array *unrolled_calls[ZEND_JIT_TRACE_MAX_CALL_DEPTH + ZEND_JIT_TRACE_MAX_RET_DEPTH]; #ifdef HAVE_GCC_GLOBAL_REGS @@ -762,7 +742,9 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, #ifdef HAVE_GCC_GLOBAL_REGS handler(); if (UNEXPECTED(opline == zend_jit_halt_op)) { - stop = ZEND_JIT_TRACE_STOP_RETURN_HALT; + stop = ZEND_JIT_TRACE_STOP_RETURN; + opline = NULL; + halt = ZEND_JIT_TRACE_HALT; break; } if (UNEXPECTED(execute_data != prev_execute_data)) { @@ -770,7 +752,9 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, rc = handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); if (rc != 0) { if (rc < 0) { - stop = ZEND_JIT_TRACE_STOP_RETURN_HALT; + stop = ZEND_JIT_TRACE_STOP_RETURN; + opline = NULL; + halt = ZEND_JIT_TRACE_HALT; break; } else if (execute_data == EG(current_execute_data)) { /* return after interrupt handler */ @@ -783,8 +767,9 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, op_array = &EX(func)->op_array; jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); - if (UNEXPECTED(!jit_extension)) { - stop = ZEND_JIT_TRACE_STOP_BAD_FUNC; + if (UNEXPECTED(!jit_extension) + || UNEXPECTED(!(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE))) { + stop = ZEND_JIT_TRACE_STOP_INTERPRETER; break; } offset = jit_extension->offset; @@ -862,6 +847,7 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, unrolled_calls[ret_level] = &EX(func)->op_array; ret_level++; + last_loop_opline = NULL; if (prev_call) { int ret = zend_jit_trace_record_fake_init_call(prev_call, trace_buffer, idx, 0, &megamorphic, ret_level + level); @@ -872,17 +858,28 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, idx = ret; } } else if (start & ZEND_JIT_TRACE_START_LOOP - && !zend_jit_trace_bad_loop_exit(orig_opline)) { + && zend_jit_trace_bad_stop_event(orig_opline, JIT_G(blacklist_root_trace) - 1) != + ZEND_JIT_TRACE_STOP_LOOP_EXIT) { /* Fail to try close the loop. If this doesn't work terminate it. */ stop = ZEND_JIT_TRACE_STOP_LOOP_EXIT; break; + } else if (start & ZEND_JIT_TRACE_START_ENTER + && EX(prev_execute_data) + && EX(func) == EX(prev_execute_data)->func + && zend_jit_trace_bad_stop_event(orig_opline, JIT_G(blacklist_root_trace) - 1) != + ZEND_JIT_TRACE_STOP_RECURSION_EXIT) { + stop = ZEND_JIT_TRACE_STOP_RECURSION_EXIT; + break; } else { stop = ZEND_JIT_TRACE_STOP_RETURN; break; } } else { level--; + if (level < last_loop_level) { + last_loop_opline = NULL; + } TRACE_RECORD(ZEND_JIT_TRACE_BACK, 0, op_array); } } @@ -915,7 +912,9 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, && (func->op_array.fn_flags & ZEND_ACC_CLOSURE)) { jit_extension = (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(&func->op_array); - if (UNEXPECTED(!jit_extension) || (func->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { + if (UNEXPECTED(!jit_extension) + || !(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE) + || (func->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { stop = ZEND_JIT_TRACE_STOP_INTERPRETER; break; } @@ -961,7 +960,8 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, if (trace_flags & ZEND_JIT_TRACE_START_LOOP) { if ((start & ZEND_JIT_TRACE_START_LOOP) != 0 && level + ret_level == 0 - && !zend_jit_trace_bad_compiled_loop(orig_opline)) { + && zend_jit_trace_bad_stop_event(orig_opline, JIT_G(blacklist_root_trace) - 1) != + ZEND_JIT_TRACE_STOP_COMPILED_LOOP) { /* Fail to try close outer loop through side exit. If this doesn't work just link. */ stop = ZEND_JIT_TRACE_STOP_COMPILED_LOOP; @@ -976,6 +976,10 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, stop = ZEND_JIT_TRACE_STOP_LINK; break; } + if (backtrack_link_to_enter < 0) { + backtrack_link_to_enter = idx; + link_to_enter_opline = opline; + } } else { stop = ZEND_JIT_TRACE_STOP_LINK; break; @@ -984,19 +988,44 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, stop = ZEND_JIT_TRACE_STOP_BLACK_LIST; break; } else if (trace_flags & ZEND_JIT_TRACE_START_LOOP) { + uint8_t bad_stop; + if (start != ZEND_JIT_TRACE_START_SIDE) { if (opline == orig_opline && level + ret_level == 0) { stop = ZEND_JIT_TRACE_STOP_LOOP; break; } - /* Fail to try creating a trace for inner loop first. - If this doesn't work try unroling loop. */ - if (!zend_jit_trace_bad_inner_loop(opline)) { - stop = ZEND_JIT_TRACE_STOP_INNER_LOOP; - break; + } + + if (start != ZEND_JIT_TRACE_START_SIDE + || level + ret_level != 0) { + /* First try creating a trace for inner loop. + If this doesn't work try loop unroling. */ + bad_stop = zend_jit_trace_bad_stop_event(opline, + JIT_G(blacklist_root_trace) / 2); + if (bad_stop != ZEND_JIT_TRACE_STOP_INNER_LOOP + && bad_stop != ZEND_JIT_TRACE_STOP_LOOP_EXIT) { + if (start == ZEND_JIT_TRACE_START_SIDE + || zend_jit_trace_bad_stop_event(orig_opline, + JIT_G(blacklist_root_trace) / 2) != ZEND_JIT_TRACE_STOP_INNER_LOOP) { + stop = ZEND_JIT_TRACE_STOP_INNER_LOOP; + break; + } } } - if (loop_unroll_limit < JIT_G(max_loops_unroll)) { + + if (opline == last_loop_opline + && level == last_loop_level) { + idx = zend_jit_trace_subtrace(trace_buffer, + last_loop, idx, ZEND_JIT_TRACE_START_LOOP, op_array, opline); + start = ZEND_JIT_TRACE_START_LOOP; + stop = ZEND_JIT_TRACE_STOP_LOOP; + ret_level = 0; + break; + } else if (loop_unroll_limit < JIT_G(max_loops_unroll)) { + last_loop = idx; + last_loop_opline = opline; + last_loop_level = level; loop_unroll_limit++; } else { stop = ZEND_JIT_TRACE_STOP_LOOP_UNROLL; @@ -1021,6 +1050,14 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, ret_level = backtrack_ret_recursion_level; stop = ZEND_JIT_TRACE_STOP_RECURSIVE_RET; end_opline = orig_opline; + } else if (backtrack_link_to_enter > 0) { + if (stop == ZEND_JIT_TRACE_STOP_DEEP_RECURSION + && zend_jit_trace_bad_stop_event(orig_opline, JIT_G(blacklist_root_trace) / 2) == + ZEND_JIT_TRACE_STOP_DEEP_RECURSION) { + idx = backtrack_link_to_enter; + stop = ZEND_JIT_TRACE_STOP_LINK; + end_opline = link_to_enter_opline; + } } } @@ -1035,8 +1072,7 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, TRACE_END(ZEND_JIT_TRACE_END, stop, end_opline); #ifdef HAVE_GCC_GLOBAL_REGS - if (stop != ZEND_JIT_TRACE_STOP_HALT - && stop != ZEND_JIT_TRACE_STOP_RETURN_HALT) { + if (!halt) { EX(opline) = opline; } #endif @@ -1046,5 +1082,5 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, opline = save_opline; #endif - return stop; + return stop | halt; } diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index c689359272ede..fd04435818516 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -1485,7 +1485,7 @@ static void* dasm_labels[zend_lb_MAX]; || } |.endmacro -|.macro EFREE_REG_24 +|.macro EFREE_REG_REFERENCE ||#if ZEND_DEBUG | xor FCARG2a, FCARG2a // filename | .if X64WIN @@ -1508,16 +1508,16 @@ static void* dasm_labels[zend_lb_MAX]; | .endif ||#else ||#ifdef HAVE_BUILTIN_CONSTANT_P -| EXT_CALL _efree_24, r0 +| EXT_CALL _efree_32, r0 ||#else | EXT_CALL _efree, r0 ||#endif ||#endif |.endmacro -|.macro EFREE_24, ptr +|.macro EFREE_REFERENCE, ptr | mov FCARG1a, ptr -| EFREE_REG_24 +| EFREE_REG_REFERENCE |.endmacro |.macro EMALLOC, size, op_array, opline @@ -1545,8 +1545,8 @@ static void* dasm_labels[zend_lb_MAX]; | .endif ||#else ||#ifdef HAVE_BUILTIN_CONSTANT_P -|| if (size == 24) { -| EXT_CALL _emalloc_24, r0 +|| if (size > 24 && size <= 32) { +| EXT_CALL _emalloc_32, r0 || } else { | mov FCARG1a, size | EXT_CALL _emalloc, r0 @@ -3532,7 +3532,6 @@ static int zend_jit_trace_handler(dasm_State **Dst, const zend_op_array *op_arra } if (trace->op != ZEND_JIT_TRACE_END || (trace->stop != ZEND_JIT_TRACE_STOP_RETURN && - trace->stop != ZEND_JIT_TRACE_STOP_RETURN_HALT && trace->stop != ZEND_JIT_TRACE_STOP_INTERPRETER)) { const zend_op *next_opline = trace->opline; @@ -5781,7 +5780,7 @@ static int zend_jit_simple_assign(dasm_State **Dst, if (save_r1) { | mov aword T1, FCARG1a // save } - | EFREE_24 aword [Ra(Z_REG(val_addr))+Z_OFFSET(val_addr)] + | EFREE_REFERENCE aword [Ra(Z_REG(val_addr))+Z_OFFSET(val_addr)] if (save_r1) { | mov FCARG1a, aword T1 // restore } @@ -9092,6 +9091,7 @@ static int zend_jit_init_method_call(dasm_State **Dst, | ZVAL_DEREF FCARG1a, op1_info op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 0); } else { + /* Hack: Convert reference to regular value to simplify JIT code */ ZEND_ASSERT(Z_REG(op1_addr) == ZREG_FP); | IF_NOT_ZVAL_TYPE op1_addr, IS_REFERENCE, >1 | LOAD_ZVAL_ADDR FCARG1a, op1_addr @@ -9178,12 +9178,12 @@ static int zend_jit_init_method_call(dasm_State **Dst, } else { | EXT_CALL zend_jit_find_method_helper, r0 } - | test r0, r0 - | jz ->exception_handler |.if not(X64) | add r4, 12 |.endif - | jmp >2 + | test r0, r0 + | jnz >2 + | jmp ->exception_handler |.code |2: @@ -10136,13 +10136,16 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, const zend |2: | // ZVAL_NEW_REF(arg, varptr); if (opline->op1_type == IS_VAR) { + if (Z_REG(op1_addr) != ZREG_R0 || Z_OFFSET(op1_addr) != 0) { + | LOAD_ZVAL_ADDR r0, op1_addr + } | mov aword T1, r0 // save } | EMALLOC sizeof(zend_reference), op_array, opline | mov dword [r0], 2 | mov dword [r0 + offsetof(zend_reference, gc.u.type_info)], GC_REFERENCE | mov aword [r0 + offsetof(zend_reference, sources.ptr)], 0 - ref_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 8); + ref_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, offsetof(zend_reference, val)); if (opline->op1_type == IS_VAR) { zend_jit_addr val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R1, 0); @@ -10363,7 +10366,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend | GC_ADDREF r2 | jmp >2 |1: - | EFREE_REG_24 + | EFREE_REG_REFERENCE | jmp >2 |.code | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2 @@ -11234,7 +11237,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o | jmp >9 } |2: - | EFREE_24 r0 + | EFREE_REFERENCE r0 if (jit_return_label >= 0) { | jmp =>jit_return_label } else { @@ -11294,7 +11297,6 @@ static zend_bool zend_jit_may_avoid_refcounting(const zend_op *opline) switch (opline->opcode) { case ZEND_FETCH_OBJ_FUNC_ARG: if (!JIT_G(current_frame) || - !JIT_G(current_frame) || !JIT_G(current_frame)->call->func || !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) { return 0; @@ -11310,7 +11312,6 @@ static zend_bool zend_jit_may_avoid_refcounting(const zend_op *opline) break; case ZEND_FETCH_DIM_FUNC_ARG: if (!JIT_G(current_frame) || - !JIT_G(current_frame) || !JIT_G(current_frame)->call->func || !TRACE_FRAME_IS_LAST_SEND_BY_VAL(JIT_G(current_frame)->call)) { return 0; @@ -14704,10 +14705,17 @@ static zend_bool zend_jit_fetch_reference(dasm_State **Dst, const zend_op *oplin if (add_ref_guard) { | IF_NOT_ZVAL_TYPE var_addr, IS_REFERENCE, &exit_addr } - | GET_ZVAL_PTR FCARG1a, var_addr - - var_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, offsetof(zend_reference, val)); - *var_addr_ptr = var_addr; + if (opline->opcode == ZEND_INIT_METHOD_CALL && opline->op1_type == IS_VAR) { + /* Hack: Convert reference to regular value to simplify JIT code for INIT_METHOD_CALL */ + if (Z_REG(var_addr) != ZREG_FCARG1a || Z_OFFSET(var_addr) != 0) { + | LOAD_ZVAL_ADDR FCARG1a, var_addr + } + | EXT_CALL zend_jit_unref_helper, r0 + } else { + | GET_ZVAL_PTR FCARG1a, var_addr + var_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, offsetof(zend_reference, val)); + *var_addr_ptr = var_addr; + } if (var_type != IS_UNKNOWN) { var_type &= ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT|IS_TRACE_PACKED); diff --git a/ext/opcache/opcache.stub.php b/ext/opcache/opcache.stub.php index 0290b6453de4c..34cc789717157 100644 --- a/ext/opcache/opcache.stub.php +++ b/ext/opcache/opcache.stub.php @@ -4,12 +4,12 @@ function opcache_reset(): bool {} -function opcache_get_status(bool $fetch_scripts = true): array|false {} +function opcache_get_status(bool $include_scripts = true): array|false {} -function opcache_compile_file(string $file): bool {} +function opcache_compile_file(string $filename): bool {} -function opcache_invalidate(string $script, bool $force = false): bool {} +function opcache_invalidate(string $filename, bool $force = false): bool {} function opcache_get_configuration(): array|false {} -function opcache_is_script_cached(string $script): bool {} +function opcache_is_script_cached(string $filename): bool {} diff --git a/ext/opcache/opcache_arginfo.h b/ext/opcache/opcache_arginfo.h index 82ca83fd81f06..5085255a0f15f 100644 --- a/ext/opcache/opcache_arginfo.h +++ b/ext/opcache/opcache_arginfo.h @@ -1,28 +1,26 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 64f07c411732f60fed22267ee5e702a37e399879 */ + * Stub hash: 06a37b4af6a0fb5d7bd24b1660ea8ce09e959ec8 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_reset, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_opcache_get_status, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_scripts, _IS_BOOL, 0, "true") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, include_scripts, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_compile_file, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_invalidate, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, script, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, force, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_opcache_get_configuration, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_is_script_cached, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, script, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_opcache_is_script_cached arginfo_opcache_compile_file ZEND_FUNCTION(opcache_reset); diff --git a/ext/opcache/tests/bug71127.phpt b/ext/opcache/tests/bug71127.phpt index 0c606097fead9..cc8886fc27aac 100644 --- a/ext/opcache/tests/bug71127.phpt +++ b/ext/opcache/tests/bug71127.phpt @@ -21,5 +21,5 @@ include($file); @unlink(__DIR__ . "/bug71127.inc"); ?> --EXPECTF-- -Notice: Constant FOO already defined in %sbug71127.inc on line %d +Warning: Constant FOO already defined in %sbug71127.inc on line %d okey diff --git a/ext/opcache/tests/jit/method_call_001.phpt b/ext/opcache/tests/jit/method_call_001.phpt new file mode 100644 index 0000000000000..2d96d359e0724 --- /dev/null +++ b/ext/opcache/tests/jit/method_call_001.phpt @@ -0,0 +1,35 @@ +--TEST-- +JIT METHOD_CALL: 001 +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--SKIPIF-- + +--FILE-- +bar(); + } + static function loop() { + for ($i = 0; $i < 10; $i++) { + self::foo(); + } + echo "ok\n"; + } +} +class B { + function bar() { + } +} +A::$o = new B; +A::loop(); +?> +--EXPECT-- +ok diff --git a/ext/opcache/tests/jit/send_ref_001.phpt b/ext/opcache/tests/jit/send_ref_001.phpt new file mode 100644 index 0000000000000..55a2359038bb4 --- /dev/null +++ b/ext/opcache/tests/jit/send_ref_001.phpt @@ -0,0 +1,26 @@ +--TEST-- +JIT SEND_REF: 001 +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--SKIPIF-- + +--FILE-- +foo(); +?> +--EXPECT-- +ok diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 9fa91e83797ce..161396f4941e2 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -6929,11 +6929,6 @@ static int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_ { char *iv_new; - /* Best case scenario, user behaved */ - if (*piv_len == iv_required_len) { - return SUCCESS; - } - if (mode->is_aead) { if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) { php_error_docref(NULL, E_WARNING, "Setting of IV length for AEAD mode failed"); @@ -6942,6 +6937,11 @@ static int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_ return SUCCESS; } + /* Best case scenario, user behaved */ + if (*piv_len == iv_required_len) { + return SUCCESS; + } + iv_new = ecalloc(1, iv_required_len + 1); if (*piv_len == 0) { diff --git a/ext/openssl/openssl.stub.php b/ext/openssl/openssl.stub.php index 21bc936b08fa2..e77f4e4043a78 100644 --- a/ext/openssl/openssl.stub.php +++ b/ext/openssl/openssl.stub.php @@ -19,7 +19,7 @@ function openssl_x509_export_to_file(OpenSSLCertificate|string $certificate, str /** @param string $output */ function openssl_x509_export(OpenSSLCertificate|string $certificate, &$output, bool $no_text = true): bool {} -function openssl_x509_fingerprint(OpenSSLCertificate|string $certificate, string $digest_algorithm = "sha1", bool $raw_output = false): string|false {} +function openssl_x509_fingerprint(OpenSSLCertificate|string $certificate, string $digest_algo = "sha1", bool $binary = false): string|false {} /** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */ function openssl_x509_check_private_key(OpenSSLCertificate|string $certificate, $private_key): bool {} @@ -103,12 +103,12 @@ function openssl_get_privatekey($private_key, ?string $passphrase = null): OpenS function openssl_pkey_get_details(OpenSSLAsymmetricKey $key): array|false {} -function openssl_pbkdf2(string $passphrase, string $salt, int $key_length, int $iterations, string $digest_algorithm = "sha1"): string|false {} +function openssl_pbkdf2(string $password, string $salt, int $key_length, int $iterations, string $digest_algo = "sha1"): string|false {} function openssl_pkcs7_verify(string $input_filename, int $flags, ?string $signers_certificates_filename = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $output_filename = null): bool|int {} /** @param OpenSSLCertificate|array|string $certificate */ -function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algorithm = OPENSSL_CIPHER_RC2_40): bool {} +function openssl_pkcs7_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $cipher_algo = OPENSSL_CIPHER_RC2_40): bool {} /** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */ function openssl_pkcs7_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = PKCS7_DETACHED, ?string $untrusted_certificates_filename = null): bool {} @@ -125,7 +125,7 @@ function openssl_pkcs7_read(string $input_filename, &$certificates): bool {} function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates = null, array $ca_info = [], ?string $untrusted_certificates_filename = null, ?string $content = null, ?string $pk7 = null, ?string $sigfile = null, int $encoding = OPENSSL_ENCODING_SMIME): bool {} /** @param OpenSSLCertificate|array|string $certificate */ -function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algorithm = OPENSSL_CIPHER_RC2_40): bool {} +function openssl_cms_encrypt(string $input_filename, string $output_filename, $certificate, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, int $cipher_algo = OPENSSL_CIPHER_RC2_40): bool {} /** @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */ function openssl_cms_sign(string $input_filename, string $output_filename, OpenSSLCertificate|string $certificate, $private_key, ?array $headers, int $flags = 0, int $encoding = OPENSSL_ENCODING_SMIME, ?string $untrusted_certificates_filename = null): bool {} @@ -179,13 +179,13 @@ function openssl_verify(string $data, string $signature, $public_key, string|int * @param array $encrypted_keys * @param string $iv */ -function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $public_key, string $cipher_algorithm, &$iv = null): int|false {} +function openssl_seal(string $data, &$sealed_data, &$encrypted_keys, array $public_key, string $cipher_algo, &$iv = null): int|false {} /** * @param string $output * @param OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key */ -function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algorithm, ?string $iv = null): bool {} +function openssl_open(string $data, &$output, string $encrypted_key, $private_key, string $cipher_algo, ?string $iv = null): bool {} function openssl_get_md_methods(bool $aliases = false): array {} @@ -195,14 +195,14 @@ function openssl_get_cipher_methods(bool $aliases = false): array {} function openssl_get_curve_names(): array|false {} #endif -function openssl_digest(string $data, string $digest_algorithm, bool $raw_output = false): string|false {} +function openssl_digest(string $data, string $digest_algo, bool $binary = false): string|false {} /** @param string $tag */ -function openssl_encrypt(string $data, string $cipher_algorithm, string $passphrase, int $options = 0, string $iv = "", &$tag = null, string $aad = "", int $tag_length = 16): string|false {} +function openssl_encrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", &$tag = null, string $aad = "", int $tag_length = 16): string|false {} -function openssl_decrypt(string $data, string $cipher_algorithm, string $passphrase, int $options = 0, string $iv = "", string $tag = "", string $aad = ""): string|false {} +function openssl_decrypt(string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", string $tag = "", string $aad = ""): string|false {} -function openssl_cipher_iv_length(string $cipher_algorithm): int|false {} +function openssl_cipher_iv_length(string $cipher_algo): int|false {} function openssl_dh_compute_key(string $public_key, OpenSSLAsymmetricKey $private_key): string|false {} @@ -215,7 +215,7 @@ function openssl_pkey_derive($public_key, $private_key, int $key_length = 0): st /** @param bool $strong_result */ function openssl_random_pseudo_bytes(int $length, &$strong_result = null): string {} -function openssl_spki_new(OpenSSLAsymmetricKey $private_key, string $challenge, int $digest_algorithm = OPENSSL_ALGO_MD5): string|false {} +function openssl_spki_new(OpenSSLAsymmetricKey $private_key, string $challenge, int $digest_algo = OPENSSL_ALGO_MD5): string|false {} function openssl_spki_verify(string $spki): bool {} diff --git a/ext/openssl/openssl_arginfo.h b/ext/openssl/openssl_arginfo.h index 7700cba8e5480..1e30d9c2c172f 100644 --- a/ext/openssl/openssl_arginfo.h +++ b/ext/openssl/openssl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 40f9897413f966bd483d8f133f6fa3b80910e3d5 */ + * Stub hash: d4f73f86e6f16a74ab5b60bb79c4a9f29e9bc4fb */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL) @@ -15,8 +15,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_x509_fingerprint, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algorithm, IS_STRING, 0, "\"sha1\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algo, IS_STRING, 0, "\"sha1\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_check_private_key, 0, 2, _IS_BOOL, 0) @@ -151,11 +151,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pkey_get_details, 0, 1, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pbkdf2, 0, 4, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, key_length, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algorithm, IS_STRING, 0, "\"sha1\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algo, IS_STRING, 0, "\"sha1\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pkcs7_verify, 0, 2, MAY_BE_BOOL|MAY_BE_LONG) @@ -174,7 +174,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_encrypt, 0, 4, _IS ZEND_ARG_INFO(0, certificate) ZEND_ARG_TYPE_INFO(0, headers, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cipher_algorithm, IS_LONG, 0, "OPENSSL_CIPHER_RC2_40") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cipher_algo, IS_LONG, 0, "OPENSSL_CIPHER_RC2_40") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_sign, 0, 5, _IS_BOOL, 0) @@ -218,7 +218,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_encrypt, 0, 4, _IS_B ZEND_ARG_TYPE_INFO(0, headers, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cipher_algorithm, IS_LONG, 0, "OPENSSL_CIPHER_RC2_40") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cipher_algo, IS_LONG, 0, "OPENSSL_CIPHER_RC2_40") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_sign, 0, 5, _IS_BOOL, 0) @@ -292,7 +292,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_seal, 0, 5, MAY_BE_LONG| ZEND_ARG_INFO(1, sealed_data) ZEND_ARG_INFO(1, encrypted_keys) ZEND_ARG_TYPE_INFO(0, public_key, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, cipher_algorithm, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, iv, "null") ZEND_END_ARG_INFO() @@ -301,7 +301,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_open, 0, 5, _IS_BOOL, 0) ZEND_ARG_INFO(1, output) ZEND_ARG_TYPE_INFO(0, encrypted_key, IS_STRING, 0) ZEND_ARG_INFO(0, private_key) - ZEND_ARG_TYPE_INFO(0, cipher_algorithm, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iv, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -318,13 +318,13 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_digest, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, digest_algorithm, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO(0, digest_algo, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_encrypt, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cipher_algorithm, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iv, IS_STRING, 0, "\"\"") @@ -335,7 +335,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_decrypt, 0, 3, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, cipher_algorithm, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iv, IS_STRING, 0, "\"\"") @@ -344,7 +344,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_decrypt, 0, 3, MAY_BE_ST ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_cipher_iv_length, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, cipher_algorithm, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_dh_compute_key, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) @@ -366,7 +366,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_spki_new, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_OBJ_INFO(0, private_key, OpenSSLAsymmetricKey, 0) ZEND_ARG_TYPE_INFO(0, challenge, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algorithm, IS_LONG, 0, "OPENSSL_ALGO_MD5") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algo, IS_LONG, 0, "OPENSSL_ALGO_MD5") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_spki_verify, 0, 1, _IS_BOOL, 0) diff --git a/ext/openssl/tests/cipher_tests.inc b/ext/openssl/tests/cipher_tests.inc index b1e46b411e54e..779bfa8515cbd 100644 --- a/ext/openssl/tests/cipher_tests.inc +++ b/ext/openssl/tests/cipher_tests.inc @@ -1,5 +1,26 @@ array( + array( + 'key' => '404142434445464748494a4b4c4d4e4f', + 'iv' => '1011121314151617', + 'aad' => '000102030405060708090a0b0c0d0e0f', + 'tag' => '1fc64fbfaccd', + 'pt' => '202122232425262728292a2b2c2d2e2f', + 'ct' => 'd2a1f0e051ea5f62081a7792073d593d', + ), + array( + 'key' => '404142434445464748494a4b4c4d4e4f', + 'iv' => '101112131415161718191a1b', + 'aad' => '000102030405060708090a0b0c0d0e0f' . + '10111213', + 'tag' => '484392fbc1b09951', + 'pt' => '202122232425262728292a2b2c2d2e2f' . + '3031323334353637', + 'ct' => 'e3b201a9f5b71a7a9b1ceaeccd97e70b' . + '6176aad9a4428aa5', + ), + ), 'aes-256-ccm' => array( array( 'key' => '1bde3251d41a8b5ea013c195ae128b21' . diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt index 067cde083bf21..13ee520b79aa0 100644 --- a/ext/openssl/tests/openssl_decrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt @@ -10,14 +10,16 @@ if (!in_array('aes-256-ccm', openssl_get_cipher_methods())) --FILE-- $test) { - echo "TEST $idx\n"; - $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $test['tag'], $test['aad']); - var_dump($test['pt'] === $pt); +foreach ($methods as $method) { + $tests = openssl_get_cipher_tests($method); + foreach ($tests as $idx => $test) { + echo "$method - TEST $idx\n"; + $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, + $test['iv'], $test['tag'], $test['aad']); + var_dump($test['pt'] === $pt); + } } // no IV @@ -32,7 +34,11 @@ var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, ?> --EXPECTF-- -TEST 0 +aes-128-ccm - TEST 0 +bool(true) +aes-128-ccm - TEST 1 +bool(true) +aes-256-ccm - TEST 0 bool(true) Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d diff --git a/ext/openssl/tests/openssl_encrypt_ccm.phpt b/ext/openssl/tests/openssl_encrypt_ccm.phpt index fb5dbbc849d06..8c4c41f81870c 100644 --- a/ext/openssl/tests/openssl_encrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_encrypt_ccm.phpt @@ -10,15 +10,17 @@ if (!in_array('aes-256-ccm', openssl_get_cipher_methods())) --FILE-- $test) { - echo "TEST $idx\n"; - $ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $tag, $test['aad'], strlen($test['tag'])); - var_dump($test['ct'] === $ct); - var_dump($test['tag'] === $tag); +foreach ($methods as $method) { + $tests = openssl_get_cipher_tests($method); + foreach ($tests as $idx => $test) { + echo "$method - TEST $idx\n"; + $ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA, + $test['iv'], $tag, $test['aad'], strlen($test['tag'])); + var_dump($test['ct'] === $ct); + var_dump($test['tag'] === $tag); + } } // Empty IV error @@ -32,7 +34,13 @@ var_dump(strlen($tag)); var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 16), $tag, '', 1024)); ?> --EXPECTF-- -TEST 0 +aes-128-ccm - TEST 0 +bool(true) +bool(true) +aes-128-ccm - TEST 1 +bool(true) +bool(true) +aes-256-ccm - TEST 0 bool(true) bool(true) diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c index 8e51576ac68de..61aa019d10124 100644 --- a/ext/pcre/pcre2lib/pcre2_jit_compile.c +++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c @@ -7594,25 +7594,43 @@ if (needstype || needsscript) } cc = ccbegin; - } - if (needschar) - OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); + if (needstype) + { + /* TMP2 has already been shifted by 2 */ + if (!needschar) + { + OP2(SLJIT_ADD, TMP1, 0, TMP2, 0, TMP2, 0); + OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); + + OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); + } + else + { + OP2(SLJIT_ADD, TMP1, 0, TMP2, 0, TMP2, 0); + OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); - if (needstype) + OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); + OP1(SLJIT_MOV_U8, RETURN_ADDR, 0, SLJIT_MEM1(TMP2), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); + typereg = RETURN_ADDR; + } + } + else if (needschar) + OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); + } + else if (needstype) { + OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 3); + OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2); + if (!needschar) { - OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 3); - OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 2); OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0); OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype)); } else { - OP2(SLJIT_SHL, TMP1, 0, TMP2, 0, SLJIT_IMM, 2); - OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3); OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0); OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); @@ -7620,6 +7638,8 @@ if (needstype || needsscript) typereg = RETURN_ADDR; } } + else if (needschar) + OP1(SLJIT_MOV, TMP1, 0, RETURN_ADDR, 0); } #endif /* SUPPORT_UNICODE */ diff --git a/ext/pcre/tests/bug80118.phpt b/ext/pcre/tests/bug80118.phpt new file mode 100644 index 0000000000000..5de66076e0437 --- /dev/null +++ b/ext/pcre/tests/bug80118.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #80118 (Erroneous whitespace match with JIT only) +--FILE-- + +--EXPECT-- +array(0) { +} diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 780de94707b1e..2e81db2bbf52d 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -34,7 +34,7 @@ #include "zend_interfaces.h" #include "pdo_dbh_arginfo.h" -static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value); +static zend_result pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value); void pdo_throw_exception(unsigned int driver_errcode, char *driver_errmsg, pdo_error_type *pdo_error) { @@ -405,6 +405,7 @@ PHP_METHOD(PDO, __construct) continue; } ZVAL_DEREF(attr_value); + /* TODO: Check that this doesn't fail? */ pdo_dbh_attribute_set(dbh, long_key, attr_value); } ZEND_HASH_FOREACH_END(); } @@ -425,17 +426,18 @@ PHP_METHOD(PDO, __construct) static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args) /* {{{ */ { if (!Z_ISUNDEF_P(ctor_args)) { - if (Z_TYPE_P(ctor_args) != IS_ARRAY) { - pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array"); - return NULL; - } + /* This implies an error within PDO if this does not hold */ + ZEND_ASSERT(Z_TYPE_P(ctor_args) == IS_ARRAY); if (!dbstmt_ce->constructor) { - pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments"); + zend_throw_error(NULL, "User-supplied statement does not accept constructor arguments"); return NULL; } } if (UNEXPECTED(object_init_ex(object, dbstmt_ce) != SUCCESS)) { + if (EXPECTED(!EG(exception))) { + zend_throw_error(NULL, "Cannot instantiate user-supplied statement class"); + } return NULL; } @@ -487,7 +489,7 @@ PHP_METHOD(PDO, prepare) pdo_stmt_t *stmt; char *statement; size_t statement_len; - zval *options = NULL, *opt, *item, ctor_args; + zval *options = NULL, *value, *item, ctor_args; zend_class_entry *dbstmt_ce, *pce; pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS); pdo_dbh_t *dbh = dbh_obj->inner; @@ -498,42 +500,44 @@ PHP_METHOD(PDO, prepare) Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); - PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; - if (ZEND_NUM_ARGS() > 1 && (opt = zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS)) != NULL) { - if (Z_TYPE_P(opt) != IS_ARRAY || (item = zend_hash_index_find(Z_ARRVAL_P(opt), 0)) == NULL - || Z_TYPE_P(item) != IS_STRING - || (pce = zend_lookup_class(Z_STR_P(item))) == NULL - ) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); " - "the classname must be a string specifying an existing class" - ); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; + if (statement_len == 0) { + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); + } + + PDO_DBH_CLEAR_ERR(); + + if (options && (value = zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS)) != NULL) { + if (Z_TYPE_P(value) != IS_ARRAY) { + zend_type_error("PDO::ATTR_STATEMENT_CLASS value must be of type array, %s given", + zend_zval_type_name(value)); + RETURN_THROWS(); + } + if ((item = zend_hash_index_find(Z_ARRVAL_P(value), 0)) == NULL) { + zend_value_error("PDO::ATTR_STATEMENT_CLASS value must be an array with the format " + "array(classname, array(ctor_args))"); + RETURN_THROWS(); + } + if (Z_TYPE_P(item) != IS_STRING || (pce = zend_lookup_class(Z_STR_P(item))) == NULL) { + zend_type_error("PDO::ATTR_STATEMENT_CLASS class must be a valid class"); + RETURN_THROWS(); } dbstmt_ce = pce; if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce)) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class must be derived from PDOStatement"); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; + zend_type_error("PDO::ATTR_STATEMENT_CLASS class must be derived from PDOStatement"); + RETURN_THROWS(); } if (dbstmt_ce->constructor && !(dbstmt_ce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class cannot have a public constructor"); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; + zend_type_error("User-supplied statement class cannot have a public constructor"); + RETURN_THROWS(); } - if ((item = zend_hash_index_find(Z_ARRVAL_P(opt), 1)) != NULL) { + if ((item = zend_hash_index_find(Z_ARRVAL_P(value), 1)) != NULL) { if (Z_TYPE_P(item) != IS_ARRAY) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO::ATTR_STATEMENT_CLASS requires format array(classname, ctor_args); " - "ctor_args must be an array" - ); - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; + zend_type_error("PDO::ATTR_STATEMENT_CLASS ctor_args must be of type ?array, %s given", + zend_zval_type_name(value)); + RETURN_THROWS(); } ZVAL_COPY_VALUE(&ctor_args, item); } else { @@ -545,13 +549,7 @@ PHP_METHOD(PDO, prepare) } if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, &ctor_args)) { - if (EXPECTED(!EG(exception))) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "failed to instantiate user-supplied statement class" - ); - } - PDO_HANDLE_DBH_ERR(); - RETURN_FALSE; + RETURN_THROWS(); } stmt = Z_PDO_STMT_P(return_value); @@ -675,14 +673,14 @@ PHP_METHOD(PDO, inTransaction) } /* }}} */ -static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* {{{ */ +static zend_result pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* {{{ */ { zend_long lval; +/* TODO: Make distinction between numeric and non-numeric strings */ #define PDO_LONG_PARAM_CHECK \ if (Z_TYPE_P(value) != IS_LONG && Z_TYPE_P(value) != IS_STRING && Z_TYPE_P(value) != IS_FALSE && Z_TYPE_P(value) != IS_TRUE) { \ - pdo_raise_impl_error(dbh, NULL, "HY000", "attribute value must be an integer"); \ - PDO_HANDLE_DBH_ERR(); \ + zend_type_error("Attribute value must be of type int for selected attribute, %s given", zend_zval_type_name(value)); \ return FAILURE; \ } \ @@ -697,8 +695,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* dbh->error_mode = lval; return SUCCESS; default: - pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode"); - PDO_HANDLE_DBH_ERR(); + zend_value_error("Error mode must be one of the PDO::ERRMODE_* constants"); return FAILURE; } return FAILURE; @@ -713,8 +710,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* dbh->desired_case = lval; return SUCCESS; default: - pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode"); - PDO_HANDLE_DBH_ERR(); + zend_value_error("Case folding mode must be one of the PDO::CASE_* constants"); return FAILURE; } return FAILURE; @@ -729,7 +725,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* zval *tmp; if ((tmp = zend_hash_index_find(Z_ARRVAL_P(value), 0)) != NULL && Z_TYPE_P(tmp) == IS_LONG) { if (Z_LVAL_P(tmp) == PDO_FETCH_INTO || Z_LVAL_P(tmp) == PDO_FETCH_CLASS) { - pdo_raise_impl_error(dbh, NULL, "HY000", "FETCH_INTO and FETCH_CLASS are not yet supported as default fetch modes"); + zend_value_error("PDO::FETCH_INTO and PDO::FETCH_CLASS cannot be set as the default fetch mode"); return FAILURE; } } @@ -738,7 +734,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* } lval = zval_get_long(value); if (lval == PDO_FETCH_USE_DEFAULT) { - pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type"); + zend_value_error("Fetch mode must be a bitmask of PDO::FETCH_* constants"); return FAILURE; } dbh->default_fetch_type = lval; @@ -755,34 +751,33 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* zval *item; if (dbh->is_persistent) { + /* TODO: ValueError/ PDOException? */ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO::ATTR_STATEMENT_CLASS cannot be used with persistent PDO instances" ); PDO_HANDLE_DBH_ERR(); return FAILURE; } - if (Z_TYPE_P(value) != IS_ARRAY - || (item = zend_hash_index_find(Z_ARRVAL_P(value), 0)) == NULL - || Z_TYPE_P(item) != IS_STRING - || (pce = zend_lookup_class(Z_STR_P(item))) == NULL - ) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); " - "the classname must be a string specifying an existing class" - ); - PDO_HANDLE_DBH_ERR(); + if (Z_TYPE_P(value) != IS_ARRAY) { + zend_type_error("PDO::ATTR_STATEMENT_CLASS value must be of type array, %s given", + zend_zval_type_name(value)); + return FAILURE; + } + if ((item = zend_hash_index_find(Z_ARRVAL_P(value), 0)) == NULL) { + zend_value_error("PDO::ATTR_STATEMENT_CLASS value must be an array with the format " + "array(classname, array(ctor_args))"); + return FAILURE; + } + if (Z_TYPE_P(item) != IS_STRING || (pce = zend_lookup_class(Z_STR_P(item))) == NULL) { + zend_type_error("PDO::ATTR_STATEMENT_CLASS class must be a valid class"); return FAILURE; } if (!instanceof_function(pce, pdo_dbstmt_ce)) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class must be derived from PDOStatement"); - PDO_HANDLE_DBH_ERR(); + zend_type_error("PDO::ATTR_STATEMENT_CLASS class must be derived from PDOStatement"); return FAILURE; } if (pce->constructor && !(pce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "user-supplied statement class cannot have a public constructor"); - PDO_HANDLE_DBH_ERR(); + zend_type_error("User-supplied statement class cannot have a public constructor"); return FAILURE; } dbh->def_stmt_ce = pce; @@ -792,11 +787,8 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* } if ((item = zend_hash_index_find(Z_ARRVAL_P(value), 1)) != NULL) { if (Z_TYPE_P(item) != IS_ARRAY) { - pdo_raise_impl_error(dbh, NULL, "HY000", - "PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); " - "ctor_args must be an array" - ); - PDO_HANDLE_DBH_ERR(); + zend_type_error("PDO::ATTR_STATEMENT_CLASS ctor_args must be of type ?array, %s given", + zend_zval_type_name(value)); return FAILURE; } ZVAL_COPY(&dbh->def_stmt_ctor_args, item); @@ -927,10 +919,11 @@ PHP_METHOD(PDO, exec) Z_PARAM_STRING(statement, statement_len) ZEND_PARSE_PARAMETERS_END(); - if (!statement_len) { - pdo_raise_impl_error(dbh, NULL, "HY000", "trying to execute an empty query"); - RETURN_FALSE; + if (statement_len == 0) { + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); } + PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; ret = dbh->methods->doer(dbh, statement, statement_len); @@ -955,8 +948,10 @@ PHP_METHOD(PDO, lastInsertId) Z_PARAM_STRING_OR_NULL(name, namelen) ZEND_PARSE_PARAMETERS_END(); - PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; + + PDO_DBH_CLEAR_ERR(); + if (!dbh->methods->last_id) { pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()"); RETURN_FALSE; @@ -1060,18 +1055,22 @@ PHP_METHOD(PDO, query) pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS); pdo_dbh_t *dbh = dbh_obj->inner; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l!*", &statement, &statement_len, &fetch_mode, &fetch_mode_is_null, &args, &num_args)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l!*", &statement, &statement_len, + &fetch_mode, &fetch_mode_is_null, &args, &num_args)) { RETURN_THROWS(); } - PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; + if (statement_len == 0) { + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); + } + + PDO_DBH_CLEAR_ERR(); + if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args)) { - if (EXPECTED(!EG(exception))) { - pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class"); - } - return; + RETURN_THROWS(); } stmt = Z_PDO_STMT_P(return_value); @@ -1090,8 +1089,7 @@ PHP_METHOD(PDO, query) if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL)) { PDO_STMT_CLEAR_ERR(); - if (fetch_mode_is_null || SUCCESS == pdo_stmt_setup_fetch_mode(stmt, fetch_mode, args, num_args)) { - + if (fetch_mode_is_null || pdo_stmt_setup_fetch_mode(stmt, fetch_mode, 2, args, num_args)) { /* now execute the statement */ PDO_STMT_CLEAR_ERR(); if (stmt->methods->executer(stmt)) { @@ -1139,8 +1137,9 @@ PHP_METHOD(PDO, quote) Z_PARAM_LONG(paramtype) ZEND_PARSE_PARAMETERS_END(); - PDO_DBH_CLEAR_ERR(); PDO_CONSTRUCT_CHECK; + + PDO_DBH_CLEAR_ERR(); if (!dbh->methods->quoter) { pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting"); RETURN_FALSE; diff --git a/ext/pdo/pdo_dbh.stub.php b/ext/pdo/pdo_dbh.stub.php index 2348abf048d86..a30d89890c330 100644 --- a/ext/pdo/pdo_dbh.stub.php +++ b/ext/pdo/pdo_dbh.stub.php @@ -4,7 +4,7 @@ class PDO { - public function __construct(string $dsn, ?string $username = null, ?string $passwd = null, ?array $options = null) {} + public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null) {} /** @return bool */ public function beginTransaction() {} @@ -34,13 +34,13 @@ public function inTransaction() {} public function lastInsertId(?string $name = null) {} /** @return PDOStatement|false */ - public function prepare(string $statement, array $driver_options = []) {} + public function prepare(string $query, array $driver_options = []) {} /** @return PDOStatement|false */ - public function query(string $statement, ?int $fetch_mode = null, mixed ...$fetch_mode_args) {} + public function query(string $query, ?int $fetch_mode = null, mixed ...$fetch_mode_args) {} /** @return string|false */ - public function quote(string $string, int $parameter_type = PDO::PARAM_STR) {} + public function quote(string $string, int $type = PDO::PARAM_STR) {} /** @return bool */ public function rollBack() {} diff --git a/ext/pdo/pdo_dbh_arginfo.h b/ext/pdo/pdo_dbh_arginfo.h index a3ab1994ed67d..ffeb1c9eeb01a 100644 --- a/ext/pdo/pdo_dbh_arginfo.h +++ b/ext/pdo/pdo_dbh_arginfo.h @@ -1,10 +1,10 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0c7acc78768ad1fb77a09a24ebd4d4e660b350c9 */ + * Stub hash: 2bee02a9952faf3f768873bafe1be9ef89086029 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, passwd, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, password, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() @@ -34,19 +34,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_lastInsertId, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_prepare, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driver_options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_query, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, statement, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_mode, IS_LONG, 1, "null") ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_mode_args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO_quote, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, parameter_type, IS_LONG, 0, "PDO::PARAM_STR") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR") ZEND_END_ARG_INFO() #define arginfo_class_PDO_rollBack arginfo_class_PDO_beginTransaction diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index b0f7bbeede813..3222a617f07e9 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -34,13 +34,14 @@ #include "php_memory_streams.h" #include "pdo_stmt_arginfo.h" -#define PHP_STMT_GET_OBJ \ - pdo_stmt_t *stmt = Z_PDO_STMT_P(ZEND_THIS); \ - if (!stmt->dbh) { \ - RETURN_FALSE; \ - } \ +#define PHP_STMT_GET_OBJ \ + pdo_stmt_t *stmt = Z_PDO_STMT_P(ZEND_THIS); \ + if (!stmt->dbh) { \ + zend_throw_error(NULL, "PDO object is uninitialized"); \ + RETURN_THROWS(); \ + } \ -static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /* {{{ */ +static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /* {{{ */ { if (stmt->bound_param_map) { /* rewriting :name to ? style. @@ -62,6 +63,7 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa param->name = zend_string_init(name, strlen(name), 0); return 1; } + /* TODO Error? */ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined"); return 0; } @@ -72,12 +74,14 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa continue; } if (param->paramno >= 0) { + /* TODO Error? */ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead"); return -1; } param->paramno = position; return 1; } ZEND_HASH_FOREACH_END(); + /* TODO Error? */ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined"); return 0; } @@ -86,9 +90,9 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa /* }}} */ /* trigger callback hook for parameters */ -static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type) /* {{{ */ +static bool dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type) /* {{{ */ { - int ret = 1, is_param = 1; + bool ret = 1, is_param = 1; struct pdo_bound_param_data *param; HashTable *ht; @@ -208,7 +212,7 @@ static void param_dtor(zval *el) /* {{{ */ } /* }}} */ -static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param) /* {{{ */ +static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, bool is_param) /* {{{ */ { HashTable *hash; zval *parameter; @@ -256,7 +260,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s for (i = 0; i < stmt->column_count; i++) { if (ZSTR_LEN(stmt->columns[i].name) == ZSTR_LEN(param->name) && - strncmp(ZSTR_VAL(stmt->columns[i].name), ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1) == 0) { + strncmp(ZSTR_VAL(stmt->columns[i].name), ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1) == 0) { param->paramno = i; break; } @@ -265,7 +269,9 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s /* if you prepare and then execute passing an array of params keyed by names, * then this will trigger, and we don't want that */ if (param->paramno == -1) { + /* Should this always be an Error? */ char *tmp; + /* TODO Error? */ spprintf(&tmp, 0, "Did not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); pdo_raise_impl_error(stmt->dbh, stmt, "HY000", tmp); efree(tmp); @@ -375,12 +381,7 @@ PHP_METHOD(PDOStatement, execute) param.paramno = -1; } else { /* we're okay to be zero based here */ - /* num_index is unsignend - if (num_index < 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL); - RETURN_FALSE; - } - */ + /* num_index is unsignend */ param.paramno = num_index; } @@ -398,9 +399,9 @@ PHP_METHOD(PDOStatement, execute) if (PDO_PLACEHOLDER_NONE == stmt->supports_placeholders) { /* handle the emulated parameter binding, - * stmt->active_query_string holds the query with binds expanded and + * stmt->active_query_string holds the query with binds expanded and * quoted. - */ + */ /* string is leftover from previous calls so PDOStatement::debugDumpParams() can access */ if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) { @@ -457,10 +458,15 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ int caller_frees = 0; int type, new_type; - if (colno < 0 || colno >= stmt->column_count) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid column index"); - ZVAL_FALSE(dest); + if (colno < 0) { + zend_value_error("Column index must be greater than or equal to 0"); + ZVAL_NULL(dest); + return; + } + if (colno >= stmt->column_count) { + zend_value_error("Invalid column index"); + ZVAL_NULL(dest); return; } @@ -590,7 +596,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ } /* }}} */ -static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset, int do_bind) /* {{{ */ +static bool do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset) /* {{{ */ { if (!stmt->executed) { return 0; @@ -613,7 +619,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen return 0; } - if (do_bind && stmt->bound_columns) { + if (stmt->bound_columns) { /* update those bound column variables now */ struct pdo_bound_param_data *param; @@ -641,7 +647,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen } /* }}} */ -static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */ +static bool do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */ { zend_class_entry *ce = stmt->fetch.cls.ce; zend_fcall_info *fci = &stmt->fetch.cls.fci; @@ -666,7 +672,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */ fcc->called_scope = ce; return 1; } else if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it"); + zend_throw_error(NULL, "User-supplied statement does not accept constructor arguments"); return 0; } else { return 1; /* no ctor no args is also ok */ @@ -674,18 +680,18 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */ } /* }}} */ -static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args) /* {{{ */ +static bool make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args) /* {{{ */ { char *is_callable_error = NULL; if (zend_fcall_info_init(callable, 0, fci, fcc, NULL, &is_callable_error) == FAILURE) { if (is_callable_error) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", is_callable_error); + zend_type_error("%s", is_callable_error); efree(is_callable_error); } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback"); + zend_type_error("User-supplied function must be a valid callback"); } - return 0; + return false; } if (is_callable_error) { /* Possible error message */ @@ -695,20 +701,20 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci->param_count = num_args; /* probably less */ fci->params = safe_emalloc(sizeof(zval), num_args, 0); - return 1; + return true; } /* }}} */ -static int do_fetch_func_prepare(pdo_stmt_t *stmt) /* {{{ */ +static bool do_fetch_func_prepare(pdo_stmt_t *stmt) /* {{{ */ { zend_fcall_info *fci = &stmt->fetch.cls.fci; zend_fcall_info_cache *fcc = &stmt->fetch.cls.fcc; if (!make_callable_ex(stmt, &stmt->fetch.func.function, fci, fcc, stmt->column_count)) { - return 0; + return false; } else { stmt->fetch.func.values = safe_emalloc(sizeof(zval), stmt->column_count, 0); - return 1; + return true; } } /* }}} */ @@ -718,7 +724,7 @@ static void do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */ /* fci.size is used to check if it is valid */ if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) { if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) { - /* Added to free constructor arguments */ + /* Added to free constructor arguments */ zend_fcall_info_args_clear(&stmt->fetch.cls.fci, 1); } else { efree(stmt->fetch.cls.fci.params); @@ -739,14 +745,15 @@ static void do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */ } /* }}} */ -/* perform a fetch. If do_bind is true, update any bound columns. +/* perform a fetch. * If return_value is not null, store values into it according to HOW. */ -static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all) /* {{{ */ +static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all) /* {{{ */ { int flags, idx, old_arg_count = 0; zend_class_entry *ce = NULL, *old_ce = NULL; zval grp_val, *pgrp, retval, old_ctor_args = {{0}, {0}, {0}}; int colno; + int i = 0; if (how == PDO_FETCH_USE_DEFAULT) { how = stmt->default_fetch_type; @@ -754,7 +761,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_ flags = how & PDO_FETCH_FLAGS; how = how & ~PDO_FETCH_FLAGS; - if (!do_fetch_common(stmt, ori, offset, do_bind)) { + if (!do_fetch_common(stmt, ori, offset)) { return 0; } @@ -769,355 +776,364 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_ colno = stmt->fetch.column; } - if (return_value) { - int i = 0; - - if (how == PDO_FETCH_LAZY) { - get_lazy_object(stmt, return_value); - return 1; - } + /* If no return value we are done */ + if (!return_value) { + return true; + } - RETVAL_FALSE; + if (how == PDO_FETCH_LAZY) { + get_lazy_object(stmt, return_value); + return 1; + } - switch (how) { - case PDO_FETCH_USE_DEFAULT: - case PDO_FETCH_ASSOC: - case PDO_FETCH_BOTH: - case PDO_FETCH_NUM: - case PDO_FETCH_NAMED: - if (!return_all) { - array_init_size(return_value, stmt->column_count); - } else { - array_init(return_value); - } - break; + RETVAL_FALSE; - case PDO_FETCH_KEY_PAIR: - if (stmt->column_count != 2) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain exactly 2 columns."); - return 0; - } - if (!return_all) { - array_init(return_value); - } - break; + switch (how) { + case PDO_FETCH_USE_DEFAULT: + case PDO_FETCH_ASSOC: + case PDO_FETCH_BOTH: + case PDO_FETCH_NUM: + case PDO_FETCH_NAMED: + if (!return_all) { + array_init_size(return_value, stmt->column_count); + } else { + array_init(return_value); + } + break; - case PDO_FETCH_COLUMN: - if (colno >= 0 && colno < stmt->column_count) { - if (flags == PDO_FETCH_GROUP && stmt->fetch.column == -1) { - fetch_value(stmt, return_value, 1, NULL); - } else if (flags == PDO_FETCH_GROUP && colno) { - fetch_value(stmt, return_value, 0, NULL); - } else { - fetch_value(stmt, return_value, colno, NULL); - } - if (!return_all) { - return 1; - } else { - break; - } - } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid column index"); - } + case PDO_FETCH_KEY_PAIR: + if (stmt->column_count != 2) { + /* TODO: Error? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain exactly 2 columns."); return 0; + } + if (!return_all) { + array_init(return_value); + } + break; - case PDO_FETCH_OBJ: - object_init_ex(return_value, ZEND_STANDARD_CLASS_DEF_PTR); - break; + case PDO_FETCH_COLUMN: + if (colno < 0 ) { + zend_value_error("Column index must be greater than or equal to 0"); + return false; + } - case PDO_FETCH_CLASS: - if (flags & PDO_FETCH_CLASSTYPE) { - zval val; - zend_class_entry *cep; + if (colno >= stmt->column_count) { + zend_value_error("Invalid column index"); + return false; + } - old_ce = stmt->fetch.cls.ce; - ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args); - old_arg_count = stmt->fetch.cls.fci.param_count; - do_fetch_opt_finish(stmt, 0); + if (flags == PDO_FETCH_GROUP && stmt->fetch.column == -1) { + fetch_value(stmt, return_value, 1, NULL); + } else if (flags == PDO_FETCH_GROUP && colno) { + fetch_value(stmt, return_value, 0, NULL); + } else { + fetch_value(stmt, return_value, colno, NULL); + } + if (!return_all) { + return 1; + } + break; - fetch_value(stmt, &val, i++, NULL); - if (Z_TYPE(val) != IS_NULL) { - if (!try_convert_to_string(&val)) { - return 0; - } - if ((cep = zend_lookup_class(Z_STR(val))) == NULL) { - stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR; - } else { - stmt->fetch.cls.ce = cep; - } - } + case PDO_FETCH_OBJ: + object_init_ex(return_value, ZEND_STANDARD_CLASS_DEF_PTR); + break; - do_fetch_class_prepare(stmt); - zval_ptr_dtor_str(&val); - } - ce = stmt->fetch.cls.ce; - if (!ce) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified"); - return 0; - } - if ((flags & PDO_FETCH_SERIALIZE) == 0) { - if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { + case PDO_FETCH_CLASS: + if (flags & PDO_FETCH_CLASSTYPE) { + zval val; + zend_class_entry *cep; + + old_ce = stmt->fetch.cls.ce; + ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args); + old_arg_count = stmt->fetch.cls.fci.param_count; + do_fetch_opt_finish(stmt, 0); + + fetch_value(stmt, &val, i++, NULL); + if (Z_TYPE(val) != IS_NULL) { + if (!try_convert_to_string(&val)) { return 0; } - if (!stmt->fetch.cls.fci.size) { - if (!do_fetch_class_prepare(stmt)) - { - return 0; - } - } - if (ce->constructor && (flags & PDO_FETCH_PROPS_LATE)) { - stmt->fetch.cls.fci.object = Z_OBJ_P(return_value); - stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value); - if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor"); - return 0; - } else { - if (!Z_ISUNDEF(stmt->fetch.cls.retval)) { - zval_ptr_dtor(&stmt->fetch.cls.retval); - ZVAL_UNDEF(&stmt->fetch.cls.retval); - } - } + if ((cep = zend_lookup_class(Z_STR(val))) == NULL) { + stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR; + } else { + stmt->fetch.cls.ce = cep; } } - break; - - case PDO_FETCH_INTO: - if (Z_ISUNDEF(stmt->fetch.into)) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified."); - return 0; - break; - } - - ZVAL_COPY(return_value, &stmt->fetch.into); - - if (Z_OBJ_P(return_value)->ce == ZEND_STANDARD_CLASS_DEF_PTR) { - how = PDO_FETCH_OBJ; - } - break; - case PDO_FETCH_FUNC: - if (Z_ISUNDEF(stmt->fetch.func.function)) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified"); + do_fetch_class_prepare(stmt); + zval_ptr_dtor_str(&val); + } + ce = stmt->fetch.cls.ce; + /* TODO: Make this an assertion and ensure this is true higher up? */ + if (!ce) { + /* TODO Error? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified"); + return 0; + } + if ((flags & PDO_FETCH_SERIALIZE) == 0) { + if (UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { return 0; } - if (!stmt->fetch.func.fci.size) { - if (!do_fetch_func_prepare(stmt)) + if (!stmt->fetch.cls.fci.size) { + if (!do_fetch_class_prepare(stmt)) { return 0; } } + if (ce->constructor && (flags & PDO_FETCH_PROPS_LATE)) { + stmt->fetch.cls.fci.object = Z_OBJ_P(return_value); + stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value); + if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) { + /* TODO Error? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor"); + return 0; + } else { + if (!Z_ISUNDEF(stmt->fetch.cls.retval)) { + zval_ptr_dtor(&stmt->fetch.cls.retval); + ZVAL_UNDEF(&stmt->fetch.cls.retval); + } + } + } + } + break; + + case PDO_FETCH_INTO: + /* TODO: Make this an assertion and ensure this is true higher up? */ + if (Z_ISUNDEF(stmt->fetch.into)) { + /* TODO ArgumentCountError? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified."); + return 0; break; + } + ZVAL_COPY(return_value, &stmt->fetch.into); - default: - /* shouldn't happen */ - return 0; - } + if (Z_OBJ_P(return_value)->ce == ZEND_STANDARD_CLASS_DEF_PTR) { + how = PDO_FETCH_OBJ; + } + break; - if (return_all && how != PDO_FETCH_KEY_PAIR) { - if (flags == PDO_FETCH_GROUP && how == PDO_FETCH_COLUMN && stmt->fetch.column > 0) { - fetch_value(stmt, &grp_val, colno, NULL); - } else { - fetch_value(stmt, &grp_val, i, NULL); + case PDO_FETCH_FUNC: + /* TODO: Make this an assertion and ensure this is true higher up? */ + if (Z_ISUNDEF(stmt->fetch.func.function)) { + /* TODO ArgumentCountError? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified"); + return 0; } - convert_to_string(&grp_val); - if (how == PDO_FETCH_COLUMN) { - i = stmt->column_count; /* no more data to fetch */ - } else { - i++; + if (!stmt->fetch.func.fci.size) { + if (!do_fetch_func_prepare(stmt)) + { + return 0; + } } + break; + EMPTY_SWITCH_DEFAULT_CASE(); + } + + if (return_all && how != PDO_FETCH_KEY_PAIR) { + if (flags == PDO_FETCH_GROUP && how == PDO_FETCH_COLUMN && stmt->fetch.column > 0) { + fetch_value(stmt, &grp_val, colno, NULL); + } else { + fetch_value(stmt, &grp_val, i, NULL); + } + convert_to_string(&grp_val); + if (how == PDO_FETCH_COLUMN) { + i = stmt->column_count; /* no more data to fetch */ + } else { + i++; } + } - for (idx = 0; i < stmt->column_count; i++, idx++) { - zval val; - fetch_value(stmt, &val, i, NULL); + for (idx = 0; i < stmt->column_count; i++, idx++) { + zval val; + fetch_value(stmt, &val, i, NULL); - switch (how) { - case PDO_FETCH_ASSOC: - zend_symtable_update(Z_ARRVAL_P(return_value), stmt->columns[i].name, &val); - break; + switch (how) { + case PDO_FETCH_ASSOC: + zend_symtable_update(Z_ARRVAL_P(return_value), stmt->columns[i].name, &val); + break; - case PDO_FETCH_KEY_PAIR: - { - zval tmp; - fetch_value(stmt, &tmp, ++i, NULL); + case PDO_FETCH_KEY_PAIR: + { + zval tmp; + fetch_value(stmt, &tmp, ++i, NULL); - if (Z_TYPE(val) == IS_LONG) { - zend_hash_index_update((return_all ? Z_ARRVAL_P(return_all) : Z_ARRVAL_P(return_value)), Z_LVAL(val), &tmp); - } else { - convert_to_string(&val); - zend_symtable_update((return_all ? Z_ARRVAL_P(return_all) : Z_ARRVAL_P(return_value)), Z_STR(val), &tmp); - } - zval_ptr_dtor(&val); - return 1; + if (Z_TYPE(val) == IS_LONG) { + zend_hash_index_update((return_all ? Z_ARRVAL_P(return_all) : Z_ARRVAL_P(return_value)), Z_LVAL(val), &tmp); + } else { + convert_to_string(&val); + zend_symtable_update((return_all ? Z_ARRVAL_P(return_all) : Z_ARRVAL_P(return_value)), Z_STR(val), &tmp); } - break; + zval_ptr_dtor(&val); + return 1; + } + break; - case PDO_FETCH_USE_DEFAULT: - case PDO_FETCH_BOTH: - zend_symtable_update(Z_ARRVAL_P(return_value), stmt->columns[i].name, &val); - if (zend_hash_index_add(Z_ARRVAL_P(return_value), i, &val) != NULL) { - Z_TRY_ADDREF(val); - } - break; + case PDO_FETCH_USE_DEFAULT: + case PDO_FETCH_BOTH: + zend_symtable_update(Z_ARRVAL_P(return_value), stmt->columns[i].name, &val); + if (zend_hash_index_add(Z_ARRVAL_P(return_value), i, &val) != NULL) { + Z_TRY_ADDREF(val); + } + break; - case PDO_FETCH_NAMED: - /* already have an item with this name? */ - { - zval *curr_val; - if ((curr_val = zend_hash_find(Z_ARRVAL_P(return_value), stmt->columns[i].name))) { - zval arr; - if (Z_TYPE_P(curr_val) != IS_ARRAY) { - /* a little bit of black magic here: - * we're creating a new array and swapping it for the - * zval that's already stored in the hash under the name - * we want. We then add that zval to the array. - * This is effectively the same thing as: - * if (!is_array($hash[$name])) { - * $hash[$name] = array($hash[$name]); - * } - * */ - zval cur; - - array_init(&arr); - - ZVAL_COPY_VALUE(&cur, curr_val); - ZVAL_COPY_VALUE(curr_val, &arr); - - zend_hash_next_index_insert_new(Z_ARRVAL(arr), &cur); - } else { - ZVAL_COPY_VALUE(&arr, curr_val); - } - zend_hash_next_index_insert_new(Z_ARRVAL(arr), &val); + case PDO_FETCH_NAMED: + /* already have an item with this name? */ + { + zval *curr_val; + if ((curr_val = zend_hash_find(Z_ARRVAL_P(return_value), stmt->columns[i].name))) { + zval arr; + if (Z_TYPE_P(curr_val) != IS_ARRAY) { + /* a little bit of black magic here: + * we're creating a new array and swapping it for the + * zval that's already stored in the hash under the name + * we want. We then add that zval to the array. + * This is effectively the same thing as: + * if (!is_array($hash[$name])) { + * $hash[$name] = array($hash[$name]); + * } + * */ + zval cur; + + array_init(&arr); + + ZVAL_COPY_VALUE(&cur, curr_val); + ZVAL_COPY_VALUE(curr_val, &arr); + + zend_hash_next_index_insert_new(Z_ARRVAL(arr), &cur); } else { - zend_hash_update(Z_ARRVAL_P(return_value), stmt->columns[i].name, &val); + ZVAL_COPY_VALUE(&arr, curr_val); } + zend_hash_next_index_insert_new(Z_ARRVAL(arr), &val); + } else { + zend_hash_update(Z_ARRVAL_P(return_value), stmt->columns[i].name, &val); } - break; + } + break; - case PDO_FETCH_NUM: - zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &val); - break; + case PDO_FETCH_NUM: + zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &val); + break; - case PDO_FETCH_OBJ: - case PDO_FETCH_INTO: - zend_update_property_ex(NULL, Z_OBJ_P(return_value), + case PDO_FETCH_OBJ: + case PDO_FETCH_INTO: + zend_update_property_ex(NULL, Z_OBJ_P(return_value), + stmt->columns[i].name, + &val); + zval_ptr_dtor(&val); + break; + + case PDO_FETCH_CLASS: + if ((flags & PDO_FETCH_SERIALIZE) == 0 || idx) { + zend_update_property_ex(ce, Z_OBJ_P(return_value), stmt->columns[i].name, &val); zval_ptr_dtor(&val); - break; - - case PDO_FETCH_CLASS: - if ((flags & PDO_FETCH_SERIALIZE) == 0 || idx) { - zend_update_property_ex(ce, Z_OBJ_P(return_value), - stmt->columns[i].name, - &val); + } else { + if (!ce->unserialize) { zval_ptr_dtor(&val); - } else { - if (!ce->unserialize) { - zval_ptr_dtor(&val); - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class"); - return 0; - } else if (ce->unserialize(return_value, ce, (unsigned char *)(Z_TYPE(val) == IS_STRING ? Z_STRVAL(val) : ""), Z_TYPE(val) == IS_STRING ? Z_STRLEN(val) : 0, NULL) == FAILURE) { - zval_ptr_dtor(&val); - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class"); - zval_ptr_dtor(return_value); - ZVAL_NULL(return_value); - return 0; - } else { - zval_ptr_dtor(&val); - } - } - break; - - case PDO_FETCH_FUNC: - ZVAL_COPY_VALUE(&stmt->fetch.func.values[idx], &val); - ZVAL_COPY_VALUE(&stmt->fetch.cls.fci.params[idx], &stmt->fetch.func.values[idx]); - break; - - default: - zval_ptr_dtor(&val); - pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range"); - return 0; - break; - } - } - - switch (how) { - case PDO_FETCH_CLASS: - if (ce->constructor && !(flags & (PDO_FETCH_PROPS_LATE | PDO_FETCH_SERIALIZE))) { - stmt->fetch.cls.fci.object = Z_OBJ_P(return_value); - stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value); - if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor"); + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class"); + return 0; + } else if (ce->unserialize(return_value, ce, (unsigned char *)(Z_TYPE(val) == IS_STRING ? Z_STRVAL(val) : ""), Z_TYPE(val) == IS_STRING ? Z_STRLEN(val) : 0, NULL) == FAILURE) { + zval_ptr_dtor(&val); + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class"); + zval_ptr_dtor(return_value); + ZVAL_NULL(return_value); return 0; } else { - if (!Z_ISUNDEF(stmt->fetch.cls.retval)) { - zval_ptr_dtor(&stmt->fetch.cls.retval); - } + zval_ptr_dtor(&val); } } - if (flags & PDO_FETCH_CLASSTYPE) { - do_fetch_opt_finish(stmt, 0); - stmt->fetch.cls.ce = old_ce; - ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args); - stmt->fetch.cls.fci.param_count = old_arg_count; - } break; case PDO_FETCH_FUNC: - stmt->fetch.func.fci.param_count = idx; - stmt->fetch.func.fci.retval = &retval; - if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc) == FAILURE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function"); + ZVAL_COPY_VALUE(&stmt->fetch.func.values[idx], &val); + ZVAL_COPY_VALUE(&stmt->fetch.cls.fci.params[idx], &stmt->fetch.func.values[idx]); + break; + + default: + zval_ptr_dtor(&val); + zend_value_error("Fetch mode must be a bitmask of PDO::FETCH_* constants"); + return 0; + } + } + + switch (how) { + case PDO_FETCH_CLASS: + if (ce->constructor && !(flags & (PDO_FETCH_PROPS_LATE | PDO_FETCH_SERIALIZE))) { + stmt->fetch.cls.fci.object = Z_OBJ_P(return_value); + stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value); + if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) { + /* TODO Error? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor"); return 0; } else { - if (return_all) { - zval_ptr_dtor(return_value); /* we don't need that */ - ZVAL_COPY_VALUE(return_value, &retval); - } else if (!Z_ISUNDEF(retval)) { - ZVAL_COPY_VALUE(return_value, &retval); + if (!Z_ISUNDEF(stmt->fetch.cls.retval)) { + zval_ptr_dtor(&stmt->fetch.cls.retval); } } - while (idx--) { - zval_ptr_dtor(&stmt->fetch.func.values[idx]); + } + if (flags & PDO_FETCH_CLASSTYPE) { + do_fetch_opt_finish(stmt, 0); + stmt->fetch.cls.ce = old_ce; + ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args); + stmt->fetch.cls.fci.param_count = old_arg_count; + } + break; + + case PDO_FETCH_FUNC: + stmt->fetch.func.fci.param_count = idx; + stmt->fetch.func.fci.retval = &retval; + if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc) == FAILURE) { + /* TODO Error? */ + pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function"); + return 0; + } else { + if (return_all) { + zval_ptr_dtor(return_value); /* we don't need that */ + ZVAL_COPY_VALUE(return_value, &retval); + } else if (!Z_ISUNDEF(retval)) { + ZVAL_COPY_VALUE(return_value, &retval); } - break; + } + while (idx--) { + zval_ptr_dtor(&stmt->fetch.func.values[idx]); + } + break; - default: - break; - } + default: + break; + } - if (return_all) { - if ((flags & PDO_FETCH_UNIQUE) == PDO_FETCH_UNIQUE) { - zend_symtable_update(Z_ARRVAL_P(return_all), Z_STR(grp_val), return_value); + if (return_all) { + if ((flags & PDO_FETCH_UNIQUE) == PDO_FETCH_UNIQUE) { + zend_symtable_update(Z_ARRVAL_P(return_all), Z_STR(grp_val), return_value); + } else { + zval grp; + if ((pgrp = zend_symtable_find(Z_ARRVAL_P(return_all), Z_STR(grp_val))) == NULL) { + array_init(&grp); + zend_symtable_update(Z_ARRVAL_P(return_all), Z_STR(grp_val), &grp); } else { - zval grp; - if ((pgrp = zend_symtable_find(Z_ARRVAL_P(return_all), Z_STR(grp_val))) == NULL) { - array_init(&grp); - zend_symtable_update(Z_ARRVAL_P(return_all), Z_STR(grp_val), &grp); - } else { - ZVAL_COPY_VALUE(&grp, pgrp); - } - zend_hash_next_index_insert(Z_ARRVAL(grp), return_value); + ZVAL_COPY_VALUE(&grp, pgrp); } - zval_ptr_dtor_str(&grp_val); + zend_hash_next_index_insert(Z_ARRVAL(grp), return_value); } - + zval_ptr_dtor_str(&grp_val); } return 1; } /* }}} */ -static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all) /* {{{ */ +static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_arg_num, bool fetch_all) /* {{{ */ { int flags = mode & PDO_FETCH_FLAGS; mode = mode & ~PDO_FETCH_FLAGS; if (mode < 0 || mode > PDO_FETCH__MAX) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode"); + zend_argument_value_error(mode_arg_num, "must be a bitmask of PDO::FETCH_* constants"); return 0; } @@ -1129,28 +1145,28 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all) switch(mode) { case PDO_FETCH_FUNC: if (!fetch_all) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_FUNC is only allowed in PDOStatement::fetchAll()"); + zend_value_error("Can only use PDO::FETCH_FUNC in PDOStatement::fetchAll()"); return 0; } return 1; case PDO_FETCH_LAZY: if (fetch_all) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()"); + zend_argument_value_error(mode_arg_num, "cannot be PDO::FETCH_LAZY in PDOStatement::fetchAll()"); return 0; } /* fall through */ default: if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS"); + zend_argument_value_error(mode_arg_num, "must use PDO::FETCH_SERIALIZE with PDO::FETCH_CLASS"); return 0; } if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_CLASSTYPE can only be used together with PDO::FETCH_CLASS"); + zend_argument_value_error(mode_arg_num, "must use PDO::FETCH_CLASSTYPE with PDO::FETCH_CLASS"); return 0; } if (mode >= PDO_FETCH__MAX) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode"); + zend_argument_value_error(mode_arg_num, "must be a bitmask of PDO::FETCH_* constants"); return 0; } /* no break; */ @@ -1175,14 +1191,14 @@ PHP_METHOD(PDOStatement, fetch) Z_PARAM_LONG(off) ZEND_PARSE_PARAMETERS_END(); - PHP_STMT_GET_OBJ; + PHP_STMT_GET_OBJ; PDO_STMT_CLEAR_ERR(); - if (!pdo_stmt_verify_mode(stmt, how, 0)) { - RETURN_FALSE; + if (!pdo_stmt_verify_mode(stmt, how, 1, false)) { + RETURN_THROWS(); } - if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0)) { + if (!do_fetch(stmt, return_value, how, ori, off, NULL)) { PDO_HANDLE_STMT_ERR(); RETURN_FALSE; } @@ -1192,9 +1208,6 @@ PHP_METHOD(PDOStatement, fetch) /* {{{ Fetches the next row and returns it as an object. */ PHP_METHOD(PDOStatement, fetchObject) { - zend_long how = PDO_FETCH_CLASS; - zend_long ori = PDO_FETCH_ORI_NEXT; - zend_long off = 0; zend_class_entry *ce = NULL; zend_class_entry *old_ce; zval old_ctor_args, *ctor_args = NULL; @@ -1209,10 +1222,6 @@ PHP_METHOD(PDOStatement, fetchObject) PHP_STMT_GET_OBJ; PDO_STMT_CLEAR_ERR(); - if (!pdo_stmt_verify_mode(stmt, how, 0)) { - RETURN_FALSE; - } - old_ce = stmt->fetch.cls.ce; ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args); old_arg_count = stmt->fetch.cls.fci.param_count; @@ -1232,7 +1241,7 @@ PHP_METHOD(PDOStatement, fetchObject) stmt->fetch.cls.ce = zend_standard_class_def; } - if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0)) { + if (!do_fetch(stmt, return_value, PDO_FETCH_CLASS, PDO_FETCH_ORI_NEXT, /* offset */ 0, NULL)) { PDO_HANDLE_STMT_ERR(); RETVAL_FALSE; } @@ -1257,7 +1266,7 @@ PHP_METHOD(PDOStatement, fetchColumn) PHP_STMT_GET_OBJ; PDO_STMT_CLEAR_ERR(); - if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE)) { + if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0)) { PDO_HANDLE_STMT_ERR(); RETURN_FALSE; } @@ -1270,22 +1279,23 @@ PHP_METHOD(PDOStatement, fetchColumn) PHP_METHOD(PDOStatement, fetchAll) { zend_long how = PDO_FETCH_USE_DEFAULT; - zval data, *return_all; + zval data, *return_all = NULL; zval *arg2 = NULL; zend_class_entry *old_ce; zval old_ctor_args, *ctor_args = NULL; - int error = 0, flags, old_arg_count; + bool error = false; + int flags, old_arg_count; ZEND_PARSE_PARAMETERS_START(0, 3) Z_PARAM_OPTIONAL Z_PARAM_LONG(how) - Z_PARAM_ZVAL(arg2) - Z_PARAM_ZVAL(ctor_args) + Z_PARAM_ZVAL_OR_NULL(arg2) + Z_PARAM_ARRAY_OR_NULL(ctor_args) ZEND_PARSE_PARAMETERS_END(); PHP_STMT_GET_OBJ; - if (!pdo_stmt_verify_mode(stmt, how, 1)) { - RETURN_FALSE; + if (!pdo_stmt_verify_mode(stmt, how, 1, true)) { + RETURN_THROWS(); } old_ce = stmt->fetch.cls.ce; @@ -1294,85 +1304,88 @@ PHP_METHOD(PDOStatement, fetchAll) do_fetch_opt_finish(stmt, 0); - switch(how & ~PDO_FETCH_FLAGS) { - case PDO_FETCH_CLASS: - switch(ZEND_NUM_ARGS()) { - case 0: - case 1: - stmt->fetch.cls.ce = zend_standard_class_def; - break; - case 3: - if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array"); - error = 1; - break; - } - if (Z_TYPE_P(ctor_args) != IS_ARRAY || !zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) { - ctor_args = NULL; + /* TODO Would be good to reuse part of pdo_stmt_setup_fetch_mode() in some way */ + + switch (how & ~PDO_FETCH_FLAGS) { + case PDO_FETCH_CLASS: + /* Figure out correct class */ + if (arg2) { + if (Z_TYPE_P(arg2) != IS_STRING) { + zend_argument_type_error(2, "must be of type string, %s given", zend_zval_type_name(arg2)); + RETURN_THROWS(); + } + stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO); + if (!stmt->fetch.cls.ce) { + zend_argument_type_error(2, "must be a valid class"); + RETURN_THROWS(); + } + } else { + stmt->fetch.cls.ce = zend_standard_class_def; } - /* no break */ - case 2: - if (ctor_args) { + + if (ctor_args && zend_hash_num_elements(Z_ARRVAL_P(ctor_args)) > 0) { ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, ctor_args); /* we're not going to free these */ } else { ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); } - if (Z_TYPE_P(arg2) != IS_STRING) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)"); - error = 1; - break; - } else { - stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO); - if (!stmt->fetch.cls.ce) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class"); - error = 1; - break; - } - } - } - if (!error) { + do_fetch_class_prepare(stmt); - } - break; - - case PDO_FETCH_FUNC: - switch (ZEND_NUM_ARGS()) { - case 0: - case 1: - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "no fetch function specified"); - error = 1; - break; - case 3: - case 2: - ZVAL_COPY_VALUE(&stmt->fetch.func.function, arg2); - if (do_fetch_func_prepare(stmt) == 0) { - error = 1; - } - break; - } - break; + break; - case PDO_FETCH_COLUMN: - switch(ZEND_NUM_ARGS()) { - case 0: - case 1: - stmt->fetch.column = how & PDO_FETCH_GROUP ? -1 : 0; + case PDO_FETCH_FUNC: /* Cannot be a default fetch mode */ + if (ZEND_NUM_ARGS() != 2) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects exactly 2 argument for PDO::FETCH_FUNC, %d given", + ZSTR_VAL(func), ZEND_NUM_ARGS()); + zend_string_release(func); + RETURN_THROWS(); + } + if (arg2 == NULL) { + /* TODO use "must be of type callable" format? */ + zend_argument_type_error(2, "must be a callable, null given"); + RETURN_THROWS(); + } + /* TODO Check it is a callable? */ + ZVAL_COPY_VALUE(&stmt->fetch.func.function, arg2); + if (do_fetch_func_prepare(stmt) == false) { + RETURN_THROWS(); + } break; - case 2: - convert_to_long(arg2); - stmt->fetch.column = Z_LVAL_P(arg2); + + case PDO_FETCH_COLUMN: + if (ZEND_NUM_ARGS() > 2) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects at most 2 argument for the fetch mode provided, %d given", + ZSTR_VAL(func), ZEND_NUM_ARGS()); + zend_string_release(func); + RETURN_THROWS(); + } + /* Is column index passed? */ + if (arg2) { + // Reuse convert_to_long(arg2); ? + if (Z_TYPE_P(arg2) != IS_LONG) { + zend_argument_type_error(2, "must be of type int, %s given", zend_zval_type_name(arg2)); + RETURN_THROWS(); + } + if (Z_LVAL_P(arg2) < 0) { + zend_argument_value_error(2, "must be greater than or equal to 0"); + RETURN_THROWS(); + } + stmt->fetch.column = Z_LVAL_P(arg2); + } else { + stmt->fetch.column = how & PDO_FETCH_GROUP ? -1 : 0; + } break; - case 3: - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO::FETCH_COLUMN"); - error = 1; - } - break; - default: - if (ZEND_NUM_ARGS() > 1) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters"); - error = 1; - } + default: + /* No support for PDO_FETCH_INTO which takes 2 args??? */ + if (ZEND_NUM_ARGS() > 1) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects exactly 1 argument for the fetch mode provided, %d given", + ZSTR_VAL(func), ZEND_NUM_ARGS()); + zend_string_release(func); + RETURN_THROWS(); + } } flags = how & PDO_FETCH_FLAGS; @@ -1382,48 +1395,42 @@ PHP_METHOD(PDOStatement, fetchAll) how |= stmt->default_fetch_type & ~PDO_FETCH_FLAGS; } - if (!error) { - PDO_STMT_CLEAR_ERR(); - if ((how & PDO_FETCH_GROUP) || how == PDO_FETCH_KEY_PAIR || - (how == PDO_FETCH_USE_DEFAULT && stmt->default_fetch_type == PDO_FETCH_KEY_PAIR) - ) { - array_init(return_value); - return_all = return_value; - } else { - return_all = 0; - } - if (!do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all)) { - error = 2; - } + PDO_STMT_CLEAR_ERR(); + if ((how & PDO_FETCH_GROUP) || how == PDO_FETCH_KEY_PAIR || + (how == PDO_FETCH_USE_DEFAULT && stmt->default_fetch_type == PDO_FETCH_KEY_PAIR) + ) { + array_init(return_value); + return_all = return_value; } + if (!do_fetch(stmt, &data, how | flags, PDO_FETCH_ORI_NEXT, /* offset */ 0, return_all)) { + error = true; + } + if (!error) { if ((how & PDO_FETCH_GROUP)) { - while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all)); + while (do_fetch(stmt, &data, how | flags, PDO_FETCH_ORI_NEXT, /* offset */ 0, return_all)); } else if (how == PDO_FETCH_KEY_PAIR || (how == PDO_FETCH_USE_DEFAULT && stmt->default_fetch_type == PDO_FETCH_KEY_PAIR)) { - while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all)); + while (do_fetch(stmt, &data, how | flags, PDO_FETCH_ORI_NEXT, /* offset */ 0, return_all)); } else { array_init(return_value); do { zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &data); - } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, 0)); + } while (do_fetch(stmt, &data, how | flags, PDO_FETCH_ORI_NEXT, /* offset */ 0, NULL)); } } do_fetch_opt_finish(stmt, 0); + /* Restore defaults which were changed by PDO_FETCH_CLASS mode */ stmt->fetch.cls.ce = old_ce; ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args); stmt->fetch.cls.fci.param_count = old_arg_count; + /* on no results, return an empty array */ if (error) { PDO_HANDLE_STMT_ERR(); - if (error != 2) { - RETURN_FALSE; - } else { /* on no results, return an empty array */ - if (Z_TYPE_P(return_value) != IS_ARRAY) { - array_init(return_value); - } - return; + if (Z_TYPE_P(return_value) != IS_ARRAY) { + array_init(return_value); } } } @@ -1451,12 +1458,16 @@ static void register_bound_param(INTERNAL_FUNCTION_PARAMETERS, int is_param) /* param.param_type = (int) param_type; if (param.name) { + if (ZSTR_LEN(param.name) == 0) { + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); + } param.paramno = -1; } else if (param.paramno > 0) { --param.paramno; /* make it zero-based internally */ } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based"); - RETURN_FALSE; + zend_argument_value_error(1, "must be greater than or equal to 1"); + RETURN_THROWS(); } if (driver_params) { @@ -1495,12 +1506,16 @@ PHP_METHOD(PDOStatement, bindValue) param.param_type = (int) param_type; if (param.name) { + if (ZSTR_LEN(param.name) == 0) { + zend_argument_value_error(1, "cannot be empty"); + RETURN_THROWS(); + } param.paramno = -1; } else if (param.paramno > 0) { --param.paramno; /* make it zero-based internally */ } else { - pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based"); - RETURN_FALSE; + zend_argument_value_error(1, "must be greater than or equal to 1"); + RETURN_THROWS(); } ZVAL_COPY(¶m.parameter, parameter); @@ -1557,7 +1572,7 @@ PHP_METHOD(PDOStatement, errorCode) PHP_METHOD(PDOStatement, errorInfo) { int error_count; - int error_count_diff = 0; + int error_count_diff = 0; int error_expected_count = 3; ZEND_PARSE_PARAMETERS_NONE(); @@ -1595,8 +1610,11 @@ PHP_METHOD(PDOStatement, setAttribute) ZEND_PARSE_PARAMETERS_END(); PHP_STMT_GET_OBJ; + + /* Driver hasn't registered a function for setting attributes */ if (!stmt->methods->set_attribute) { - goto fail; + pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes"); + RETURN_FALSE; } PDO_STMT_CLEAR_ERR(); @@ -1604,19 +1622,15 @@ PHP_METHOD(PDOStatement, setAttribute) RETURN_TRUE; } -fail: - if (!stmt->methods->set_attribute) { - pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes"); - } else { - PDO_HANDLE_STMT_ERR(); - } + /* Error while setting attribute */ + PDO_HANDLE_STMT_ERR(); RETURN_FALSE; } /* }}} */ /* {{{ Get an attribute */ -static int generic_stmt_attr_get(pdo_stmt_t *stmt, zval *return_value, zend_long attr) +static bool generic_stmt_attr_get(pdo_stmt_t *stmt, zval *return_value, zend_long attr) { switch (attr) { case PDO_ATTR_EMULATE_PREPARES: @@ -1686,9 +1700,9 @@ PHP_METHOD(PDOStatement, getColumnMeta) ZEND_PARSE_PARAMETERS_END(); PHP_STMT_GET_OBJ; - if(colno < 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative"); - RETURN_FALSE; + if (colno < 0) { + zend_argument_value_error(1, "must be greater than or equal to 0"); + RETURN_THROWS(); } if (!stmt->methods->get_column_meta) { @@ -1716,13 +1730,13 @@ PHP_METHOD(PDOStatement, getColumnMeta) /* {{{ Changes the default fetch mode for subsequent fetches (params have different meaning for different fetch modes) */ -int pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, zval *args, uint32_t num_args) +bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_arg_num, + zval *args, uint32_t variadic_num_args) { int flags = 0; - zend_class_entry *cep; - int retval; - - do_fetch_opt_finish(stmt, 1); + uint32_t arg1_arg_num = mode_arg_num + 1; + uint32_t constructor_arg_num = mode_arg_num + 2; + uint32_t total_num_args = mode_arg_num + variadic_num_args; switch (stmt->default_fetch_type) { case PDO_FETCH_INTO: @@ -1738,14 +1752,11 @@ int pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, zval *args, uint stmt->default_fetch_type = PDO_FETCH_BOTH; flags = mode & PDO_FETCH_FLAGS; - retval = pdo_stmt_verify_mode(stmt, mode, 0); - if (FAILURE == retval) { - PDO_STMT_CLEAR_ERR(); - return FAILURE; + if (!pdo_stmt_verify_mode(stmt, mode, mode_arg_num, false)) { + return false; } - retval = FAILURE; switch (mode & ~PDO_FETCH_FLAGS) { case PDO_FETCH_USE_DEFAULT: case PDO_FETCH_LAZY: @@ -1756,110 +1767,120 @@ int pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, zval *args, uint case PDO_FETCH_BOUND: case PDO_FETCH_NAMED: case PDO_FETCH_KEY_PAIR: - if (num_args != 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments"); - } else { - retval = SUCCESS; + if (variadic_num_args != 0) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects exactly %d arguments for the fetch mode provided, %d given", + ZSTR_VAL(func), mode_arg_num, total_num_args); + zend_string_release(func); + return false; } break; case PDO_FETCH_COLUMN: - if (num_args != 1) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the colno argument"); - } else if (Z_TYPE(args[0]) != IS_LONG) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "colno must be an integer"); - } else { - stmt->fetch.column = Z_LVAL(args[0]); - retval = SUCCESS; + if (variadic_num_args != 1) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects exactly %d arguments for the fetch mode provided, %d given", + ZSTR_VAL(func), arg1_arg_num, total_num_args); + zend_string_release(func); + return false; + } + if (Z_TYPE(args[0]) != IS_LONG) { + zend_argument_type_error(arg1_arg_num, "must be of type int, %s given", zend_zval_type_name(&args[0])); + return false; + } + if (Z_LVAL(args[0]) < 0) { + zend_argument_value_error(arg1_arg_num, "must be greater than or equal to 0"); + return false; } + stmt->fetch.column = Z_LVAL(args[0]); break; - case PDO_FETCH_CLASS: + case PDO_FETCH_CLASS: { + HashTable *constructor_args = NULL; + /* Undef constructor arguments */ + ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); /* Gets its class name from 1st column */ if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) { - if (num_args != 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments"); - } else { - stmt->fetch.cls.ce = NULL; - retval = SUCCESS; + if (variadic_num_args != 0) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects exactly %d arguments for the fetch mode provided, %d given", + ZSTR_VAL(func), mode_arg_num, total_num_args); + zend_string_release(func); + return false; } + stmt->fetch.cls.ce = NULL; } else { - if (num_args < 1) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the classname argument"); - } else if (num_args > 2) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "too many arguments"); - } else if (Z_TYPE(args[0]) != IS_STRING) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "classname must be a string"); - } else { - cep = zend_lookup_class(Z_STR(args[0])); - if (cep) { - retval = SUCCESS; - stmt->fetch.cls.ce = cep; - } + zend_class_entry *cep; + if (variadic_num_args == 0) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects at least %d arguments for the fetch mode provided, %d given", + ZSTR_VAL(func), arg1_arg_num, total_num_args); + zend_string_release(func); + return false; } - } - - if (SUCCESS == retval) { - ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); -#ifdef ilia_0 /* we'll only need this when we have persistent statements, if ever */ - if (stmt->dbh->is_persistent) { - php_error_docref(NULL, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release"); + /* constructor_arguments can be null/not passed */ + if (variadic_num_args > 2) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects at most %d arguments for the fetch mode provided, %d given", + ZSTR_VAL(func), constructor_arg_num, total_num_args); + zend_string_release(func); + return false; } -#endif - if (num_args == 2) { + if (Z_TYPE(args[0]) != IS_STRING) { + zend_argument_type_error(arg1_arg_num, "must be of type string, %s given", zend_zval_type_name(&args[0])); + return false; + } + cep = zend_lookup_class(Z_STR(args[0])); + if (!cep) { + zend_argument_type_error(arg1_arg_num, "must be a valid class"); + return false; + } + /* Verify constructor_args (args[1]) is ?array */ + /* TODO: Improve logic? */ + if (variadic_num_args == 2) { if (Z_TYPE(args[1]) != IS_NULL && Z_TYPE(args[1]) != IS_ARRAY) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array"); - retval = FAILURE; - } else if (Z_TYPE(args[1]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL(args[1]))) { - ZVAL_ARR(&stmt->fetch.cls.ctor_args, zend_array_dup(Z_ARRVAL(args[1]))); + zend_argument_type_error(constructor_arg_num, "must be of type ?array, %s given", + zend_zval_type_name(&args[1])); + return false; + } + if (Z_TYPE(args[1]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL(args[1]))) { + constructor_args = Z_ARRVAL(args[1]); } } + stmt->fetch.cls.ce = cep; - if (SUCCESS == retval) { - do_fetch_class_prepare(stmt); + /* If constructor arguments are present and not empty */ + if (constructor_args) { + ZVAL_ARR(&stmt->fetch.cls.ctor_args, zend_array_dup(constructor_args)); } } + do_fetch_class_prepare(stmt); break; - + } case PDO_FETCH_INTO: - if (num_args != 1) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the object parameter"); - } else if (Z_TYPE(args[0]) != IS_OBJECT) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "object must be an object"); - } else { - retval = SUCCESS; + if (total_num_args != arg1_arg_num) { + zend_string *func = get_active_function_or_method_name(); + zend_argument_count_error("%s() expects exactly %d arguments for the fetch mode provided, %d given", + ZSTR_VAL(func), arg1_arg_num, total_num_args); + zend_string_release(func); + return false; } - - if (SUCCESS == retval) { -#ifdef ilia_0 /* we'll only need this when we have persistent statements, if ever */ - if (stmt->dbh->is_persistent) { - php_error_docref(NULL, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release"); - } -#endif - ZVAL_COPY(&stmt->fetch.into, &args[0]); + if (Z_TYPE(args[0]) != IS_OBJECT) { + zend_argument_type_error(arg1_arg_num, "must be of type object, %s given", zend_zval_type_name(&args[0])); + return false; } + ZVAL_COPY(&stmt->fetch.into, &args[0]); break; - default: - pdo_raise_impl_error(stmt->dbh, stmt, "22003", "Invalid fetch mode specified"); + zend_argument_value_error(mode_arg_num, "must be one of the PDO::FETCH_* constants"); + return false; } - if (SUCCESS == retval) { - stmt->default_fetch_type = mode; - } - - /* - * PDO error (if any) has already been raised at this point. - * - * The error_code is cleared, otherwise the caller will read the - * last error message from the driver. - * - */ - PDO_STMT_CLEAR_ERR(); + stmt->default_fetch_type = mode; - return retval; + return true; } PHP_METHOD(PDOStatement, setFetchMode) @@ -1873,13 +1894,21 @@ PHP_METHOD(PDOStatement, setFetchMode) } PHP_STMT_GET_OBJ; - RETVAL_BOOL(pdo_stmt_setup_fetch_mode(stmt, fetch_mode, args, num_args) == SUCCESS); + + do_fetch_opt_finish(stmt, 1); + + if (!pdo_stmt_setup_fetch_mode(stmt, fetch_mode, 1, args, num_args)) { + RETURN_THROWS(); + } + + // TODO Void return? + RETURN_TRUE; } /* }}} */ /* {{{ Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */ -static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt) +static bool pdo_stmt_do_next_rowset(pdo_stmt_t *stmt) { /* un-describe */ if (stmt->columns) { @@ -1974,6 +2003,7 @@ PHP_METHOD(PDOStatement, debugDumpParams) ZEND_PARSE_PARAMETERS_NONE(); PHP_STMT_GET_OBJ; + if (out == NULL) { RETURN_FALSE; } @@ -2035,10 +2065,8 @@ PHP_METHOD(PDOStatement, getIterator) /* {{{ overloaded handlers for PDOStatement class */ static zval *dbstmt_prop_write(zend_object *object, zend_string *name, zval *value, void **cache_slot) { - pdo_stmt_t *stmt = php_pdo_stmt_fetch_object(object); - if (strcmp(ZSTR_VAL(name), "queryString") == 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only"); + zend_throw_error(NULL, "Property queryString is read only"); return value; } else { return zend_std_write_property(object, name, value, cache_slot); @@ -2047,10 +2075,8 @@ static zval *dbstmt_prop_write(zend_object *object, zend_string *name, zval *val static void dbstmt_prop_delete(zend_object *object, zend_string *name, void **cache_slot) { - pdo_stmt_t *stmt = php_pdo_stmt_fetch_object(object); - if (strcmp(ZSTR_VAL(name), "queryString") == 0) { - pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only"); + zend_throw_error(NULL, "Property queryString is read only"); } else { zend_std_unset_property(object, name, cache_slot); } @@ -2235,8 +2261,8 @@ static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter) zval_ptr_dtor(&I->fetch_ahead); } - if (!do_fetch(stmt, TRUE, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT, - PDO_FETCH_ORI_NEXT, 0, 0)) { + if (!do_fetch(stmt, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT, + PDO_FETCH_ORI_NEXT, /* offset */ 0, NULL)) { PDO_HANDLE_STMT_ERR(); I->key = (zend_ulong)-1; @@ -2275,8 +2301,8 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int Z_ADDREF_P(object); ZVAL_OBJ(&I->iter.data, Z_OBJ_P(object)); - if (!do_fetch(stmt, 1, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT, - PDO_FETCH_ORI_NEXT, 0, 0)) { + if (!do_fetch(stmt, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT, + PDO_FETCH_ORI_NEXT, /* offset */ 0, NULL)) { PDO_HANDLE_STMT_ERR(); I->key = (zend_ulong)-1; ZVAL_UNDEF(&I->fetch_ahead); @@ -2307,7 +2333,7 @@ static zval *row_prop_read(zend_object *object, zend_string *name, int type, voi * numbers */ for (colno = 0; colno < stmt->column_count; colno++) { if (ZSTR_LEN(stmt->columns[colno].name) == ZSTR_LEN(name) && - strncmp(ZSTR_VAL(stmt->columns[colno].name), ZSTR_VAL(name), ZSTR_LEN(name)) == 0) { + strncmp(ZSTR_VAL(stmt->columns[colno].name), ZSTR_VAL(name), ZSTR_LEN(name)) == 0) { fetch_value(stmt, rv, colno, NULL); return rv; } @@ -2349,7 +2375,7 @@ static zval *row_dim_read(zend_object *object, zval *member, int type, zval *rv) * numbers */ for (colno = 0; colno < stmt->column_count; colno++) { if (ZSTR_LEN(stmt->columns[colno].name) == Z_STRLEN_P(member) && - strncmp(ZSTR_VAL(stmt->columns[colno].name), Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) { + strncmp(ZSTR_VAL(stmt->columns[colno].name), Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) { fetch_value(stmt, rv, colno, NULL); return rv; } @@ -2366,13 +2392,13 @@ static zval *row_dim_read(zend_object *object, zval *member, int type, zval *rv) static zval *row_prop_write(zend_object *object, zend_string *name, zval *value, void **cache_slot) { - php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set"); + zend_throw_error(NULL, "Cannot write to PDORow property"); return value; } static void row_dim_write(zend_object *object, zval *member, zval *value) { - php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set"); + zend_throw_error(NULL, "Cannot write to PDORow offset"); } static int row_prop_exists(zend_object *object, zend_string *name, int check_empty, void **cache_slot) @@ -2391,7 +2417,7 @@ static int row_prop_exists(zend_object *object, zend_string *name, int check_emp * numbers */ for (colno = 0; colno < stmt->column_count; colno++) { if (ZSTR_LEN(stmt->columns[colno].name) == ZSTR_LEN(name) && - strncmp(ZSTR_VAL(stmt->columns[colno].name), ZSTR_VAL(name), ZSTR_LEN(name)) == 0) { + strncmp(ZSTR_VAL(stmt->columns[colno].name), ZSTR_VAL(name), ZSTR_LEN(name)) == 0) { int res; zval val; @@ -2431,7 +2457,7 @@ static int row_dim_exists(zend_object *object, zval *member, int check_empty) * numbers */ for (colno = 0; colno < stmt->column_count; colno++) { if (ZSTR_LEN(stmt->columns[colno].name) == Z_STRLEN_P(member) && - strncmp(ZSTR_VAL(stmt->columns[colno].name), Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) { + strncmp(ZSTR_VAL(stmt->columns[colno].name), Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) { int res; zval val; @@ -2449,12 +2475,12 @@ static int row_dim_exists(zend_object *object, zval *member, int check_empty) static void row_prop_delete(zend_object *object, zend_string *offset, void **cache_slot) { - php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow"); + zend_throw_error(NULL, "Cannot unset PDORow property"); } static void row_dim_delete(zend_object *object, zval *offset) { - php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow"); + zend_throw_error(NULL, "Cannot unset PDORow offset"); } static HashTable *row_get_properties_for(zend_object *object, zend_prop_purpose purpose) diff --git a/ext/pdo/pdo_stmt.stub.php b/ext/pdo/pdo_stmt.stub.php index b280f73ffdb3d..eccd22d7d9541 100644 --- a/ext/pdo/pdo_stmt.stub.php +++ b/ext/pdo/pdo_stmt.stub.php @@ -5,61 +5,61 @@ class PDOStatement implements IteratorAggregate { /** @return bool */ - public function bindColumn(string|int $column, mixed &$param, int $type = 0, int $maxlen = 0, mixed $driverdata = null) {} + public function bindColumn(string|int $column, mixed &$param, int $type = 0, int $max_length = 0, mixed $driver_options = null) {} /** @return bool */ - public function bindParam(string|int $parameter, mixed &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, mixed $driverdata = null) {} + public function bindParam(string|int $param, mixed &$bind_var, int $type = PDO::PARAM_STR, int $max_length = 0, mixed $driver_options = null) {} /** @return bool */ - public function bindValue(string|int $parameter, mixed $value, int $type = PDO::PARAM_STR) {} + public function bindValue(string|int $param, mixed $value, int $type = PDO::PARAM_STR) {} /** @return bool */ public function closeCursor() {} - /** @return int|false */ + /** @return int */ public function columnCount() {} /** @return bool|null */ public function debugDumpParams() {} - /** @return string|false|null */ + /** @return string|null */ public function errorCode() {} - /** @return array|false */ + /** @return array */ public function errorInfo() {} /** @return bool */ public function execute(?array $input_parameters = null) {} /** @return mixed */ - public function fetch(int $fetch_style = PDO::FETCH_BOTH, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset = 0) {} + public function fetch(int $mode = PDO::FETCH_BOTH, int $cursor_orientation = PDO::FETCH_ORI_NEXT, int $cursor_offset = 0) {} - /** @return array|false */ - public function fetchAll(int $fetch_style = PDO::FETCH_BOTH, mixed ...$fetch_args) {} + /** @return array */ + public function fetchAll(int $mode = PDO::FETCH_BOTH, mixed ...$args) {} /** @return mixed */ - public function fetchColumn(int $column_number = 0) {} + public function fetchColumn(int $index = 0) {} /** @return mixed */ - public function fetchObject(?string $class_name = "stdClass", ?array $ctor_args = null) {} + public function fetchObject(?string $class = "stdClass", ?array $constructor_args = null) {} /** @return mixed */ - public function getAttribute(int $attribute) {} + public function getAttribute(int $name) {} /** @return array|false */ - public function getColumnMeta(int $column) {} + public function getColumnMeta(int $index) {} /** @return bool */ public function nextRowset() {} - /** @return int|false */ + /** @return int */ public function rowCount() {} /** @return bool */ public function setAttribute(int $attribute, mixed $value) {} /** @return bool */ - public function setFetchMode(int $mode, mixed ...$params) {} + public function setFetchMode(int $mode, mixed ...$fetch_mode_args) {} public function getIterator(): Iterator {} } diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h index 116449ad3aefe..f55c1ea848d19 100644 --- a/ext/pdo/pdo_stmt_arginfo.h +++ b/ext/pdo/pdo_stmt_arginfo.h @@ -1,24 +1,24 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a35e66ccff5e569f07ae8372e661e005943dfbc7 */ + * Stub hash: b3338fc077eab1280da093f059fac14dd7f19678 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2) ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(1, param, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverdata, IS_MIXED, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driver_options, IS_MIXED, 0, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2) - ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_STRING|MAY_BE_LONG, NULL) - ZEND_ARG_TYPE_INFO(1, param, IS_MIXED, 0) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL) + ZEND_ARG_TYPE_INFO(1, bind_var, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverdata, IS_MIXED, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driver_options, IS_MIXED, 0, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 0, 2) - ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_STRING|MAY_BE_LONG, NULL) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_STRING|MAY_BE_LONG, NULL) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR") ZEND_END_ARG_INFO() @@ -39,31 +39,31 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_execute, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetch, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_style, IS_LONG, 0, "PDO::FETCH_BOTH") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PDO::FETCH_BOTH") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cursor_orientation, IS_LONG, 0, "PDO::FETCH_ORI_NEXT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cursor_offset, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchAll, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetch_style, IS_LONG, 0, "PDO::FETCH_BOTH") - ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_args, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PDO::FETCH_BOTH") + ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchColumn, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column_number, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, index, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_fetchObject, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 1, "\"stdClass\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ctor_args, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class, IS_STRING, 1, "\"stdClass\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructor_args, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_getAttribute, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, attribute, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_getColumnMeta, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_PDOStatement_nextRowset arginfo_class_PDOStatement_closeCursor @@ -77,7 +77,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_setFetchMode, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, params, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, fetch_mode_args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_PDOStatement_getIterator, 0, 0, Iterator, 0) diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h index 9d9e73915dfc6..89cd22c8e8baf 100644 --- a/ext/pdo/php_pdo.h +++ b/ext/pdo/php_pdo.h @@ -53,11 +53,11 @@ PHP_MINFO_FUNCTION(pdo); #define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \ zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1); -#define PDO_CONSTRUCT_CHECK \ - if (!dbh->driver) { \ - pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called"); \ - return; \ - } \ +#define PDO_CONSTRUCT_CHECK \ + if (!dbh->driver) { \ + zend_throw_error(NULL, "PDO object is not initialized, constructor was not called"); \ + RETURN_THROWS(); \ + } \ #endif /* PHP_PDO_H */ diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 7fe3bfc85023f..7f992a5fd0de2 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -40,7 +40,8 @@ void pdo_dbstmt_free_storage(zend_object *std); zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref); extern zend_object_handlers pdo_dbstmt_object_handlers; int pdo_stmt_describe_columns(pdo_stmt_t *stmt); -int pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long fetch_mode, zval *args, uint32_t num_args); +bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_arg_num, + zval *args, uint32_t variadic_num_args); extern zend_object *pdo_row_new(zend_class_entry *ce); extern const zend_function_entry pdo_row_functions[]; diff --git a/ext/pdo/tests/bug_44159.phpt b/ext/pdo/tests/bug_44159.phpt index 0e1116d58863e..b5601eed41c47 100644 --- a/ext/pdo/tests/bug_44159.phpt +++ b/ext/pdo/tests/bug_44159.phpt @@ -2,51 +2,46 @@ PDO Common: Bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)) --SKIPIF-- --FILE-- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); -$attrs = array(PDO::ATTR_STATEMENT_CLASS, PDO::ATTR_STRINGIFY_FETCHES, PDO::NULL_TO_STRING); +$attrs = array(PDO::ATTR_STATEMENT_CLASS, PDO::ATTR_STRINGIFY_FETCHES); foreach ($attrs as $attr) { - var_dump($pdo->setAttribute($attr, NULL)); - var_dump($pdo->setAttribute($attr, 1)); - var_dump($pdo->setAttribute($attr, 'nonsense')); + try { + var_dump($pdo->setAttribute($attr, NULL)); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } + try { + var_dump($pdo->setAttribute($attr, 1)); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } + try { + var_dump($pdo->setAttribute($attr, 'nonsense')); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } } @unlink(__DIR__."/foo.db"); ?> ---EXPECTF-- -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: attribute value must be an integer in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) -bool(true) -bool(true) -bool(true) +--EXPECT-- +TypeError: PDO::ATTR_STATEMENT_CLASS value must be of type array, null given +TypeError: PDO::ATTR_STATEMENT_CLASS value must be of type array, int given +TypeError: PDO::ATTR_STATEMENT_CLASS value must be of type array, string given +TypeError: Attribute value must be of type int for selected attribute, null given bool(true) bool(true) diff --git a/ext/pdo/tests/bug_44173.phpt b/ext/pdo/tests/bug_44173.phpt index df98f332fe188..0baa7973e5a70 100644 --- a/ext/pdo/tests/bug_44173.phpt +++ b/ext/pdo/tests/bug_44173.phpt @@ -19,8 +19,12 @@ $db->exec("INSERT INTO test VALUES (1)"); // Bug entry [2] -- 1 is PDO::FETCH_LAZY -$stmt = $db->query("SELECT * FROM test", PDO::FETCH_LAZY, 0, 0); -var_dump($stmt); +try { + $stmt = $db->query("SELECT * FROM test", PDO::FETCH_LAZY, 0, []); + var_dump($stmt); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} // Bug entry [3] @@ -31,39 +35,46 @@ try { } // Bug entry [4] -$stmt = $db->query("SELECT * FROM test", PDO::FETCH_CLASS, 0, 0, 0); -var_dump($stmt); +try { + $stmt = $db->query("SELECT * FROM test", PDO::FETCH_CLASS, 0, 0, 0); + var_dump($stmt); +} catch (\ArgumentCountError $e) { + echo $e->getMessage(), \PHP_EOL; +} // Bug entry [5] -$stmt = $db->query("SELECT * FROM test", PDO::FETCH_INTO); -var_dump($stmt); +try { + $stmt = $db->query("SELECT * FROM test", PDO::FETCH_INTO); + var_dump($stmt); +} catch (\ArgumentCountError $e) { + echo $e->getMessage(), \PHP_EOL; +} // Bug entry [6] -$stmt = $db->query("SELECT * FROM test", PDO::FETCH_COLUMN); -var_dump($stmt); +try { + $stmt = $db->query("SELECT * FROM test", PDO::FETCH_COLUMN); + var_dump($stmt); +} catch (\ArgumentCountError $e) { + echo $e->getMessage(), \PHP_EOL; +} // Bug entry [7] -$stmt = $db->query("SELECT * FROM test", PDO::FETCH_CLASS); -var_dump($stmt); +try { + $stmt = $db->query("SELECT * FROM test", PDO::FETCH_CLASS); + var_dump($stmt); +} catch (\ArgumentCountError $e) { + echo $e->getMessage(), \PHP_EOL; +} ?> ---EXPECTF-- -Warning: PDO::query(): SQLSTATE[HY000]: General error: fetch mode doesn't allow any extra arguments in %s -bool(false) +--EXPECT-- +PDO::query() expects exactly 2 arguments for the fetch mode provided, 4 given PDO::query(): Argument #2 ($fetch_mode) must be of type ?int, string given - -Warning: PDO::query(): SQLSTATE[HY000]: General error: too many arguments in %s -bool(false) - -Warning: PDO::query(): SQLSTATE[HY000]: General error: fetch mode requires the object parameter in %s -bool(false) - -Warning: PDO::query(): SQLSTATE[HY000]: General error: fetch mode requires the colno argument in %s -bool(false) - -Warning: PDO::query(): SQLSTATE[HY000]: General error: fetch mode requires the classname argument in %s -bool(false) +PDO::query() expects at most 4 arguments for the fetch mode provided, 5 given +PDO::query() expects exactly 3 arguments for the fetch mode provided, 2 given +PDO::query() expects exactly 3 arguments for the fetch mode provided, 2 given +PDO::query() expects at least 3 arguments for the fetch mode provided, 2 given diff --git a/ext/pdo/tests/pdo_035.phpt b/ext/pdo/tests/pdo_035.phpt index c35c50432d2d4..81e2b9e451b6d 100644 --- a/ext/pdo/tests/pdo_035.phpt +++ b/ext/pdo/tests/pdo_035.phpt @@ -16,7 +16,33 @@ $result = $stmt->fetch(PDO::FETCH_LAZY); echo get_class($result), "\n"; var_dump(get_parent_class($result)); + +try { + $result->foo = 1; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +try { + $result[0] = 1; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +try { + unset($result->foo); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} +try { + unset($result[0]); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + ?> --EXPECT-- PDORow bool(false) +Cannot write to PDORow property +Cannot write to PDORow offset +Cannot unset PDORow property +Cannot unset PDORow offset diff --git a/ext/pdo/tests/pdo_038.phpt b/ext/pdo/tests/pdo_038.phpt index 3ff2d090a8580..a2887f35dbf89 100644 --- a/ext/pdo/tests/pdo_038.phpt +++ b/ext/pdo/tests/pdo_038.phpt @@ -32,14 +32,19 @@ switch ($conn->getAttribute(PDO::ATTR_DRIVER_NAME)) { $stmt = $conn->prepare($query); -var_dump(fetchColumn($stmt, -1)); +try { + var_dump(fetchColumn($stmt, -1)); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} var_dump(fetchColumn($stmt, 0)); -var_dump(fetchColumn($stmt, 1)); +try { + var_dump(fetchColumn($stmt, 1)); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} ?> ---EXPECTF-- -Warning: PDOStatement::fetchColumn(): SQLSTATE[HY000]: General error: Invalid column index in %s -bool(false) +--EXPECT-- +Column index must be greater than or equal to 0 string(1) "1" - -Warning: PDOStatement::fetchColumn(): SQLSTATE[HY000]: General error: Invalid column index in %s -bool(false) +Invalid column index diff --git a/ext/pdo/tests/pdo_quote_empty_string.phpt b/ext/pdo/tests/pdo_quote_empty_string.phpt new file mode 100644 index 0000000000000..214d1014b9713 --- /dev/null +++ b/ext/pdo/tests/pdo_quote_empty_string.phpt @@ -0,0 +1,31 @@ +--TEST-- +PDO::quote() must accept empty string for drivers which support this feature +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +try { + $result = $pdo->quote(''); + if (!is_string($result)) { + var_dump($result); + } +} catch (\PDOException) { + // Do nothing as quoting is not supported with this driver +} +?> +DONE + +--EXPECT-- +DONE diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 4eb4f10ee00b2..c27a9e2ed553a 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -32,6 +32,428 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, size_t, XSQLDA*, isc_stmt_handle*, HashTable*); +const char CHR_LETTER = 1; +const char CHR_DIGIT = 2; +const char CHR_IDENT = 4; +const char CHR_QUOTE = 8; +const char CHR_WHITE = 16; +const char CHR_HEX = 32; +const char CHR_INTRODUCER = 64; + +static const char classes_array[] = { + /* 000 */ 0, + /* 001 */ 0, + /* 002 */ 0, + /* 003 */ 0, + /* 004 */ 0, + /* 005 */ 0, + /* 006 */ 0, + /* 007 */ 0, + /* 008 */ 0, + /* 009 */ 16, /* CHR_WHITE */ + /* 010 */ 16, /* CHR_WHITE */ + /* 011 */ 0, + /* 012 */ 0, + /* 013 */ 16, /* CHR_WHITE */ + /* 014 */ 0, + /* 015 */ 0, + /* 016 */ 0, + /* 017 */ 0, + /* 018 */ 0, + /* 019 */ 0, + /* 020 */ 0, + /* 021 */ 0, + /* 022 */ 0, + /* 023 */ 0, + /* 024 */ 0, + /* 025 */ 0, + /* 026 */ 0, + /* 027 */ 0, + /* 028 */ 0, + /* 029 */ 0, + /* 030 */ 0, + /* 031 */ 0, + /* 032 */ 16, /* CHR_WHITE */ + /* 033 ! */ 0, + /* 034 " */ 8, /* CHR_QUOTE */ + /* 035 # */ 0, + /* 036 $ */ 4, /* CHR_IDENT */ + /* 037 % */ 0, + /* 038 & */ 0, + /* 039 ' */ 8, /* CHR_QUOTE */ + /* 040 ( */ 0, + /* 041 ) */ 0, + /* 042 * */ 0, + /* 043 + */ 0, + /* 044 , */ 0, + /* 045 - */ 0, + /* 046 . */ 0, + /* 047 / */ 0, + /* 048 0 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 049 1 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 050 2 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 051 3 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 052 4 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 053 5 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 054 6 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 055 7 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 056 8 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 057 9 */ 38, /* CHR_DIGIT | CHR_IDENT | CHR_HEX */ + /* 058 : */ 0, + /* 059 ; */ 0, + /* 060 < */ 0, + /* 061 = */ 0, + /* 062 > */ 0, + /* 063 ? */ 0, + /* 064 @ */ 0, + /* 065 A */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 066 B */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 067 C */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 068 D */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 069 E */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 070 F */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 071 G */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 072 H */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 073 I */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 074 J */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 075 K */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 076 L */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 077 M */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 078 N */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 079 O */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 080 P */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 081 Q */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 082 R */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 083 S */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 084 T */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 085 U */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 086 V */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 087 W */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 088 X */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 089 Y */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 090 Z */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 091 [ */ 0, + /* 092 \ */ 0, + /* 093 ] */ 0, + /* 094 ^ */ 0, + /* 095 _ */ 65, /* CHR_IDENT | CHR_INTRODUCER */ + /* 096 ` */ 0, + /* 097 a */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 098 b */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 099 c */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 100 d */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 101 e */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 102 f */ 37, /* CHR_LETTER | CHR_IDENT | CHR_HEX */ + /* 103 g */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 104 h */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 105 i */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 106 j */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 107 k */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 108 l */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 109 m */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 110 n */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 111 o */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 112 p */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 113 q */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 114 r */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 115 s */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 116 t */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 117 u */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 118 v */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 119 w */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 120 x */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 121 y */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 122 z */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 123 { */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 124 | */ 0, + /* 125 } */ 5, /* CHR_LETTER | CHR_IDENT */ + /* 126 ~ */ 0, + /* 127 */ 0 +}; + +inline char classes(char idx) +{ + if (idx > 127) return 0; + return classes_array[idx]; +} + +typedef enum { + ttNone, + ttWhite, + ttComment, + ttBrokenComment, + ttString, + ttParamMark, + ttIdent, + ttOther +} FbTokenType; + +static FbTokenType getToken(const char** begin, const char* end) +{ + FbTokenType ret = ttNone; + const char* p = *begin; + + char c = *p++; + switch (c) + { + case ':': + case '?': + ret = ttParamMark; + break; + + case '\'': + case '"': + while (p < end) + { + if (*p++ == c) + { + ret = ttString; + break; + } + } + break; + + case '/': + if (p < end && *p == '*') + { + ret = ttBrokenComment; + p++; + while (p < end) + { + if (*p++ == '*' && p < end && *p == '/') + { + p++; + ret = ttComment; + break; + } + } + } + else { + ret = ttOther; + } + break; + + case '-': + if (p < end && *p == '-') + { + while (++p < end) + { + if (*p == '\r') + { + p++; + if (p < end && *p == '\n') + p++; + break; + } + else if (*p == '\n') + break; + } + + ret = ttComment; + } + else + ret = ttOther; + break; + + default: + if (classes(c) & CHR_DIGIT) + { + while (p < end && (classes(*p) & CHR_DIGIT)) + p++; + ret = ttOther; + } + else if (classes(c) & CHR_IDENT) + { + while (p < end && (classes(*p) & CHR_IDENT)) + p++; + ret = ttIdent; + } + else if (classes(c) & CHR_WHITE) + { + while (p < end && (classes(*p) & CHR_WHITE)) + p++; + ret = ttWhite; + } + else + { + while (p < end && !(classes(*p) & (CHR_DIGIT | CHR_IDENT | CHR_WHITE)) && + (*p != '/') && (*p != '-') && (*p != ':') && (*p != '?') && + (*p != '\'') && (*p != '"')) + { + p++; + } + ret = ttOther; + } + } + + *begin = p; + return ret; +} + +int preprocess(const char* sql, int sql_len, char* sql_out, HashTable* named_params) +{ + zend_bool passAsIs = 1, execBlock = 0; + zend_long pindex = -1; + char pname[254], ident[253], ident2[253]; + unsigned int l; + const char* p = sql, * end = sql + sql_len; + const char* start = p; + FbTokenType tok = getToken(&p, end); + + const char* i = start; + while (p < end && (tok == ttComment || tok == ttWhite)) + { + i = p; + tok = getToken(&p, end); + } + + if (p >= end || tok != ttIdent) + { + /* Execute statement preprocess SQL error */ + /* Statement expected */ + return 0; + } + /* skip leading comments ?? */ + start = i; + l = p - i; + /* check the length of the identifier */ + /* in Firebird 4.0 it is 63 characters, in previous versions 31 bytes */ + if (l > 252) { + return 0; + } + strncpy(ident, i, l); + ident[l] = '\0'; + if (!strcasecmp(ident, "EXECUTE")) + { + /* For EXECUTE PROCEDURE and EXECUTE BLOCK statements, named parameters must be processed. */ + /* However, in EXECUTE BLOCK this is done in a special way. */ + const char* i2 = p; + tok = getToken(&p, end); + while (p < end && (tok == ttComment || tok == ttWhite)) + { + i2 = p; + tok = getToken(&p, end); + } + if (p >= end || tok != ttIdent) + { + /* Execute statement preprocess SQL error */ + /* Statement expected */ + return 0; + } + l = p - i2; + /* check the length of the identifier */ + /* in Firebird 4.0 it is 63 characters, in previous versions 31 bytes */ + if (l > 252) { + return 0; + } + strncpy(ident2, i2, l); + ident2[l] = '\0'; + execBlock = !strcasecmp(ident2, "BLOCK"); + passAsIs = 0; + } + else + { + /* Named parameters must be processed in the INSERT, UPDATE, DELETE, MERGE statements. */ + /* If CTEs are present in the query, they begin with the WITH keyword. */ + passAsIs = strcasecmp(ident, "INSERT") && strcasecmp(ident, "UPDATE") && + strcasecmp(ident, "DELETE") && strcasecmp(ident, "MERGE") && + strcasecmp(ident, "SELECT") && strcasecmp(ident, "WITH"); + } + + if (passAsIs) + { + strcpy(sql_out, sql); + return 1; + } + + strncat(sql_out, start, p - start); + + while (p < end) + { + start = p; + tok = getToken(&p, end); + switch (tok) + { + case ttParamMark: + tok = getToken(&p, end); + if (tok == ttIdent /*|| tok == ttString*/) + { + ++pindex; + l = p - start; + /* check the length of the identifier */ + /* in Firebird 4.0 it is 63 characters, in previous versions 31 bytes */ + /* + symbol ":" */ + if (l > 253) { + return 0; + } + strncpy(pname, start, l); + pname[l] = '\0'; + + if (named_params) { + zval tmp; + ZVAL_LONG(&tmp, pindex); + zend_hash_str_update(named_params, pname, l, &tmp); + } + + strcat(sql_out, "?"); + } + else + { + if (strncmp(start, "?", 1)) { + /* Execute statement preprocess SQL error */ + /* Parameter name expected */ + return 0; + } + ++pindex; + strncat(sql_out, start, p - start); + } + break; + + case ttIdent: + if (execBlock) + { + /* In the EXECUTE BLOCK statement, processing must be */ + /* carried out up to the keyword AS. */ + l = p - start; + /* check the length of the identifier */ + /* in Firebird 4.0 it is 63 characters, in previous versions 31 bytes */ + if (l > 252) { + return 0; + } + strncpy(ident, start, l); + ident[l] = '\0'; + if (!strcasecmp(ident, "AS")) + { + strncat(sql_out, start, end - start); + return 1; + } + } + + case ttWhite: + case ttComment: + case ttString: + case ttOther: + strncat(sql_out, start, p - start); + break; + + case ttBrokenComment: + { + /* Execute statement preprocess SQL error */ + /* Unclosed comment found near ''@1'' */ + return 0; + } + break; + + + case ttNone: + /* Execute statement preprocess SQL error */ + return 0; + break; + } + } + return 1; +} + /* map driver specific error message to PDO error */ void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line) /* {{{ */ { @@ -352,8 +774,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, size_t s XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params) { pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - char *c, *new_sql, in_quote, in_param, pname[64], *ppname; - zend_long l, pindex = -1; + char *new_sql; /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */ if (sql_len > 65536) { @@ -379,39 +800,12 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, size_t s /* in order to support named params, which Firebird itself doesn't, we need to replace :foo by ?, and store the name we just replaced */ - new_sql = c = emalloc(sql_len+1); - - for (l = in_quote = in_param = 0; l <= sql_len; ++l) { - if ( !(in_quote ^= (sql[l] == '\''))) { - if (!in_param) { - switch (sql[l]) { - case ':': - in_param = 1; - ppname = pname; - *ppname++ = sql[l]; - case '?': - *c++ = '?'; - ++pindex; - continue; - } - } else { - if ((in_param &= ((sql[l] >= 'A' && sql[l] <= 'Z') || (sql[l] >= 'a' && sql[l] <= 'z') - || (sql[l] >= '0' && sql[l] <= '9') || sql[l] == '_' || sql[l] == '-'))) { - - - *ppname++ = sql[l]; - continue; - } else { - *ppname++ = 0; - if (named_params) { - zval tmp; - ZVAL_LONG(&tmp, pindex); - zend_hash_str_update(named_params, pname, (unsigned int)(ppname - pname - 1), &tmp); - } - } - } - } - *c++ = sql[l]; + new_sql = emalloc(sql_len+1); + new_sql[0] = '\0'; + if (!preprocess(sql, sql_len, new_sql, named_params)) { + strcpy(dbh->error_code, "07000"); + efree(new_sql); + return 0; } /* prepare the statement */ diff --git a/ext/pdo_firebird/tests/execute_block.phpt b/ext/pdo_firebird/tests/execute_block.phpt new file mode 100644 index 0000000000000..fe01acb0a83b4 --- /dev/null +++ b/ext/pdo_firebird/tests/execute_block.phpt @@ -0,0 +1,41 @@ +--TEST-- +PDO_Firebird: support EXECUTE BLOCK +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); + + $sql = ' +execute block (a int = :e, b int = :d) +returns (N int, M int) +as +declare z int; +begin + select 10 + from rdb$database + into :z; + + n = a + b + z; + m = z * a; + suspend; +end +'; + $query = $dbh->prepare($sql); + $query->execute(['d' => 1, 'e' => 2]); + $row = $query->fetch(\PDO::FETCH_OBJ); + var_dump($row->N); + var_dump($row->M); + + unset($query); + unset($dbh); + echo "done\n"; + +?> +--EXPECT-- +int(13) +int(20) +done diff --git a/ext/pdo_firebird/tests/ignore_parammarks.phpt b/ext/pdo_firebird/tests/ignore_parammarks.phpt new file mode 100644 index 0000000000000..01764492047cd --- /dev/null +++ b/ext/pdo_firebird/tests/ignore_parammarks.phpt @@ -0,0 +1,42 @@ +--TEST-- +PDO_Firebird: ingnore parameter marks in comments +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); + + $sql = ' +select 1 as n +-- :f +from rdb$database +where 1=:d and 2=:e +'; + $query = $dbh->prepare($sql); + $query->execute(['d' => 1, 'e' => 2]); + $row = $query->fetch(\PDO::FETCH_OBJ); + var_dump($row->N); + unset($query); + + $sql = ' +select 1 as n +from rdb$database +where 1=:d /* and :f = 5 */ and 2=:e +'; + $query = $dbh->prepare($sql); + $query->execute(['d' => 1, 'e' => 2]); + $row = $query->fetch(\PDO::FETCH_OBJ); + var_dump($row->N); + unset($query); + + unset($dbh); + echo "done\n"; + +?> +--EXPECT-- +int(1) +int(1) +done diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 95f719a6150f3..a666489a503f9 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -532,6 +532,21 @@ static void pdo_mysql_request_shutdown(pdo_dbh_t *dbh) } /* }}} */ +#ifdef PDO_USE_MYSQLND +# define pdo_mysql_get_server_status(m) mysqlnd_get_server_status(m) +#else +# define pdo_mysql_get_server_status(m) (m)->server_status +#endif + +/* {{{ pdo_mysql_in_transaction */ +static int pdo_mysql_in_transaction(pdo_dbh_t *dbh) +{ + pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; + PDO_DBG_ENTER("pdo_mysql_in_transaction"); + PDO_DBG_RETURN((pdo_mysql_get_server_status(H->server) & SERVER_STATUS_IN_TRANS) != 0); +} +/* }}} */ + /* {{{ mysql_methods */ static const struct pdo_dbh_methods mysql_methods = { mysql_handle_closer, @@ -548,7 +563,7 @@ static const struct pdo_dbh_methods mysql_methods = { pdo_mysql_check_liveness, NULL, pdo_mysql_request_shutdown, - NULL + pdo_mysql_in_transaction }; /* }}} */ diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt index b3251e335a953..ca321443e3d78 100644 --- a/ext/pdo_mysql/tests/bug_37445.phpt +++ b/ext/pdo_mysql/tests/bug_37445.phpt @@ -17,7 +17,7 @@ $stmt = $db->prepare("SELECT 1"); $stmt->bindParam(':a', 'b'); ?> --EXPECTF-- -Fatal error: Uncaught Error: PDOStatement::bindParam(): Argument #2 ($param) cannot be passed by reference in %sbug_37445.php:%d +Fatal error: Uncaught Error: PDOStatement::bindParam(): Argument #2 ($bind_var) cannot be passed by reference in %sbug_37445.php:%d Stack trace: #0 {main} thrown in %sbug_37445.php on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt index 0d6cee356ebbd..d6ebd87f60327 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt @@ -14,29 +14,27 @@ error_reporting=E_ALL require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $db = MySQLPDOTest::factory(); - $valid = array(PDO::ERRMODE_SILENT, PDO::ERRMODE_WARNING, PDO::ERRMODE_EXCEPTION); - do { - $invalid = mt_rand(-1000, 1000); - } while (in_array($invalid, $valid)); - - - $tmp = array(); - if (false != @$db->setAttribute(PDO::ATTR_ERRMODE, $tmp)) - printf("[001] Maybe PDO could indicate that this is not a proper way of setting the ERRMODE...\n"); - - $tmp = new stdClass(); - $ret = @$db->setAttribute(PDO::ATTR_ERRMODE, $tmp); - if (false != $ret) - printf("[002] Maybe PDO could indicate that this is not a proper way of setting the ERRMODE...%s\n", - var_export($ret, true)); - - $ret = @$db->setAttribute(PDO::ATTR_ERRMODE, 'pdo'); - if (false != $ret) - printf("[003] Maybe PDO could indicate that this is not a proper way of setting the ERRMODE...%s\n", - var_export($ret, true)); - - if (false != @$db->setAttribute(PDO::ATTR_ERRMODE, $invalid)) - printf("[004] Invalid ERRMODE should be rejected\n"); + try { + $db->setAttribute(PDO::ATTR_ERRMODE, []); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } + try { + $db->setAttribute(PDO::ATTR_ERRMODE, new stdClass()); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } + try { + /* This currently passes */ + $db->setAttribute(PDO::ATTR_ERRMODE, 'pdo'); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } + try { + $db->setAttribute(PDO::ATTR_ERRMODE, 1000); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT); // no message for any PDO call but... @@ -160,7 +158,9 @@ error_reporting=E_ALL print "done!\n"; ?> --EXPECTF-- -[003] Maybe PDO could indicate that this is not a proper way of setting the ERRMODE...true +TypeError: Attribute value must be of type int for selected attribute, array given +TypeError: Attribute value must be of type int for selected attribute, stdClass given +ValueError: Error mode must be one of the PDO::ERRMODE_* constants Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: %d You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '%s' at line %d in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt index 694a0394415ca..6d922a037def8 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt @@ -12,16 +12,22 @@ MySQLPDOTest::skip(); $db = MySQLPDOTest::factory(); MySQLPDOTest::createTestTable($db); - $tmp = array(); - if (false !== @$db->setAttribute(PDO::ATTR_ORACLE_NULLS, $tmp)) - printf("[001] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...\n"); - - $tmp = new stdClass(); - if (false !== @$db->setAttribute(PDO::ATTR_ORACLE_NULLS, $tmp)); - printf("[002] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...\n"); - - if (false !== @$db->setAttribute(PDO::ATTR_ORACLE_NULLS, 'pdo')) - printf("[003] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...\n"); + try { + $db->setAttribute(PDO::ATTR_ORACLE_NULLS, []); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } + try { + $db->setAttribute(PDO::ATTR_ORACLE_NULLS, new stdClass()); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } + try { + /* Currently passes... */ + $db->setAttribute(PDO::ATTR_ORACLE_NULLS, 'pdo'); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } $db->setAttribute(PDO::ATTR_ORACLE_NULLS, 1); $stmt = $db->query("SELECT NULL AS z, '' AS a, ' ' AS b, TRIM(' ') as c, ' d' AS d, '" . chr(0) . " e' AS e"); @@ -82,8 +88,8 @@ MySQLPDOTest::skip(); print "done!"; ?> --EXPECTF-- -[002] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS... -[003] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS... +Attribute value must be of type int for selected attribute, array given +Attribute value must be of type int for selected attribute, stdClass given array(1) { [0]=> array(6) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt index 66df0cda459a1..77f231d28fa65 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_statement_class.phpt @@ -16,15 +16,22 @@ $db = MySQLPDOTest::factory(); $default = $db->getAttribute(PDO::ATTR_STATEMENT_CLASS); var_dump($default); - if (false !== ($tmp = @$db->setAttribute(PDO::ATTR_STATEMENT_CLASS, 'foo'))) - printf("[002] Expecting boolean/false got %s\n", var_export($tmp, true)); - - if (false !== ($tmp = @$db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('classname')))) - printf("[003] Expecting boolean/false got %s\n", var_export($tmp, true)); - + try { + $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, 'foo'); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } + try { + $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['classname']); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } // unknown class - if (false !== ($tmp = $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('classname', array())))) - printf("[004] Expecting boolean/false got %s\n", var_export($tmp, true)); + try { + $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['classname', []]); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } // class not derived from PDOStatement class myclass { @@ -32,8 +39,12 @@ $db = MySQLPDOTest::factory(); printf("myclass\n"); } } - if (false !== ($tmp = $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('myclass', array())))) - printf("[005] Expecting boolean/false got %s\n", var_export($tmp, true)); + + try { + $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['myclass', []]); + } catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; + } // public constructor not allowed class mystatement extends PDOStatement { @@ -42,8 +53,13 @@ $db = MySQLPDOTest::factory(); } } - if (false !== ($tmp = $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('mystatement', array())))) - printf("[006] Expecting boolean/false got %s\n", var_export($tmp, true)); + try { + if (false !== ($tmp = $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['mystatement', []]))) + printf("[006] Expecting boolean/false got %s\n", var_export($tmp, true)); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } + // ... but a public destructor is allowed class mystatement2 extends PDOStatement { @@ -98,29 +114,24 @@ $db = MySQLPDOTest::factory(); // Yes, this is a fatal error and I want it to fail. abstract class mystatement6 extends mystatement5 { } - if (true !== ($tmp = $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('mystatement6', array('mystatement6'))))) - printf("[011] Expecting boolean/true got %s\n", var_export($tmp, true)); - $stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 1'); + try { + $db->setAttribute(PDO::ATTR_STATEMENT_CLASS, ['mystatement6', ['mystatement6']]); + $stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 1'); + } catch (\Error $e) { + echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; + } - print "done!"; ?> ---EXPECTF-- +--EXPECT-- array(1) { [0]=> string(12) "PDOStatement" } - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: user-supplied statement class must be derived from PDOStatement in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: user-supplied statement class cannot have a public constructor in %s on line %d - -Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d +PDO::ATTR_STATEMENT_CLASS value must be of type array, string given +PDO::ATTR_STATEMENT_CLASS class must be a valid class +PDO::ATTR_STATEMENT_CLASS class must be a valid class +PDO::ATTR_STATEMENT_CLASS class must be derived from PDOStatement +TypeError: User-supplied statement class cannot have a public constructor array(2) { [0]=> string(12) "mystatement4" @@ -148,9 +159,4 @@ array(1) { string(1) "a" } } - -Fatal error: Uncaught Error: Cannot instantiate abstract class mystatement6 in %s:%d -Stack trace: -#0 %s(%d): PDO->query('SELECT id, labe...') -#1 {main} - thrown in %s on line %d +Error: Cannot instantiate abstract class mystatement6 diff --git a/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt b/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt new file mode 100644 index 0000000000000..6d82e22b1238f --- /dev/null +++ b/ext/pdo_mysql/tests/pdo_mysql_inTransaction.phpt @@ -0,0 +1,67 @@ +--TEST-- +MySQL PDO class inTransaction +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // mysql does not support +for ($b = 0; $b < count(BEGIN); $b++) { + for ($e = 0; $e < count(END); $e++) { + foreach (['exec', 'query', 'execute'] as $w) { + foreach ([BEGIN[$b], END[$e]] as $command) { + switch ($w) { + case 'exec': + $db->exec($command); + break; + case'query': + $db->query($command)->execute(); + break; + case 'execute': + /* EMULATE_PREPARES = QUERY */ + $db->prepare($command)->execute(); + break; + default: + assert(0); + } + var_dump($db->inTransaction()); + } + } + } +} + +?> +--EXPECT-- +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt index 6fe2ff20ba616..6afd57420f9f4 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt @@ -88,9 +88,11 @@ $db = MySQLPDOTest::factory(); if (1 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY)) printf("[002] Unable to switch to emulated prepared statements, test will fail\n"); - // TODO - that's PDO - you can prepare empty statements! - prepex(3, $db, '', - array(), array('execute' => array('sqlstate' => '42000'))); + try { + prepex(3, $db, '', [], ['execute' => ['sqlstate' => '42000']]); + } catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; + } // lets be fair and do the most simple SELECT first $stmt = prepex(4, $db, 'SELECT 1 as "one"'); @@ -328,6 +330,7 @@ $db->exec('DROP TABLE IF EXISTS test'); PDO's PS parser has some problems with invalid SQL and crashes from time to time (check with valgrind...) --EXPECT-- +PDO::prepare(): Argument #1 ($statement) cannot be empty array(1) { ["one"]=> string(1) "1" diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt index 5ea3e94c1e138..13534f0a1e49f 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt @@ -99,9 +99,11 @@ $db = MySQLPDOTest::factory(); if (0 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY)) printf("[002] Unable to turn off emulated prepared statements\n"); - // TODO - that's PDO - you can prepare empty statements! - prepex(3, $db, '', - array(), array('prepare' => array('sqlstate' => '42000'))); + try { + prepex(3, $db, '', [], ['prepare' => ['sqlstate' => '42000']]); + } catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; + } // lets be fair and do the most simple SELECT first $stmt = prepex(4, $db, 'SELECT 1 as "one"'); @@ -342,6 +344,7 @@ $db = MySQLPDOTest::factory(); $db->exec('DROP TABLE IF EXISTS test'); ?> --EXPECT-- +PDO::prepare(): Argument #1 ($query) cannot be empty array(1) { [0]=> array(1) { diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt index 8e9e60b99e3a6..e83a99f5290b5 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt @@ -111,5 +111,5 @@ object(myclass)#%d (4) { ["null"]=> NULL } -PDOStatement::fetchObject(): Argument #1 ($class_name) must be a valid class name, class_does_not_exist given +PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, class_does_not_exist given done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt index 44f0a0ebb18d2..61734061d9109 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt @@ -32,8 +32,11 @@ try { $stmt->execute(); // invalid offset - if (false !== ($tmp = @$stmt->getColumnMeta(-1))) - printf("[004] Expecting false got %s\n", var_export($tmp, true)); + try { + $stmt->getColumnMeta(-1); + } catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; + } $emulated = $stmt->getColumnMeta(0); @@ -299,5 +302,6 @@ $db->exec('DROP TABLE IF EXISTS test'); print "done!"; ?> --EXPECT-- +PDOStatement::getColumnMeta(): Argument #1 ($index) must be greater than or equal to 0 Testing native PS... done! diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt index c8f188a738908..eac4b9e4d80af 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt @@ -33,10 +33,6 @@ if (!MySQLPDOTest::isPDOMySQLnd()) if (false !== ($tmp = $stmt->nextRowSet())) printf("[002] Expecting false got %s\n", var_export($tmp, true)); - // TODO: should give a warning, but its PDO, let's ignore the missing warning for now - if (false !== ($tmp = $stmt->nextRowSet(1))) - printf("[003] Expecting false got %s\n", var_export($tmp, true)); - function test_proc1($db) { $stmt = $db->query('SELECT @VERSION as _version'); diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 5b35455ede1b3..9a254553d5b31 100644 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -177,6 +177,8 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len, return 0; } + stmt->driver_data = S; + cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY); if (cursor_type != PDO_CURSOR_FWDONLY) { rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0); @@ -195,7 +197,6 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_len, efree(nsql); } - stmt->driver_data = S; stmt->methods = &odbc_stmt_methods; if (rc != SQL_SUCCESS) { @@ -257,12 +258,14 @@ static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_le return row_count; } +/* TODO: Do ODBC quoter static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, size_t unquotedlen, char **quoted, size_t *quotedlen, enum pdo_param_type param_type ) { - /* pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; */ - /* TODO: figure it out */ + // pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; + // TODO: figure it out return 0; } +*/ static int odbc_handle_begin(pdo_dbh_t *dbh) { @@ -373,7 +376,7 @@ static const struct pdo_dbh_methods odbc_methods = { odbc_handle_closer, odbc_handle_preparer, odbc_handle_doer, - odbc_handle_quoter, + NULL, /* quoter */ odbc_handle_begin, odbc_handle_commit, odbc_handle_rollback, diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c index d0c2f913ff9aa..21654d4062782 100644 --- a/ext/pdo_odbc/pdo_odbc.c +++ b/ext/pdo_odbc/pdo_odbc.c @@ -87,7 +87,7 @@ PHP_MINIT_FUNCTION(pdo_odbc) } else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) { pdo_odbc_pool_on = SQL_CP_OFF; } else { - php_error_docref(NULL, E_CORE_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'"); + php_error_docref(NULL, E_CORE_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value must be one of \"strict\", \"relaxed\", or \"off\""); return FAILURE; } diff --git a/ext/pdo_odbc/tests/bug67465.phpt b/ext/pdo_odbc/tests/bug67465.phpt new file mode 100644 index 0000000000000..872ca45c505c1 --- /dev/null +++ b/ext/pdo_odbc/tests/bug67465.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #67465 (NULL Pointer dereference in odbc_handle_preparer) +--SKIPIF-- + +--FILE-- +prepare("SELECT 1", [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL]); +echo "done\n"; +?> +--EXPECT-- +done diff --git a/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt b/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt new file mode 100644 index 0000000000000..fc30f1d21cc23 --- /dev/null +++ b/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt @@ -0,0 +1,22 @@ +--TEST-- +PDO Common: Bug #44159: SQLite variant +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); + +var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, NULL)); +var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, 1)); +var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, 'nonsense')); + +@unlink(__DIR__."/foo.db"); + +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) diff --git a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt index 4600b7935be09..814a01a6472d6 100644 --- a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt +++ b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt @@ -20,20 +20,40 @@ $st->fetchAll(PDO::FETCH_FUNC, function($x, $y) use ($st) { var_dump($st); print $st = $db->query('SELECT name FROM testing'); var_dump($st->fetchAll(PDO::FETCH_FUNC, 'strtoupper')); -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, 'nothing')); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, 'nothing')); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, '')); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, '')); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, NULL)); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, NULL)); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, 1)); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, 1)); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, array('self', 'foo'))); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, array('self', 'foo'))); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} class foo { public function method($x) { @@ -64,14 +84,26 @@ new bar($db); $st = $db->query('SELECT * FROM testing'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test'))); -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test2'))); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test2'))); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test3'))); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'test3'))); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} -$st = $db->query('SELECT * FROM testing'); -var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'inexistent'))); +try { + $st = $db->query('SELECT * FROM testing'); + var_dump($st->fetchAll(PDO::FETCH_FUNC, array('bar', 'inexistent'))); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} ?> --EXPECTF-- @@ -91,31 +123,11 @@ array(2) { [1]=> string(0) "" } - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: function "nothing" not found or invalid function name in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: function "" not found or invalid function name in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: no array or string given in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: no array or string given in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: cannot access "self" when no class scope is active in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) +function "nothing" not found or invalid function name +function "" not found or invalid function name +PDOStatement::fetchAll(): Argument #2 must be a callable, null given +no array or string given +cannot access "self" when no class scope is active array(2) { [0]=> string(9) "--- 1 ---" @@ -128,18 +140,6 @@ array(2) { [1]=> string(4) "2---" } - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: non-static method bar::test2() cannot be called statically in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: non-static method bar::test3() cannot be called statically in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: class bar does not have a method "inexistent" in %s on line %d - -Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d -bool(false) +non-static method bar::test2() cannot be called statically +non-static method bar::test3() cannot be called statically +class bar does not have a method "inexistent" diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 31bb83431474d..63e59b63d695d 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1560,8 +1560,8 @@ PHP_FUNCTION(pg_field_table) } if (fnum >= PQnfields(pg_result->result)) { - php_error_docref(NULL, E_WARNING, "Bad field offset specified"); - RETURN_FALSE; + zend_argument_value_error(2, "must be less than the number of fields for this result set"); + RETURN_THROWS(); } oid = PQftable(pg_result->result, (int)fnum); @@ -1650,8 +1650,8 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ pgsql_result = pg_result->result; if (field >= PQnfields(pgsql_result)) { - php_error_docref(NULL, E_WARNING, "Bad field offset specified"); - RETURN_FALSE; + zend_argument_value_error(2, "must be less than the number of fields for this result set"); + RETURN_THROWS(); } switch (entry_type) { @@ -1728,6 +1728,29 @@ PHP_FUNCTION(pg_field_num) } /* }}} */ +static zend_long field_arg_to_offset( + PGresult *result, zend_string *field_name, zend_long field_offset, int arg_num) { + if (field_name) { + field_offset = PQfnumber(result, ZSTR_VAL(field_name)); + if (field_offset < 0) { + /* Avoid displaying the argument name, as the signature is overloaded and the name + * might not line up. */ + zend_value_error("Argument #%d must be a field name from this result set", arg_num); + return -1; + } + } else { + if (field_offset < 0) { + zend_value_error("Argument #%d must be greater than or equal to 0", arg_num); + return -1; + } + if (field_offset >= PQnfields(result)) { + zend_value_error("Argument #%d must be less than the number of fields for this result set", arg_num); + return -1; + } + } + return field_offset; +} + /* {{{ Returns values from a result identifier */ PHP_FUNCTION(pg_fetch_result) { @@ -1777,21 +1800,10 @@ PHP_FUNCTION(pg_fetch_result) } pgsql_row = (int)row; } - if (field_name) { - field_offset = PQfnumber(pgsql_result, ZSTR_VAL(field_name)); - if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - } else { - if (field_offset < 0) { - zend_argument_value_error(argc, "must be greater than or equal to 0"); - RETURN_THROWS(); - } - if (field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } + + field_offset = field_arg_to_offset(pgsql_result, field_name, field_offset, argc); + if (field_offset < 0) { + RETURN_THROWS(); } if (PQgetisnull(pgsql_result, pgsql_row, field_offset)) { @@ -2003,10 +2015,7 @@ PHP_FUNCTION(pg_fetch_all) pgsql_result = pg_result->result; array_init(return_value); - if (php_pgsql_result2array(pgsql_result, return_value, result_type) == FAILURE) { - zend_array_destroy(Z_ARR_P(return_value)); - RETURN_FALSE; - } + php_pgsql_result2array(pgsql_result, return_value, result_type); } /* }}} */ @@ -2037,8 +2046,8 @@ PHP_FUNCTION(pg_fetch_all_columns) num_fields = PQnfields(pgsql_result); if (colno >= (zend_long)num_fields) { - php_error_docref(NULL, E_WARNING, "Invalid column number '" ZEND_LONG_FMT "'", colno); - RETURN_FALSE; + zend_argument_value_error(2, "must be less than the number of fields for this result set"); + RETURN_THROWS(); } array_init(return_value); @@ -2134,20 +2143,9 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) pgsql_row = (int)row; } - if (field_name) { - field_offset = PQfnumber(pgsql_result, ZSTR_VAL(field_name)); - if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } - } else { - if (field_offset < 0) { - zend_argument_value_error(argc, "must be greater than or equal to 0"); - } - if (field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } + field_offset = field_arg_to_offset(pgsql_result, field_name, field_offset, argc); + if (field_offset < 0) { + RETURN_THROWS(); } switch (entry_type) { @@ -2302,6 +2300,7 @@ PHP_FUNCTION(pg_lo_create) RETURN_THROWS(); } + /* Overloaded method uses default link if arg 1 is not a resource, set oid pointer */ if ((argc == 1) && (Z_TYPE_P(pgsql_link) != IS_RESOURCE)) { oid = pgsql_link; pgsql_link = NULL; @@ -2324,25 +2323,26 @@ PHP_FUNCTION(pg_lo_create) switch (Z_TYPE_P(oid)) { case IS_STRING: { + /* TODO: Use subroutine? */ char *end_ptr; wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10); if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Invalid OID value passed"); - RETURN_FALSE; + /* wrong integer format */ + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } } break; case IS_LONG: if (Z_LVAL_P(oid) < (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } wanted_oid = (Oid)Z_LVAL_P(oid); break; default: - php_error_docref(NULL, E_NOTICE, "Invalid OID value passed"); - RETURN_FALSE; + zend_type_error("OID value must be of type string|int, %s given", zend_zval_type_name(oid)); + RETURN_THROWS(); } if ((pgsql_oid = lo_create(pgsql, wanted_oid)) == InvalidOid) { php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object"); @@ -2376,30 +2376,32 @@ PHP_FUNCTION(pg_lo_unlink) /* accept string type since Oid type is unsigned int */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rs", &pgsql_link, &oid_string, &oid_strlen) == SUCCESS) { + /* TODO: Use subroutine? */ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } link = Z_RES_P(pgsql_link); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rl", &pgsql_link, &oid_long) == SUCCESS) { if (oid_long <= (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } oid = (Oid)oid_long; link = Z_RES_P(pgsql_link); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "s", &oid_string, &oid_strlen) == SUCCESS) { + /* TODO: subroutine? */ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); @@ -2407,8 +2409,8 @@ PHP_FUNCTION(pg_lo_unlink) else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "l", &oid_long) == SUCCESS) { if (oid_long <= (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID is specified"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } oid = (Oid)oid_long; link = FETCH_DEFAULT_LINK(); @@ -2449,30 +2451,32 @@ PHP_FUNCTION(pg_lo_open) /* accept string type since Oid is unsigned int */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rss", &pgsql_link, &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) { + /* TODO: Use subroutine? */ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } link = Z_RES_P(pgsql_link); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rls", &pgsql_link, &oid_long, &mode_string, &mode_strlen) == SUCCESS) { if (oid_long <= (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } oid = (Oid)oid_long; link = Z_RES_P(pgsql_link); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "ss", &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) { + /* TODO: Use subroutine? */ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); @@ -2480,8 +2484,8 @@ PHP_FUNCTION(pg_lo_open) else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "ls", &oid_long, &mode_string, &mode_strlen) == SUCCESS) { if (oid_long <= (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } oid = (Oid)oid_long; link = FETCH_DEFAULT_LINK(); @@ -2719,25 +2723,26 @@ PHP_FUNCTION(pg_lo_import) switch (Z_TYPE_P(oid)) { case IS_STRING: { + /* TODO: Use subroutine? */ char *end_ptr; wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10); if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) { - /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Invalid OID value passed"); - RETURN_FALSE; + /* wrong integer format */ + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } } break; case IS_LONG: if (Z_LVAL_P(oid) < (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } wanted_oid = (Oid)Z_LVAL_P(oid); break; default: - php_error_docref(NULL, E_NOTICE, "Invalid OID value passed"); - RETURN_FALSE; + zend_type_error("OID value must be of type string|int, %s given", zend_zval_type_name(oid)); + RETURN_THROWS(); } returned_oid = lo_import_with_oid(pgsql, file_in, wanted_oid); @@ -2775,27 +2780,28 @@ PHP_FUNCTION(pg_lo_export) if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rlp", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) { if (oid_long <= (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } oid = (Oid)oid_long; link = Z_RES_P(pgsql_link); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rsp", &pgsql_link, &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) { + /* TODO: Use subroutine? */ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } link = Z_RES_P(pgsql_link); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "lp", &oid_long, &file_out, &name_len) == SUCCESS) { if (oid_long <= (zend_long)InvalidOid) { - php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } oid = (Oid)oid_long; link = FETCH_DEFAULT_LINK(); @@ -2803,11 +2809,12 @@ PHP_FUNCTION(pg_lo_export) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "sp", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) { + /* TODO: Use subroutine? */ oid = (Oid)strtoul(oid_string, &end_ptr, 10); if ((oid_string+oid_strlen) != end_ptr) { /* wrong integer format */ - php_error_docref(NULL, E_NOTICE, "Wrong OID value passed"); - RETURN_FALSE; + zend_value_error("Invalid OID value passed"); + RETURN_THROWS(); } link = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(link); @@ -3362,7 +3369,7 @@ PHP_FUNCTION(pg_escape_bytea) /* {{{ Unescape binary for bytea type */ PHP_FUNCTION(pg_unescape_bytea) { - char *from = NULL, *to = NULL, *tmp = NULL; + char *from, *tmp; size_t to_len; size_t from_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", @@ -3371,14 +3378,13 @@ PHP_FUNCTION(pg_unescape_bytea) } tmp = (char *)PQunescapeBytea((unsigned char*)from, &to_len); - to = estrndup(tmp, to_len); - PQfreemem(tmp); - if (!to) { - php_error_docref(NULL, E_WARNING,"Invalid parameter"); - RETURN_FALSE; + if (!tmp) { + zend_error(E_ERROR, "Out of memory"); + return; } - RETVAL_STRINGL(to, to_len); - efree(to); + + RETVAL_STRINGL(tmp, to_len); + PQfreemem(tmp); } /* }}} */ @@ -3411,11 +3417,6 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l RETURN_THROWS(); } - if (pgsql == NULL) { - php_error_docref(NULL, E_WARNING,"Cannot get pgsql link"); - RETURN_FALSE; - } - if (escape_literal) { tmp = PQescapeLiteral(pgsql, from, (size_t)from_len); } else { @@ -4272,6 +4273,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); if (!tmp_name) { + // TODO ValueError (empty table name)? efree(src); php_error_docref(NULL, E_WARNING, "The table name must be specified"); return FAILURE; @@ -4565,6 +4567,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free) } /* }}} */ +/* Raise E_NOTICE to E_WARNING or Error? */ #define PGSQL_CONV_CHECK_IGNORE() \ if (!err && Z_TYPE(new_val) == IS_STRING && !strcmp(Z_STRVAL(new_val), "NULL")) { \ /* if new_value is string "NULL" and field has default value, remove element to use default value */ \ @@ -4608,8 +4611,10 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con skip_field = 0; ZVAL_NULL(&new_val); + /* TODO: Check when meta data can be broken and see if can use assertions instead */ + if (!err && field == NULL) { - php_error_docref(NULL, E_WARNING, "Accepts only string key for values"); + zend_value_error("Array of values must be an associative array with string keys"); err = 1; } @@ -4633,8 +4638,8 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'is enum'"); err = 1; } - if (!err && (Z_TYPE_P(val) == IS_ARRAY || Z_TYPE_P(val) == IS_OBJECT)) { - php_error_docref(NULL, E_NOTICE, "Expects scalar values as field values"); + if (!err && (Z_TYPE_P(val) == IS_ARRAY || Z_TYPE_P(val) == IS_OBJECT || Z_TYPE_P(val) == IS_RESOURCE)) { + zend_type_error("Values must be of type string|int|float|bool|null, %s given", zend_zval_type_name(val)); err = 1; } if (err) { @@ -4649,6 +4654,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con data_type = php_pgsql_get_data_type(Z_STRVAL_P(type), Z_STRLEN_P(type)); } + /* TODO: Should E_NOTICE be converted to type error if PHP type cannot be converted to field type? */ switch(data_type) { case PG_BOOL: @@ -5366,7 +5372,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var ZEND_HASH_FOREACH_STR_KEY(Z_ARRVAL_P(var_array), fld) { if (fld == NULL) { - php_error_docref(NULL, E_NOTICE, "Expects associative array for values to be inserted"); + zend_value_error("Array of values must be an associative array with string keys"); goto cleanup; } if (opt & PGSQL_DML_ESCAPE) { @@ -5409,9 +5415,8 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var smart_str_appendl(&querystr, "NULL", sizeof("NULL")-1); break; default: - php_error_docref(NULL, E_WARNING, "Expects scaler values. type = %d", Z_TYPE_P(val)); + zend_type_error("Value must be of type string|int|float|null, %s given", zend_zval_type_name(val)); goto cleanup; - break; } smart_str_appendc(&querystr, ','); } ZEND_HASH_FOREACH_END(); @@ -5540,7 +5545,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, ZEND_HASH_FOREACH_STR_KEY_VAL(ht, fld, val) { if (fld == NULL) { - php_error_docref(NULL, E_NOTICE, "Expects associative array for values to be inserted"); + zend_value_error("Array of values must be an associative array with string keys"); return -1; } if (opt & PGSQL_DML_ESCAPE) { @@ -5581,7 +5586,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, smart_str_appendl(querystr, "NULL", sizeof("NULL")-1); break; default: - php_error_docref(NULL, E_WARNING, "Expects scaler values. type=%d", Z_TYPE_P(val)); + zend_type_error("Value must be of type string|int|float|null, %s given", zend_zval_type_name(val)); return -1; } smart_str_appendl(querystr, pad, pad_len); @@ -5801,7 +5806,7 @@ PHP_FUNCTION(pg_delete) /* }}} */ /* {{{ php_pgsql_result2array */ -PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) +PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long result_type) { zval row; char *field_name; @@ -5810,9 +5815,7 @@ PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array, l uint32_t i; assert(Z_TYPE_P(ret_array) == IS_ARRAY); - if ((pg_numrows = PQntuples(pg_result)) <= 0) { - return FAILURE; - } + pg_numrows = PQntuples(pg_result); for (pg_row = 0; pg_row < pg_numrows; pg_row++) { array_init(&row); for (i = 0, num_fields = PQnfields(pg_result); i < num_fields; i++) { @@ -5839,7 +5842,6 @@ PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array, l } add_index_zval(ret_array, pg_row, &row); } - return SUCCESS; } /* }}} */ @@ -5882,7 +5884,8 @@ PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array, l pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s)); if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) { - ret = php_pgsql_result2array(pg_result, ret_array, result_type); + php_pgsql_result2array(pg_result, ret_array, result_type); + ret = SUCCESS; } else { php_error_docref(NULL, E_NOTICE, "Failed to execute '%s'", ZSTR_VAL(querystr.s)); } diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index 0995e0463ff9e..a6dfb5d18512e 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -23,6 +23,7 @@ function pg_last_error($connection = null): string {} /** * @param resource|null $connection * @alias pg_last_error + * @deprecated */ function pg_errormessage($connection = null): string {} @@ -86,6 +87,7 @@ function pg_num_rows($result): int {} /** * @param resource $result * @alias pg_num_rows + * @deprecated */ function pg_numrows($result): int {} @@ -95,6 +97,7 @@ function pg_num_fields($result): int {} /** * @param resource $result * @alias pg_num_fields + * @deprecated */ function pg_numfields($result): int {} @@ -104,6 +107,7 @@ function pg_affected_rows($result): int {} /** * @param resource $result * @alias pg_affected_rows + * @deprecated */ function pg_cmdtuples($result): int {} @@ -114,34 +118,37 @@ function pg_last_notice($connection, int $option = PGSQL_NOTICE_LAST): array|str function pg_field_table($result, int $field_number, bool $oid_only = false): string|int|false {} /** @param resource $result */ -function pg_field_name($result, int $field_number): string|false {} +function pg_field_name($result, int $field_number): string {} /** * @param resource $result * @alias pg_field_name + * @deprecated */ -function pg_fieldname($result, int $field_number): string|false {} +function pg_fieldname($result, int $field_number): string {} /** @param resource $result */ -function pg_field_size($result, int $field_number): int|false {} +function pg_field_size($result, int $field_number): int {} /** * @param resource $result * @alias pg_field_size + * @deprecated */ -function pg_fieldsize($result, int $field_number): int|false {} +function pg_fieldsize($result, int $field_number): int {} /** @param resource $result */ -function pg_field_type($result, int $field_number): string|false {} +function pg_field_type($result, int $field_number): string {} /** * @param resource $result * @alias pg_field_type + * @deprecated */ -function pg_fieldtype($result, int $field_number): string|false {} +function pg_fieldtype($result, int $field_number): string {} /** @param resource $result */ -function pg_field_type_oid($result, int $field_number): string|int|false {} +function pg_field_type_oid($result, int $field_number): string|int {} /** @param resource $result */ function pg_field_num($result, string $field_name): int {} @@ -149,6 +156,7 @@ function pg_field_num($result, string $field_name): int {} /** * @param resource $result * @alias pg_field_num + * @deprecated */ function pg_fieldnum($result, string $field_name): int {} @@ -162,6 +170,7 @@ function pg_fetch_result($result, $row_number, string|int $field = UNKNOWN): str * @param resource $result * @param string|int $row_number * @alias pg_fetch_result + * @deprecated */ function pg_result($result, $row_number, string|int $field = UNKNOWN): string|false|null {} @@ -184,10 +193,10 @@ function pg_fetch_array($result, ?int $row_number = null, int $result_type = PGS function pg_fetch_object($result, ?int $row_number = null, string $class_name = "stdClass", ?array $ctor_params = null): object|false {} /** @param resource $result */ -function pg_fetch_all($result, int $result_type = PGSQL_ASSOC): array|false {} +function pg_fetch_all($result, int $result_type = PGSQL_ASSOC): array {} /** @param resource $result */ -function pg_fetch_all_columns($result, int $column_number = 0): array|false {} +function pg_fetch_all_columns($result, int $field_number = 0): array {} /** @param resource $result */ function pg_result_seek($result, int $row_number): bool {} @@ -202,6 +211,7 @@ function pg_field_prtlen($result, $row_number, string|int $field = UNKNOWN): int * @param resource $result * @param string|int $row_number * @alias pg_field_prtlen + * @deprecated */ function pg_fieldprtlen($result, $row_number, string|int $field = UNKNOWN): int|false {} @@ -215,6 +225,7 @@ function pg_field_is_null($result, $row_number, string|int $field = UNKNOWN): in * @param resource $result * @param string|int $row_number * @alias pg_field_is_null + * @deprecated */ function pg_fieldisnull($result, $row_number, string|int $field = UNKNOWN): int|false {} @@ -224,6 +235,7 @@ function pg_free_result($result): bool {} /** * @param resource $result * @alias pg_free_result + * @deprecated */ function pg_freeresult($result): bool {} @@ -233,6 +245,7 @@ function pg_last_oid($result): string|int|false {} /** * @param resource $result * @alias pg_last_oid + * @deprecated */ function pg_getlastoid($result): string|int|false {} @@ -252,6 +265,7 @@ function pg_lo_create($connection = UNKNOWN, $large_object_id = UNKNOWN): string * @param resource $connection * @param string|int $large_object_id * @alias pg_lo_create + * @deprecated */ function pg_locreate($connection = UNKNOWN, $large_object_id = UNKNOWN): string|int|false {} @@ -265,6 +279,7 @@ function pg_lo_unlink($connection, $large_object_id = UNKNOWN): bool {} * @param resource $connection * @param string|int $large_object_id * @alias pg_lo_unlink + * @deprecated */ function pg_lounlink($connection, $large_object_id = UNKNOWN): bool {} @@ -280,6 +295,7 @@ function pg_lo_open($connection, $large_object_id = UNKNOWN, string $mode = UNKN * @param string|int $large_object_id * @return resource|false * @alias pg_lo_open + * @deprecated */ function pg_loopen($connection, $large_object_id = UNKNOWN, string $mode = UNKNOWN) {} @@ -289,6 +305,7 @@ function pg_lo_close($large_object): bool {} /** * @param resource $large_object * @alias pg_lo_close + * @deprecated */ function pg_loclose($large_object): bool {} @@ -298,6 +315,7 @@ function pg_lo_read($large_object, int $len = 8192): string|false {} /** * @param resource $large_object * @alias pg_lo_read + * @deprecated */ function pg_loread($large_object, int $len = 8192): string|false {} @@ -307,6 +325,7 @@ function pg_lo_write($large_object, string $buf, ?int $len = null): int|false {} /** * @param resource $large_object * @alias pg_lo_write + * @deprecated */ function pg_lowrite($large_object, string $buf, ?int $len = null): int|false {} @@ -316,6 +335,7 @@ function pg_lo_read_all($large_object): int {} /** * @param resource $large_object * @alias pg_lo_read_all + * @deprecated */ function pg_loreadall($large_object): int {} @@ -333,6 +353,7 @@ function pg_lo_import($connection, $filename = UNKNOWN, $large_object_id = UNKNO * @param string|int $large_object_id * @return resource|false * @alias pg_lo_import + * @deprecated */ function pg_loimport($connection, $filename = UNKNOWN, $large_object_id = UNKNOWN): string|int|false {} @@ -350,6 +371,7 @@ function pg_lo_export($connection, $large_object_id = UNKNOWN, $filename = UNKNO * @param string|int $filename * @return resource|false * @alias pg_lo_export + * @deprecated */ function pg_loexport($connection, $large_object_id = UNKNOWN, $filename = UNKNOWN): bool {} @@ -371,6 +393,7 @@ function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {} /** * @param resource|string $connection * @alias pg_set_client_encoding + * @deprecated */ function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {} @@ -380,6 +403,7 @@ function pg_client_encoding($connection = null): string {} /** * @param resource|null $connection * @alias pg_client_encoding + * @deprecated */ function pg_clientencoding($connection = null): string {} @@ -401,7 +425,7 @@ function pg_escape_string($connection, string $data = UNKNOWN): string {} /** @param resource|string $connection */ function pg_escape_bytea($connection, string $data = UNKNOWN): string {} -function pg_unescape_bytea(?string $data = null): string|false {} +function pg_unescape_bytea(?string $data = null): string {} /** @param resource|string $connection */ function pg_escape_literal($connection, string $data = UNKNOWN): string|false {} diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 544e0ad4a6a2e..a0f267c8ff896 100644 --- a/ext/pgsql/pgsql_arginfo.h +++ b/ext/pgsql/pgsql_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 907a616e7138369e6e3ccbbb10e6c0f2a380fe93 */ + * Stub hash: 9735dbc8a4ca642ee825ae8942470ac2dec89f50 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connect, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) @@ -93,14 +93,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_table, 0, 2, MAY_BE_STR ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, oid_only, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_name, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_field_name, 0, 2, IS_STRING, 0) ZEND_ARG_INFO(0, result) ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_pg_fieldname arginfo_pg_field_name -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_size, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_field_size, 0, 2, IS_LONG, 0) ZEND_ARG_INFO(0, result) ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -111,7 +111,7 @@ ZEND_END_ARG_INFO() #define arginfo_pg_fieldtype arginfo_pg_field_name -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_type_oid, 0, 2, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_type_oid, 0, 2, MAY_BE_STRING|MAY_BE_LONG) ZEND_ARG_INFO(0, result) ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -155,14 +155,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_object, 0, 1, MAY_BE_OB ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ctor_params, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_all, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_fetch_all, 0, 1, IS_ARRAY, 0) ZEND_ARG_INFO(0, result) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_ASSOC") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_all_columns, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_fetch_all_columns, 0, 1, IS_ARRAY, 0) ZEND_ARG_INFO(0, result) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column_number, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, field_number, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_result_seek, 0, 2, _IS_BOOL, 0) @@ -325,7 +325,7 @@ ZEND_END_ARG_INFO() #define arginfo_pg_escape_bytea arginfo_pg_escape_string -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_unescape_bytea, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_unescape_bytea, 0, 0, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -385,7 +385,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_result_status, 0, 1, MAY_BE_S ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_STATUS_LONG") ZEND_END_ARG_INFO() -#define arginfo_pg_get_notify arginfo_pg_fetch_all +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_get_notify, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_INFO(0, result) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_ASSOC") +ZEND_END_ARG_INFO() #define arginfo_pg_get_pid arginfo_pg_connect_poll @@ -539,7 +542,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(pg_close, arginfo_pg_close) ZEND_FE(pg_dbname, arginfo_pg_dbname) ZEND_FE(pg_last_error, arginfo_pg_last_error) - ZEND_FALIAS(pg_errormessage, pg_last_error, arginfo_pg_errormessage) + ZEND_DEP_FALIAS(pg_errormessage, pg_last_error, arginfo_pg_errormessage) ZEND_FE(pg_options, arginfo_pg_options) ZEND_FE(pg_port, arginfo_pg_port) ZEND_FE(pg_tty, arginfo_pg_tty) @@ -553,24 +556,24 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(pg_prepare, arginfo_pg_prepare) ZEND_FE(pg_execute, arginfo_pg_execute) ZEND_FE(pg_num_rows, arginfo_pg_num_rows) - ZEND_FALIAS(pg_numrows, pg_num_rows, arginfo_pg_numrows) + ZEND_DEP_FALIAS(pg_numrows, pg_num_rows, arginfo_pg_numrows) ZEND_FE(pg_num_fields, arginfo_pg_num_fields) - ZEND_FALIAS(pg_numfields, pg_num_fields, arginfo_pg_numfields) + ZEND_DEP_FALIAS(pg_numfields, pg_num_fields, arginfo_pg_numfields) ZEND_FE(pg_affected_rows, arginfo_pg_affected_rows) - ZEND_FALIAS(pg_cmdtuples, pg_affected_rows, arginfo_pg_cmdtuples) + ZEND_DEP_FALIAS(pg_cmdtuples, pg_affected_rows, arginfo_pg_cmdtuples) ZEND_FE(pg_last_notice, arginfo_pg_last_notice) ZEND_FE(pg_field_table, arginfo_pg_field_table) ZEND_FE(pg_field_name, arginfo_pg_field_name) - ZEND_FALIAS(pg_fieldname, pg_field_name, arginfo_pg_fieldname) + ZEND_DEP_FALIAS(pg_fieldname, pg_field_name, arginfo_pg_fieldname) ZEND_FE(pg_field_size, arginfo_pg_field_size) - ZEND_FALIAS(pg_fieldsize, pg_field_size, arginfo_pg_fieldsize) + ZEND_DEP_FALIAS(pg_fieldsize, pg_field_size, arginfo_pg_fieldsize) ZEND_FE(pg_field_type, arginfo_pg_field_type) - ZEND_FALIAS(pg_fieldtype, pg_field_type, arginfo_pg_fieldtype) + ZEND_DEP_FALIAS(pg_fieldtype, pg_field_type, arginfo_pg_fieldtype) ZEND_FE(pg_field_type_oid, arginfo_pg_field_type_oid) ZEND_FE(pg_field_num, arginfo_pg_field_num) - ZEND_FALIAS(pg_fieldnum, pg_field_num, arginfo_pg_fieldnum) + ZEND_DEP_FALIAS(pg_fieldnum, pg_field_num, arginfo_pg_fieldnum) ZEND_FE(pg_fetch_result, arginfo_pg_fetch_result) - ZEND_FALIAS(pg_result, pg_fetch_result, arginfo_pg_result) + ZEND_DEP_FALIAS(pg_result, pg_fetch_result, arginfo_pg_result) ZEND_FE(pg_fetch_row, arginfo_pg_fetch_row) ZEND_FE(pg_fetch_assoc, arginfo_pg_fetch_assoc) ZEND_FE(pg_fetch_array, arginfo_pg_fetch_array) @@ -579,41 +582,41 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(pg_fetch_all_columns, arginfo_pg_fetch_all_columns) ZEND_FE(pg_result_seek, arginfo_pg_result_seek) ZEND_FE(pg_field_prtlen, arginfo_pg_field_prtlen) - ZEND_FALIAS(pg_fieldprtlen, pg_field_prtlen, arginfo_pg_fieldprtlen) + ZEND_DEP_FALIAS(pg_fieldprtlen, pg_field_prtlen, arginfo_pg_fieldprtlen) ZEND_FE(pg_field_is_null, arginfo_pg_field_is_null) - ZEND_FALIAS(pg_fieldisnull, pg_field_is_null, arginfo_pg_fieldisnull) + ZEND_DEP_FALIAS(pg_fieldisnull, pg_field_is_null, arginfo_pg_fieldisnull) ZEND_FE(pg_free_result, arginfo_pg_free_result) - ZEND_FALIAS(pg_freeresult, pg_free_result, arginfo_pg_freeresult) + ZEND_DEP_FALIAS(pg_freeresult, pg_free_result, arginfo_pg_freeresult) ZEND_FE(pg_last_oid, arginfo_pg_last_oid) - ZEND_FALIAS(pg_getlastoid, pg_last_oid, arginfo_pg_getlastoid) + ZEND_DEP_FALIAS(pg_getlastoid, pg_last_oid, arginfo_pg_getlastoid) ZEND_FE(pg_trace, arginfo_pg_trace) ZEND_FE(pg_untrace, arginfo_pg_untrace) ZEND_FE(pg_lo_create, arginfo_pg_lo_create) - ZEND_FALIAS(pg_locreate, pg_lo_create, arginfo_pg_locreate) + ZEND_DEP_FALIAS(pg_locreate, pg_lo_create, arginfo_pg_locreate) ZEND_FE(pg_lo_unlink, arginfo_pg_lo_unlink) - ZEND_FALIAS(pg_lounlink, pg_lo_unlink, arginfo_pg_lounlink) + ZEND_DEP_FALIAS(pg_lounlink, pg_lo_unlink, arginfo_pg_lounlink) ZEND_FE(pg_lo_open, arginfo_pg_lo_open) - ZEND_FALIAS(pg_loopen, pg_lo_open, arginfo_pg_loopen) + ZEND_DEP_FALIAS(pg_loopen, pg_lo_open, arginfo_pg_loopen) ZEND_FE(pg_lo_close, arginfo_pg_lo_close) - ZEND_FALIAS(pg_loclose, pg_lo_close, arginfo_pg_loclose) + ZEND_DEP_FALIAS(pg_loclose, pg_lo_close, arginfo_pg_loclose) ZEND_FE(pg_lo_read, arginfo_pg_lo_read) - ZEND_FALIAS(pg_loread, pg_lo_read, arginfo_pg_loread) + ZEND_DEP_FALIAS(pg_loread, pg_lo_read, arginfo_pg_loread) ZEND_FE(pg_lo_write, arginfo_pg_lo_write) - ZEND_FALIAS(pg_lowrite, pg_lo_write, arginfo_pg_lowrite) + ZEND_DEP_FALIAS(pg_lowrite, pg_lo_write, arginfo_pg_lowrite) ZEND_FE(pg_lo_read_all, arginfo_pg_lo_read_all) - ZEND_FALIAS(pg_loreadall, pg_lo_read_all, arginfo_pg_loreadall) + ZEND_DEP_FALIAS(pg_loreadall, pg_lo_read_all, arginfo_pg_loreadall) ZEND_FE(pg_lo_import, arginfo_pg_lo_import) - ZEND_FALIAS(pg_loimport, pg_lo_import, arginfo_pg_loimport) + ZEND_DEP_FALIAS(pg_loimport, pg_lo_import, arginfo_pg_loimport) ZEND_FE(pg_lo_export, arginfo_pg_lo_export) - ZEND_FALIAS(pg_loexport, pg_lo_export, arginfo_pg_loexport) + ZEND_DEP_FALIAS(pg_loexport, pg_lo_export, arginfo_pg_loexport) ZEND_FE(pg_lo_seek, arginfo_pg_lo_seek) ZEND_FE(pg_lo_tell, arginfo_pg_lo_tell) ZEND_FE(pg_lo_truncate, arginfo_pg_lo_truncate) ZEND_FE(pg_set_error_verbosity, arginfo_pg_set_error_verbosity) ZEND_FE(pg_set_client_encoding, arginfo_pg_set_client_encoding) - ZEND_FALIAS(pg_setclientencoding, pg_set_client_encoding, arginfo_pg_setclientencoding) + ZEND_DEP_FALIAS(pg_setclientencoding, pg_set_client_encoding, arginfo_pg_setclientencoding) ZEND_FE(pg_client_encoding, arginfo_pg_client_encoding) - ZEND_FALIAS(pg_clientencoding, pg_client_encoding, arginfo_pg_clientencoding) + ZEND_DEP_FALIAS(pg_clientencoding, pg_client_encoding, arginfo_pg_clientencoding) ZEND_FE(pg_end_copy, arginfo_pg_end_copy) ZEND_FE(pg_put_line, arginfo_pg_put_line) ZEND_FE(pg_copy_to, arginfo_pg_copy_to) diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index fe52d9ce96226..3da04282d9b87 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -182,7 +182,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *val PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, zend_ulong opt , zend_string **sql); PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, zend_ulong opt, zend_string **sql); PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, zend_ulong opt, long fetch_option, zend_string **sql ); -PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long fetch_option); +PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array, long fetch_option); /* internal functions */ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent); diff --git a/ext/pgsql/tests/03sync_query.phpt b/ext/pgsql/tests/03sync_query.phpt index 1cd439bc204ac..cc3b1b86b98a5 100644 --- a/ext/pgsql/tests/03sync_query.phpt +++ b/ext/pgsql/tests/03sync_query.phpt @@ -31,6 +31,32 @@ for ($i=0; $i < $rows; $i++) pg_fetch_result($result, $i, 0); } +try { + pg_fetch_result($result, 0, -1); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_fetch_result($result, 0, 3); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_fetch_result($result, 0, "unknown"); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_fetch_all_columns($result, -1); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_fetch_all_columns($result, 3); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} + pg_result_error($result); if (function_exists('pg_result_error_field')) { pg_result_error_field($result, PGSQL_DIAG_SEVERITY); @@ -61,8 +87,45 @@ pg_field_type($result, 0); pg_field_prtlen($result, 0); pg_field_is_null($result, 0); +try { + pg_field_is_null($result, -1); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_field_is_null($result, 3); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_field_is_null($result, "unknown"); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_field_name($result, -1); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_field_name($result, 3); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_field_table($result, -1); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + pg_field_table($result, 3); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} + $result = pg_query($db, "INSERT INTO ".$table_name." VALUES (9999, 'ABC');"); pg_last_oid($result); +var_dump(pg_fetch_all($result)); pg_free_result($result); pg_close($db); @@ -70,4 +133,18 @@ pg_close($db); echo "OK"; ?> --EXPECT-- +Argument #3 must be greater than or equal to 0 +Argument #3 must be less than the number of fields for this result set +Argument #3 must be a field name from this result set +pg_fetch_all_columns(): Argument #2 ($field_number) must be greater than or equal to 0 +pg_fetch_all_columns(): Argument #2 ($field_number) must be less than the number of fields for this result set +Argument #2 must be greater than or equal to 0 +Argument #2 must be less than the number of fields for this result set +Argument #2 must be a field name from this result set +pg_field_name(): Argument #2 ($field_number) must be greater than or equal to 0 +pg_field_name(): Argument #2 ($field_number) must be less than the number of fields for this result set +pg_field_table(): Argument #2 ($field_number) must be greater than or equal to 0 +pg_field_table(): Argument #2 ($field_number) must be less than the number of fields for this result set +array(0) { +} OK diff --git a/ext/pgsql/tests/05large_object.phpt b/ext/pgsql/tests/05large_object.phpt index 3a4a40eb0865f..b493edd221123 100644 --- a/ext/pgsql/tests/05large_object.phpt +++ b/ext/pgsql/tests/05large_object.phpt @@ -68,6 +68,28 @@ if (!file_exists($path . 'php.gif.exported')) { @unlink($path . 'php.gif.exported'); pg_query($db, 'commit'); +/* invalid OID values */ +try { + pg_lo_create(-15); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_create($db, -15); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_create('giberrish'); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_create($db, 'giberrish'); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} + echo "OK"; ?> --EXPECT-- @@ -79,4 +101,8 @@ unlink LO Test without connection Test with string oid value import/export LO +Invalid OID value passed +Invalid OID value passed +Invalid OID value passed +Invalid OID value passed OK diff --git a/ext/pgsql/tests/10pg_convert_9.phpt b/ext/pgsql/tests/10pg_convert_9.phpt index a8395315c6510..0a2828a247da4 100644 --- a/ext/pgsql/tests/10pg_convert_9.phpt +++ b/ext/pgsql/tests/10pg_convert_9.phpt @@ -18,6 +18,34 @@ $fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB'); $converted = pg_convert($db, $table_name, $fields); var_dump($converted); + +/* Invalid values */ +try { + $converted = pg_convert($db, $table_name, [5 => 'AAA']); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_convert($db, $table_name, ['AAA']); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_convert($db, $table_name, ['num' => []]); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_convert($db, $table_name, ['num' => new stdClass()]); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_convert($db, $table_name, ['num' => $db]); + var_dump($converted); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} ?> --EXPECT-- array(3) { @@ -28,3 +56,8 @@ array(3) { [""bin""]=> string(12) "E'\\x424242'" } +Array of values must be an associative array with string keys +Array of values must be an associative array with string keys +Values must be of type string|int|float|bool|null, array given +Values must be of type string|int|float|bool|null, stdClass given +Values must be of type string|int|float|bool|null, resource given diff --git a/ext/pgsql/tests/12pg_insert_9.phpt b/ext/pgsql/tests/12pg_insert_9.phpt index 275afc55e1df8..11a401f3580d5 100644 --- a/ext/pgsql/tests/12pg_insert_9.phpt +++ b/ext/pgsql/tests/12pg_insert_9.phpt @@ -21,10 +21,43 @@ echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n"; echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n"; var_dump( pg_insert($db, $table_name, $fields, PGSQL_DML_EXEC) ); // Return resource +/* Invalid values */ +try { + $converted = pg_insert($db, $table_name, [5 => 'AAA']); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_insert($db, $table_name, ['AAA']); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_insert($db, $table_name, ['num' => []]); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_insert($db, $table_name, ['num' => new stdClass()]); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_insert($db, $table_name, ['num' => $db]); + var_dump($converted); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} + echo "Ok\n"; ?> --EXPECTF-- INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES (1234,E'AAA',E'\\x424242'); INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES ('1234','AAA','BBB'); resource(%d) of type (pgsql result) +Array of values must be an associative array with string keys +Array of values must be an associative array with string keys +Values must be of type string|int|float|bool|null, array given +Values must be of type string|int|float|bool|null, stdClass given +Values must be of type string|int|float|bool|null, resource given Ok diff --git a/ext/pgsql/tests/13pg_select_9.phpt b/ext/pgsql/tests/13pg_select_9.phpt index d5e661e5e0105..82a59a1cf5638 100644 --- a/ext/pgsql/tests/13pg_select_9.phpt +++ b/ext/pgsql/tests/13pg_select_9.phpt @@ -21,6 +21,35 @@ $res = pg_select($db, $table_name, $ids) or print "Error\n"; var_dump($res); echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n"; echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n"; + +/* Invalid values */ +try { + $converted = pg_select($db, $table_name, [5 => 'AAA']); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_select($db, $table_name, ['AAA']); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_select($db, $table_name, ['num' => []]); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_select($db, $table_name, ['num' => new stdClass()]); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + $converted = pg_select($db, $table_name, ['num' => $db]); + var_dump($converted); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} + echo "Ok\n"; ?> @@ -47,4 +76,9 @@ array(2) { } SELECT * FROM "php_pgsql_test" WHERE "num"=1234; SELECT * FROM "php_pgsql_test" WHERE "num"='1234'; +Array of values must be an associative array with string keys +Array of values must be an associative array with string keys +Values must be of type string|int|float|bool|null, array given +Values must be of type string|int|float|bool|null, stdClass given +Values must be of type string|int|float|bool|null, resource given Ok diff --git a/ext/pgsql/tests/28large_object_import_oid.phpt b/ext/pgsql/tests/28large_object_import_oid.phpt index 9ffb96123e9d0..8209cc2932432 100644 --- a/ext/pgsql/tests/28large_object_import_oid.phpt +++ b/ext/pgsql/tests/28large_object_import_oid.phpt @@ -38,6 +38,47 @@ if ($oid != 21005) echo ("pg_lo_import() wrong id\n"); pg_lo_unlink ($oid); pg_exec('commit'); +/* Invalide OID */ +try { + pg_lo_import(__FILE__, -15); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import($db, __FILE__, -15); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import(__FILE__, 'giberrish'); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import($db, __FILE__, 'giberrish'); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import(__FILE__, true); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import($db, __FILE__, []); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import($db, __FILE__, new stdClass()); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} +try { + pg_lo_import($db, __FILE__, $db); +} catch (\TypeError $e) { + echo $e->getMessage(), \PHP_EOL; +} echo "OK"; ?> @@ -45,4 +86,12 @@ echo "OK"; import LO from int import LO from string import LO using default connection +Invalid OID value passed +Invalid OID value passed +Invalid OID value passed +Invalid OID value passed +OID value must be of type string|int, bool given +OID value must be of type string|int, array given +OID value must be of type string|int, stdClass given +OID value must be of type string|int, resource given OK diff --git a/ext/pgsql/tests/98old_api.phpt b/ext/pgsql/tests/98old_api.phpt index b391097131329..425753136ae35 100644 --- a/ext/pgsql/tests/98old_api.phpt +++ b/ext/pgsql/tests/98old_api.phpt @@ -29,5 +29,28 @@ pg_cmdtuples($result); echo "OK"; ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Function pg_numrows() is deprecated in %s on line %d + +Deprecated: Function pg_numfields() is deprecated in %s on line %d + +Deprecated: Function pg_fieldname() is deprecated in %s on line %d + +Deprecated: Function pg_fieldsize() is deprecated in %s on line %d + +Deprecated: Function pg_fieldtype() is deprecated in %s on line %d + +Deprecated: Function pg_fieldprtlen() is deprecated in %s on line %d + +Deprecated: Function pg_fieldisnull() is deprecated in %s on line %d + +Deprecated: Function pg_result() is deprecated in %s on line %d + +Deprecated: Function pg_getlastoid() is deprecated in %s on line %d + +Deprecated: Function pg_freeresult() is deprecated in %s on line %d + +Deprecated: Function pg_errormessage() is deprecated in %s on line %d + +Deprecated: Function pg_cmdtuples() is deprecated in %s on line %d OK diff --git a/ext/pgsql/tests/lcmess.inc b/ext/pgsql/tests/lcmess.inc index 32ab0e36f59af..8c2171547709f 100644 --- a/ext/pgsql/tests/lcmess.inc +++ b/ext/pgsql/tests/lcmess.inc @@ -9,7 +9,7 @@ function _skip_lc_messages($lc_messages = 'C') function _set_lc_messages($lc_messages = 'C') { - if (pg_result(pg_query("SHOW LC_MESSAGES"), 0, 0) != $lc_messages) { + if (pg_fetch_result(pg_query("SHOW LC_MESSAGES"), 0, 0) != $lc_messages) { if (!@pg_exec("SET LC_MESSAGES='{$lc_messages}'")) { return false; } diff --git a/ext/phar/phar_object.stub.php b/ext/phar/phar_object.stub.php index e62a95c0383f6..5fda00d4d7192 100644 --- a/ext/phar/phar_object.stub.php +++ b/ext/phar/phar_object.stub.php @@ -181,191 +181,191 @@ final public static function webPhar( class PharData extends RecursiveDirectoryIterator implements Countable, ArrayAccess { - /** @alias Phar::__construct */ + /** @implementation-alias Phar::__construct */ public function __construct(string $filename, int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias = null, int $fileformat = 0) {} - /** @alias Phar::__destruct */ + /** @implementation-alias Phar::__destruct */ public function __destruct() {} /** * @return void - * @alias Phar::addEmptyDir + * @implementation-alias Phar::addEmptyDir */ public function addEmptyDir(string $dirname) {} /** * @return void - * @alias Phar::addFile + * @implementation-alias Phar::addFile */ public function addFile(string $filename, ?string $localname = null) {} /** * @return void - * @alias Phar::addFromString + * @implementation-alias Phar::addFromString */ public function addFromString(string $localname, string $contents) {} /** * @return array|false - * @alias Phar::buildFromDirectory + * @implementation-alias Phar::buildFromDirectory */ public function buildFromDirectory(string $base_dir, string $regex = "") {} /** * @return array|false - * @alias Phar::buildFromIterator + * @implementation-alias Phar::buildFromIterator */ public function buildFromIterator(Traversable $iterator, ?string $base_directory = null) {} /** * @return void - * @alias Phar::compressFiles + * @implementation-alias Phar::compressFiles */ public function compressFiles(int $compression_type) {} /** * @return bool - * @alias Phar::decompressFiles + * @implementation-alias Phar::decompressFiles */ public function decompressFiles() {} /** * @return Phar|null - * @alias Phar::compress + * @implementation-alias Phar::compress */ public function compress(int $compression_type, ?string $file_ext = null) {} /** * @return Phar|null - * @alias Phar::decompress + * @implementation-alias Phar::decompress */ public function decompress(?string $file_ext = null) {} /** * @return Phar|null - * @alias Phar::convertToExecutable + * @implementation-alias Phar::convertToExecutable */ public function convertToExecutable(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {} /** * @return Phar|null - * @alias Phar::convertToData + * @implementation-alias Phar::convertToData */ public function convertToData(int $format = 9021976, int $compression_type = 9021976, ?string $file_ext = null) {} /** * @return bool - * @alias Phar::copy + * @implementation-alias Phar::copy */ public function copy(string $newfile, string $oldfile) {} /** * @return int - * @alias Phar::count + * @implementation-alias Phar::count */ public function count(int $mode = COUNT_NORMAL) {} /** * @return bool - * @alias Phar::delete + * @implementation-alias Phar::delete */ public function delete(string $entry) {} /** * @return bool - * @alias Phar::delMetadata + * @implementation-alias Phar::delMetadata */ public function delMetadata() {} /** * @return bool - * @alias Phar::extractTo + * @implementation-alias Phar::extractTo */ public function extractTo(string $pathto, array|string|null $files = null, bool $overwrite = false) {} /** * @return string|null - * @alias Phar::getAlias + * @implementation-alias Phar::getAlias */ public function getAlias() {} /** * @return string - * @alias Phar::getPath + * @implementation-alias Phar::getPath */ public function getPath() {} /** * @return mixed - * @alias Phar::getMetadata + * @implementation-alias Phar::getMetadata */ public function getMetadata(array $unserialize_options = []) {} /** * @return bool - * @alias Phar::getModified + * @implementation-alias Phar::getModified */ public function getModified() {} /** * @return array|false - * @alias Phar::getSignature + * @implementation-alias Phar::getSignature */ public function getSignature() {} /** * @return string - * @alias Phar::getStub + * @implementation-alias Phar::getStub */ public function getStub() {} /** * @return string - * @alias Phar::getVersion + * @implementation-alias Phar::getVersion */ public function getVersion() {} /** * @return bool - * @alias Phar::hasMetadata + * @implementation-alias Phar::hasMetadata */ public function hasMetadata() {} /** * @return bool - * @alias Phar::isBuffering + * @implementation-alias Phar::isBuffering */ public function isBuffering() {} /** * @return int|false - * @alias Phar::isCompressed + * @implementation-alias Phar::isCompressed */ public function isCompressed() {} /** * @return bool - * @alias Phar::isFileFormat + * @implementation-alias Phar::isFileFormat */ public function isFileFormat(int $fileformat) {} /** * @return bool - * @alias Phar::isWritable + * @implementation-alias Phar::isWritable */ public function isWritable() {} /** * @param string $entry * @return bool - * @alias Phar::offsetExists + * @implementation-alias Phar::offsetExists */ public function offsetExists($entry) {} /** * @param string $entry * @return PharFileInfo - * @alias Phar::offsetGet + * @implementation-alias Phar::offsetGet */ public function offsetGet($entry) {} @@ -373,104 +373,104 @@ public function offsetGet($entry) {} * @param string $entry * @param resource|string $value * @return void - * @alias Phar::offsetSet + * @implementation-alias Phar::offsetSet */ public function offsetSet($entry, $value) {} /** * @param string $entry * @return bool - * @alias Phar::offsetUnset + * @implementation-alias Phar::offsetUnset */ public function offsetUnset($entry) {} /** * @return bool - * @alias Phar::setAlias + * @implementation-alias Phar::setAlias */ public function setAlias(string $alias) {} /** * @return bool - * @alias Phar::setDefaultStub + * @implementation-alias Phar::setDefaultStub */ public function setDefaultStub(?string $index = null, ?string $webindex = null) {} /** * @return void - * @alias Phar::setMetadata + * @implementation-alias Phar::setMetadata */ public function setMetadata(mixed $metadata) {} /** * @return void - * @alias Phar::setSignatureAlgorithm + * @implementation-alias Phar::setSignatureAlgorithm */ public function setSignatureAlgorithm(int $algorithm, ?string $privatekey = null) {} /** * @param resource $newstub * @return bool - * @alias Phar::setStub + * @implementation-alias Phar::setStub */ public function setStub($newstub, int $maxlen = -1) {} /** * @return void - * @alias Phar::startBuffering + * @implementation-alias Phar::startBuffering */ public function startBuffering() {} /** * @return void - * @alias Phar::stopBuffering + * @implementation-alias Phar::stopBuffering */ public function stopBuffering() {} - /** @alias Phar::apiVersion */ + /** @implementation-alias Phar::apiVersion */ final public static function apiVersion(): string {} - /** @alias Phar::canCompress */ + /** @implementation-alias Phar::canCompress */ final public static function canCompress(int $method = 0): bool {} - /** @alias Phar::canWrite */ + /** @implementation-alias Phar::canWrite */ final public static function canWrite(): bool {} - /** @alias Phar::createDefaultStub */ + /** @implementation-alias Phar::createDefaultStub */ final public static function createDefaultStub(?string $index = null, ?string $webindex = null): string {} - /** @alias Phar::getSupportedCompression */ + /** @implementation-alias Phar::getSupportedCompression */ final public static function getSupportedCompression(): array {} - /** @alias Phar::getSupportedSignatures */ + /** @implementation-alias Phar::getSupportedSignatures */ final public static function getSupportedSignatures(): array {} - /** @alias Phar::interceptFileFuncs */ + /** @implementation-alias Phar::interceptFileFuncs */ final public static function interceptFileFuncs(): void {} - /** @alias Phar::isValidPharFilename */ + /** @implementation-alias Phar::isValidPharFilename */ final public static function isValidPharFilename( string $filename, bool $executable = true): bool {} - /** @alias Phar::loadPhar */ + /** @implementation-alias Phar::loadPhar */ final public static function loadPhar(string $filename, ?string $alias = null): bool {} - /** @alias Phar::mapPhar */ + /** @implementation-alias Phar::mapPhar */ final public static function mapPhar(?string $alias = null, int $offset = 0): bool {} - /** @alias Phar::running */ + /** @implementation-alias Phar::running */ final public static function running(bool $retphar = true): string {} - /** @alias Phar::mount */ + /** @implementation-alias Phar::mount */ final public static function mount(string $inphar, string $externalfile): void {} - /** @alias Phar::mungServer */ + /** @implementation-alias Phar::mungServer */ final public static function mungServer(array $munglist): void {} - /** @alias Phar::unlinkArchive */ + /** @implementation-alias Phar::unlinkArchive */ final public static function unlinkArchive(string $archive): bool {} - /** @alias Phar::webPhar */ + /** @implementation-alias Phar::webPhar */ final public static function webPhar( ?string $alias = null, ?string $index = null, string $f404 = "", array $mimetypes = [], ?callable $rewrites = null): void {} diff --git a/ext/phar/phar_object_arginfo.h b/ext/phar/phar_object_arginfo.h index d6c6d5690ed48..916312dba6b4b 100644 --- a/ext/phar/phar_object_arginfo.h +++ b/ext/phar/phar_object_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 8f92d8a7b1266cdec193336b36b2319235fbc40c */ + * Stub hash: e67cd4d59555843688a1bdd90ecd7d3924f1ee29 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Phar___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) diff --git a/ext/phar/tests/cache_list/frontcontroller29.phpt b/ext/phar/tests/cache_list/frontcontroller29.phpt index caaf34538e334..a3a9f4e48e89e 100644 --- a/ext/phar/tests/cache_list/frontcontroller29.phpt +++ b/ext/phar/tests/cache_list/frontcontroller29.phpt @@ -16,7 +16,6 @@ Content-type: text/html; charset=UTF-8 --EXPECTF-- Fatal error: Uncaught Error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps:1 Stack trace: -#0 [internal function]: unknown() -#1 %s(%d): Phar::webPhar('whatever', 'index.php', '404.php', Array) -#2 {main} +#0 %s(%d): Phar::webPhar('whatever', 'index.php', '404.php', Array) +#1 {main} thrown in phar://%sfatalerror.phps on line 1 diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt index a30ca7df193da..aad575749bd37 100644 --- a/ext/phar/tests/fgc_edgecases.phpt +++ b/ext/phar/tests/fgc_edgecases.phpt @@ -71,7 +71,7 @@ echo file_get_contents("./hi", 0, $context, 50000); echo file_get_contents("./hi"); echo file_get_contents("./hi", 0, $context, 0, 0); ?> -file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 +file_get_contents(): Argument #5 ($max_length) must be greater than or equal to 0 test test --EXPECTF-- *** Test substituting argument 1 with object values *** -Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) + +Warning: Object of class classWithToString could not be converted to int in %s on line %d bool(false) -Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) + +Warning: Object of class classWithoutToString could not be converted to int in %s on line %d bool(false) diff --git a/ext/readline/readline.stub.php b/ext/readline/readline.stub.php index ecd81416eba80..cfc1d0d8d5970 100644 --- a/ext/readline/readline.stub.php +++ b/ext/readline/readline.stub.php @@ -5,10 +5,10 @@ function readline(?string $prompt = null): string|false {} /** - * @param int|string|bool|null $newvalue + * @param int|string|bool|null $value * @return array|int|string|bool|null */ -function readline_info(?string $varname = null, $newvalue = null): mixed {} +function readline_info(?string $var_name = null, $value = null): mixed {} function readline_add_history(string $prompt): bool {} @@ -22,7 +22,7 @@ function readline_read_history(?string $filename = null): bool {} function readline_write_history(?string $filename = null): bool {} -function readline_completion_function(callable $funcname): bool {} +function readline_completion_function(callable $callback): bool {} #if HAVE_RL_CALLBACK_READ_CHAR diff --git a/ext/readline/readline_arginfo.h b/ext/readline/readline_arginfo.h index a83773b786cdf..0b432d1e4ee35 100644 --- a/ext/readline/readline_arginfo.h +++ b/ext/readline/readline_arginfo.h @@ -1,13 +1,13 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c7d13f6960171cab30984837379db25b32f38c36 */ + * Stub hash: 226b138a99e3e32aea90cbb5c44446ac7c16db71 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readline, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prompt, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_info, 0, 0, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, varname, IS_STRING, 1, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, newvalue, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, var_name, IS_STRING, 1, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, value, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_add_history, 0, 1, _IS_BOOL, 0) @@ -29,7 +29,7 @@ ZEND_END_ARG_INFO() #define arginfo_readline_write_history arginfo_readline_read_history ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_readline_completion_function, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, funcname, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() #if HAVE_RL_CALLBACK_READ_CHAR diff --git a/ext/readline/tests/readline_completion_function_001.phpt b/ext/readline/tests/readline_completion_function_001.phpt index 2556027bff37e..98fae6bbc0755 100644 --- a/ext/readline/tests/readline_completion_function_001.phpt +++ b/ext/readline/tests/readline_completion_function_001.phpt @@ -26,5 +26,5 @@ foreach ($data as $callback) { --EXPECT-- bool(true) bool(true) -readline_completion_function(): Argument #1 ($funcname) must be a valid callback, no array or string given -readline_completion_function(): Argument #1 ($funcname) must be a valid callback, no array or string given +readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given +readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 292e1901e4da9..7b9c37d1eb51e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -142,6 +142,7 @@ typedef struct _attribute_reference { HashTable *attributes; zend_attribute *data; zend_class_entry *scope; + zend_string *filename; uint32_t target; } attribute_reference; @@ -252,9 +253,14 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */ zend_string_release_ex(prop_reference->unmangled_name, 0); efree(intern->ptr); break; - case REF_TYPE_ATTRIBUTE: + case REF_TYPE_ATTRIBUTE: { + attribute_reference *attr_ref = intern->ptr; + if (attr_ref->filename) { + zend_string_release(attr_ref->filename); + } efree(intern->ptr); break; + } case REF_TYPE_GENERATOR: case REF_TYPE_CLASS_CONSTANT: case REF_TYPE_OTHER: @@ -1084,7 +1090,7 @@ static void _extension_string(smart_str *str, zend_module_entry *module, char *i /* {{{ reflection_attribute_factory */ static void reflection_attribute_factory(zval *object, HashTable *attributes, zend_attribute *data, - zend_class_entry *scope, uint32_t target) + zend_class_entry *scope, uint32_t target, zend_string *filename) { reflection_object *intern; attribute_reference *reference; @@ -1095,6 +1101,7 @@ static void reflection_attribute_factory(zval *object, HashTable *attributes, ze reference->attributes = attributes; reference->data = data; reference->scope = scope; + reference->filename = filename ? zend_string_copy(filename) : NULL; reference->target = target; intern->ptr = reference; intern->ref_type = REF_TYPE_ATTRIBUTE; @@ -1102,7 +1109,7 @@ static void reflection_attribute_factory(zval *object, HashTable *attributes, ze /* }}} */ static int read_attributes(zval *ret, HashTable *attributes, zend_class_entry *scope, - uint32_t offset, uint32_t target, zend_string *name, zend_class_entry *base) /* {{{ */ + uint32_t offset, uint32_t target, zend_string *name, zend_class_entry *base, zend_string *filename) /* {{{ */ { ZEND_ASSERT(attributes != NULL); @@ -1115,7 +1122,7 @@ static int read_attributes(zval *ret, HashTable *attributes, zend_class_entry *s ZEND_HASH_FOREACH_PTR(attributes, attr) { if (attr->offset == offset && zend_string_equals(attr->lcname, filter)) { - reflection_attribute_factory(&tmp, attributes, attr, scope, target); + reflection_attribute_factory(&tmp, attributes, attr, scope, target, filename); add_next_index_zval(ret, &tmp); } } ZEND_HASH_FOREACH_END(); @@ -1147,7 +1154,7 @@ static int read_attributes(zval *ret, HashTable *attributes, zend_class_entry *s } } - reflection_attribute_factory(&tmp, attributes, attr, scope, target); + reflection_attribute_factory(&tmp, attributes, attr, scope, target, filename); add_next_index_zval(ret, &tmp); } ZEND_HASH_FOREACH_END(); @@ -1156,7 +1163,7 @@ static int read_attributes(zval *ret, HashTable *attributes, zend_class_entry *s /* }}} */ static void reflect_attributes(INTERNAL_FUNCTION_PARAMETERS, HashTable *attributes, - uint32_t offset, zend_class_entry *scope, uint32_t target) /* {{{ */ + uint32_t offset, zend_class_entry *scope, uint32_t target, zend_string *filename) /* {{{ */ { zend_string *name = NULL; zend_long flags = 0; @@ -1189,7 +1196,7 @@ static void reflect_attributes(INTERNAL_FUNCTION_PARAMETERS, HashTable *attribut array_init(return_value); - if (FAILURE == read_attributes(return_value, attributes, scope, offset, target, name, base)) { + if (FAILURE == read_attributes(return_value, attributes, scope, offset, target, name, base, filename)) { RETURN_THROWS(); } } @@ -1760,7 +1767,9 @@ ZEND_METHOD(ReflectionFunctionAbstract, getAttributes) target = ZEND_ATTRIBUTE_TARGET_FUNCTION; } - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, fptr->common.attributes, 0, fptr->common.scope, target); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, + fptr->common.attributes, 0, fptr->common.scope, target, + fptr->type == ZEND_USER_FUNCTION ? fptr->op_array.filename : NULL); } /* }}} */ @@ -2320,7 +2329,7 @@ ZEND_METHOD(ReflectionParameter, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_name(reference)); + zend_argument_error(reflection_exception_ptr, 1, "must be a string, an array(class, method), or a callable object, %s given", zend_zval_type_name(reference)); RETURN_THROWS(); } @@ -2660,7 +2669,9 @@ ZEND_METHOD(ReflectionParameter, getAttributes) HashTable *attributes = param->fptr->common.attributes; zend_class_entry *scope = param->fptr->common.scope; - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, attributes, param->offset + 1, scope, ZEND_ATTRIBUTE_TARGET_PARAMETER); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, + attributes, param->offset + 1, scope, ZEND_ATTRIBUTE_TARGET_PARAMETER, + param->fptr->type == ZEND_USER_FUNCTION ? param->fptr->op_array.filename : NULL); } /* {{{ Returns whether this parameter is an optional parameter */ @@ -3679,7 +3690,9 @@ ZEND_METHOD(ReflectionClassConstant, getAttributes) GET_REFLECTION_OBJECT_PTR(ref); - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ref->attributes, 0, ref->ce, ZEND_ATTRIBUTE_TARGET_CLASS_CONST); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, + ref->attributes, 0, ref->ce, ZEND_ATTRIBUTE_TARGET_CLASS_CONST, + ref->ce->type == ZEND_USER_CLASS ? ref->ce->info.user.filename : NULL); } /* }}} */ @@ -4076,7 +4089,9 @@ ZEND_METHOD(ReflectionClass, getAttributes) GET_REFLECTION_OBJECT_PTR(ce); - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ce->attributes, 0, ce, ZEND_ATTRIBUTE_TARGET_CLASS); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, + ce->attributes, 0, ce, ZEND_ATTRIBUTE_TARGET_CLASS, + ce->type == ZEND_USER_CLASS ? ce->info.user.filename : NULL); } /* }}} */ @@ -4175,7 +4190,7 @@ ZEND_METHOD(ReflectionClass, getMethods) reflection_object *intern; zend_class_entry *ce; zend_function *mptr; - zend_long filter = 0; + zend_long filter; zend_bool filter_is_null = 1; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { @@ -4351,7 +4366,7 @@ ZEND_METHOD(ReflectionClass, getProperties) zend_class_entry *ce; zend_string *key; zend_property_info *prop_info; - zend_long filter = 0; + zend_long filter; zend_bool filter_is_null = 1; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { @@ -4407,12 +4422,17 @@ ZEND_METHOD(ReflectionClass, getConstants) zend_string *key; zend_class_constant *constant; zval val; - zend_long filter = ZEND_ACC_PPP_MASK; + zend_long filter; + zend_bool filter_is_null = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { RETURN_THROWS(); } + if (filter_is_null) { + filter = ZEND_ACC_PPP_MASK; + } + GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); @@ -4437,12 +4457,17 @@ ZEND_METHOD(ReflectionClass, getReflectionConstants) zend_class_entry *ce; zend_string *name; zend_class_constant *constant; - zend_long filter = ZEND_ACC_PPP_MASK; + zend_long filter; + zend_bool filter_is_null = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { RETURN_THROWS(); } + if (filter_is_null) { + filter = ZEND_ACC_PPP_MASK; + } + GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); @@ -5465,7 +5490,9 @@ ZEND_METHOD(ReflectionProperty, getAttributes) GET_REFLECTION_OBJECT_PTR(ref); - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, + ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY, + ref->prop->ce->type == ZEND_USER_CLASS ? ref->prop->ce->info.user.filename : NULL); } /* }}} */ @@ -6238,9 +6265,14 @@ ZEND_METHOD(ReflectionAttribute, getArguments) } /* }}} */ -static int call_attribute_constructor(zend_class_entry *ce, zend_object *obj, zval *args, uint32_t argc, HashTable *named_params) /* {{{ */ +static int call_attribute_constructor( + zend_attribute *attr, zend_class_entry *ce, zend_object *obj, + zval *args, uint32_t argc, HashTable *named_params, zend_string *filename) { zend_function *ctor = ce->constructor; + zend_execute_data *prev_execute_data, dummy_frame; + zend_function dummy_func; + zend_op dummy_opline; ZEND_ASSERT(ctor != NULL); if (!(ctor->common.fn_flags & ZEND_ACC_PUBLIC)) { @@ -6248,8 +6280,35 @@ static int call_attribute_constructor(zend_class_entry *ce, zend_object *obj, zv return FAILURE; } + if (filename) { + /* Set up dummy call frame that makes it look like the attribute was invoked + * from where it occurs in the code. */ + memset(&dummy_frame, 0, sizeof(zend_execute_data)); + memset(&dummy_func, 0, sizeof(zend_function)); + memset(&dummy_opline, 0, sizeof(zend_op)); + + prev_execute_data = EG(current_execute_data); + dummy_frame.prev_execute_data = prev_execute_data; + dummy_frame.func = &dummy_func; + dummy_frame.opline = &dummy_opline; + + dummy_func.type = ZEND_USER_FUNCTION; + dummy_func.common.fn_flags = + attr->flags & ZEND_ATTRIBUTE_STRICT_TYPES ? ZEND_ACC_STRICT_TYPES : 0; + dummy_func.op_array.filename = filename; + + dummy_opline.opcode = ZEND_DO_FCALL; + dummy_opline.lineno = attr->lineno; + + EG(current_execute_data) = &dummy_frame; + } + zend_call_known_function(ctor, obj, obj->ce, NULL, argc, args, named_params); + if (filename) { + EG(current_execute_data) = prev_execute_data; + } + if (EG(exception)) { zend_object_store_ctor_failed(obj); return FAILURE; @@ -6257,7 +6316,6 @@ static int call_attribute_constructor(zend_class_entry *ce, zend_object *obj, zv return SUCCESS; } -/* }}} */ static void attribute_ctor_cleanup( zval *obj, zval *args, uint32_t argc, HashTable *named_params) /* {{{ */ @@ -6373,7 +6431,7 @@ ZEND_METHOD(ReflectionAttribute, newInstance) } if (ce->constructor) { - if (FAILURE == call_attribute_constructor(ce, Z_OBJ(obj), args, argc, named_params)) { + if (FAILURE == call_attribute_constructor(attr->data, ce, Z_OBJ(obj), args, argc, named_params, attr->filename)) { attribute_ctor_cleanup(&obj, args, argc, named_params); RETURN_THROWS(); } diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 1f4bbb5e8608d..cf6613c3a32ed 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -18,7 +18,7 @@ interface Reflector extends Stringable abstract class ReflectionFunctionAbstract implements Reflector { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} /** @return bool */ @@ -194,7 +194,7 @@ public function getDeclaringClass() {} public function getPrototype() {} /** @return void */ - public function setAccessible(bool $isAccessible) {} + public function setAccessible(bool $accessible) {} } class ReflectionClass implements Reflector @@ -260,10 +260,10 @@ public function getProperties(?int $filter = null) {} public function hasConstant(string $name) {} /** @return array|null */ - public function getConstants(int $filter = ReflectionClassConstant::IS_PUBLIC | ReflectionClassConstant::IS_PROTECTED | ReflectionClassConstant::IS_PRIVATE) {} + public function getConstants(?int $filter = null) {} /** @return ReflectionClassConstant[] */ - public function getReflectionConstants(int $filter = ReflectionClassConstant::IS_PUBLIC | ReflectionClassConstant::IS_PROTECTED | ReflectionClassConstant::IS_PRIVATE) {} + public function getReflectionConstants(?int $filter = null) {} /** @return mixed */ public function getConstant(string $name) {} @@ -364,12 +364,12 @@ public function getAttributes(?string $name = null, int $flags = 0): array {} class ReflectionObject extends ReflectionClass { - public function __construct(object $argument) {} + public function __construct(object $object) {} } class ReflectionProperty implements Reflector { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} public function __construct(object|string $class, string $property) {} @@ -415,7 +415,7 @@ public function getDeclaringClass() {} public function getDocComment() {} /** @return void */ - public function setAccessible(bool $isAccessible) {} + public function setAccessible(bool $accessible) {} /** @return ReflectionType|null */ public function getType() {} @@ -434,7 +434,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array {} class ReflectionClassConstant implements Reflector { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} public function __construct(object|string $class, string $constant) {} @@ -471,11 +471,11 @@ public function getAttributes(?string $name = null, int $flags = 0): array {} class ReflectionParameter implements Reflector { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} /** @param string|array|object $function */ - public function __construct($function, int|string $parameter) {} + public function __construct($function, int|string $param) {} public function __toString(): string {} @@ -550,7 +550,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array {} abstract class ReflectionType implements Stringable { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} /** @return bool */ @@ -575,7 +575,7 @@ public function getTypes(): array {} class ReflectionExtension implements Reflector { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} public function __construct(string $name) {} @@ -618,7 +618,7 @@ public function isTemporary() {} class ReflectionZendExtension implements Reflector { - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ final private function __clone() {} public function __construct(string $name) {} @@ -647,7 +647,7 @@ public static function fromArrayElement(array $array, int|string $key): ?Reflect public function getId(): string {} - /** @alias ReflectionClass::__clone */ + /** @implementation-alias ReflectionClass::__clone */ private function __clone() {} private function __construct() {} diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index d28770ccaa3ca..6044f7f2434cd 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c2bd96bf9b5ca866860f8f3c04937c9fff5c3afa */ + * Stub hash: 4429ea0f96f81c3dbfb2a7e6e00ce49aea4bfeb1 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) @@ -144,7 +144,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionMethod_getPrototype arginfo_class_ReflectionFunctionAbstract___clone ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionMethod_setAccessible, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, isAccessible, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, accessible, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass___clone arginfo_class_ReflectionFunctionAbstract___clone @@ -195,11 +195,9 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_hasConstant arginfo_class_ReflectionClass_hasMethod -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionClass_getConstants, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filter, IS_LONG, 0, "ReflectionClassConstant::IS_PUBLIC | ReflectionClassConstant::IS_PROTECTED | ReflectionClassConstant::IS_PRIVATE") -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionClass_getConstants arginfo_class_ReflectionClass_getMethods -#define arginfo_class_ReflectionClass_getReflectionConstants arginfo_class_ReflectionClass_getConstants +#define arginfo_class_ReflectionClass_getReflectionConstants arginfo_class_ReflectionClass_getMethods #define arginfo_class_ReflectionClass_getConstant arginfo_class_ReflectionClass_hasMethod @@ -277,9 +275,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_getAttributes arginfo_class_ReflectionFunctionAbstract_getAttributes -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionObject___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, argument, IS_OBJECT, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionObject___construct arginfo_class_ReflectionClass_isInstance #define arginfo_class_ReflectionProperty___clone arginfo_class_ReflectionFunctionAbstract___clone @@ -363,7 +359,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ReflectionParameter___construct, 0, 0, 2) ZEND_ARG_INFO(0, function) - ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_LONG|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_MASK(0, param, MAY_BE_LONG|MAY_BE_STRING, NULL) ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter___toString arginfo_class_ReflectionFunction___toString diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index 00e41bfcc9f68..13b6130a407e2 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -166,14 +166,14 @@ Class [ class ReflectionClass implements Reflector, String Method [ public method getConstants ] { - Parameters [1] { - Parameter #0 [ int $filter = ReflectionClassConstant::IS_PUBLIC | ReflectionClassConstant::IS_PROTECTED | ReflectionClassConstant::IS_PRIVATE ] + Parameter #0 [ ?int $filter = null ] } } Method [ public method getReflectionConstants ] { - Parameters [1] { - Parameter #0 [ int $filter = ReflectionClassConstant::IS_PUBLIC | ReflectionClassConstant::IS_PROTECTED | ReflectionClassConstant::IS_PRIVATE ] + Parameter #0 [ ?int $filter = null ] } } diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt index 28214681e820b..849ade406397e 100644 --- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt +++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt @@ -37,7 +37,7 @@ echo "Done.\n"; --EXPECT-- => array_multisort: -Name: array1 +Name: array Is passed by reference: yes Can be passed by value: yes diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index 917f079fd9049..aa88c45449e75 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -44,5 +44,5 @@ Class "A" does not exist Method C::b() does not exist Method C::b() does not exist Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given -Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given +Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be a string, an array(class, method), or a callable object, int given Done. diff --git a/ext/reflection/tests/parameters_001.phpt b/ext/reflection/tests/parameters_001.phpt index 8299a63bf9d69..d50d1a1e720ff 100644 --- a/ext/reflection/tests/parameters_001.phpt +++ b/ext/reflection/tests/parameters_001.phpt @@ -39,4 +39,4 @@ int(1) bool(false) bool(true) string(54) "The parameter specified by its name could not be found" -string(95) "ReflectionParameter::__construct(): Argument #2 ($parameter) must be greater than or equal to 0" +string(91) "ReflectionParameter::__construct(): Argument #2 ($param) must be greater than or equal to 0" diff --git a/ext/session/session.c b/ext/session/session.c index 79b82f90f786f..dd57b6ad0575f 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -536,21 +536,18 @@ static void php_session_normalize_vars() /* {{{ */ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */ { const ps_module *tmp; + int err_type = E_ERROR; SESSION_CHECK_ACTIVE_STATE; SESSION_CHECK_OUTPUT_STATE; tmp = _php_find_ps_module(ZSTR_VAL(new_value)); - if (PG(modules_activated) && !tmp) { - int err_type; - - if (stage == ZEND_INI_STAGE_RUNTIME) { - err_type = E_WARNING; - } else { - err_type = E_ERROR; - } + if (stage == ZEND_INI_STAGE_RUNTIME) { + err_type = E_WARNING; + } + if (PG(modules_activated) && !tmp) { /* Do not output error when restoring ini options. */ if (stage != ZEND_INI_STAGE_DEACTIVATE) { php_error_docref(NULL, err_type, "Session save handler \"%s\" cannot be found", ZSTR_VAL(new_value)); @@ -561,7 +558,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */ /* "user" save handler should not be set by user */ if (!PS(set_handler) && tmp == ps_user_ptr) { - php_error_docref(NULL, E_RECOVERABLE_ERROR, "Session save handler \"user\" cannot be set by ini_set() or session_module_name()"); + php_error_docref(NULL, err_type, "Session save handler \"user\" cannot be set by ini_set()"); return FAILURE; } @@ -1917,6 +1914,10 @@ PHP_FUNCTION(session_module_name) } if (name) { + if (zend_string_equals_literal_ci(name, "user")) { + zend_argument_value_error(1, "cannot be \"user\""); + RETURN_THROWS(); + } if (!_php_find_ps_module(ZSTR_VAL(name))) { php_error_docref(NULL, E_WARNING, "Session handler module \"%s\" cannot be found", ZSTR_VAL(name)); @@ -2033,15 +2034,13 @@ PHP_FUNCTION(session_set_save_handler) if (register_shutdown) { /* create shutdown function */ php_shutdown_function_entry shutdown_function_entry; - shutdown_function_entry.arg_count = 1; - shutdown_function_entry.arguments = (zval *) safe_emalloc(sizeof(zval), 1, 0); - - ZVAL_STRING(&shutdown_function_entry.arguments[0], "session_register_shutdown"); + ZVAL_STRING(&shutdown_function_entry.function_name, "session_register_shutdown"); + shutdown_function_entry.arg_count = 0; + shutdown_function_entry.arguments = NULL; /* add shutdown function, removing the old one if it exists */ if (!register_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1, &shutdown_function_entry)) { - zval_ptr_dtor(&shutdown_function_entry.arguments[0]); - efree(shutdown_function_entry.arguments); + zval_ptr_dtor(&shutdown_function_entry.function_name); php_error_docref(NULL, E_WARNING, "Unable to register session shutdown function"); RETURN_FALSE; } @@ -2664,14 +2663,12 @@ PHP_FUNCTION(session_register_shutdown) * the session still to be available. */ - shutdown_function_entry.arg_count = 1; - shutdown_function_entry.arguments = (zval *) safe_emalloc(sizeof(zval), 1, 0); - - ZVAL_STRING(&shutdown_function_entry.arguments[0], "session_write_close"); + ZVAL_STRING(&shutdown_function_entry.function_name, "session_write_close"); + shutdown_function_entry.arg_count = 0; + shutdown_function_entry.arguments = NULL; - if (!append_user_shutdown_function(shutdown_function_entry)) { - zval_ptr_dtor(&shutdown_function_entry.arguments[0]); - efree(shutdown_function_entry.arguments); + if (!append_user_shutdown_function(&shutdown_function_entry)) { + zval_ptr_dtor(&shutdown_function_entry.function_name); /* Unable to register shutdown function, presumably because of lack * of memory, so flush the session now. It would be done in rshutdown diff --git a/ext/session/session.stub.php b/ext/session/session.stub.php index 36a0b983b9f1c..d8c9b67e50a9e 100644 --- a/ext/session/session.stub.php +++ b/ext/session/session.stub.php @@ -43,35 +43,45 @@ function session_commit(): bool {} * @param callable|object $open * @param callable|bool $close */ -function session_set_save_handler($open, $close = UNKNOWN, callable $read = UNKNOWN, callable $write = UNKNOWN, callable $destroy = UNKNOWN, callable $gc = UNKNOWN, callable $create_sid = UNKNOWN, callable $validate_sid = UNKNOWN, callable $update_timestamp = UNKNOWN): bool {} +function session_set_save_handler( + $open, + $close = UNKNOWN, + callable $read = UNKNOWN, + callable $write = UNKNOWN, + callable $destroy = UNKNOWN, + callable $gc = UNKNOWN, + callable $create_sid = UNKNOWN, + callable $validate_sid = UNKNOWN, + callable $update_timestamp = UNKNOWN +): bool {} -function session_cache_limiter(?string $cache_limiter = null): string|false {} +function session_cache_limiter(?string $value = null): string|false {} -function session_cache_expire(?int $new_cache_expire = null): int|false {} +function session_cache_expire(?int $value = null): int|false {} -function session_set_cookie_params(array|int $lifetime_or_options, ?string $path = null, ?string $domain = null, ?bool $secure = null, ?bool $httponly = null): bool {} +function session_set_cookie_params(array|int $lifetime_or_options, ?string $path = null, ?string $domain = null, ?bool $secure = null, ?bool $httponly = null): bool {} function session_start(array $options = []): bool {} interface SessionHandlerInterface { /** @return bool */ - public function open(string $save_path, string $session_name); + public function open(string $path, string $name); /** @return bool */ public function close(); /** @return string */ - public function read(string $key); + public function read(string $id); /** @return bool */ - public function write(string $key, string $val); + public function write(string $id, string $data); /** @return bool */ - public function destroy(string $key); + public function destroy(string $id); /** @return int|bool */ - public function gc(int $maxlifetime); + public function gc(int $max_lifetime); } interface SessionIdInterface @@ -83,31 +93,31 @@ public function create_sid(); interface SessionUpdateTimestampHandlerInterface { /** @return bool */ - public function validateId(string $key); + public function validateId(string $id); /** @return bool */ - public function updateTimestamp(string $key, string $val); + public function updateTimestamp(string $id, string $data); } class SessionHandler implements SessionHandlerInterface, SessionIdInterface { /** @return bool */ - public function open(string $save_path, string $session_name) {} + public function open(string $path, string $name) {} /** @return bool */ public function close() {} /** @return string */ - public function read(string $key) {} + public function read(string $id) {} /** @return bool */ - public function write(string $key, string $val) {} + public function write(string $id, string $data) {} /** @return bool */ - public function destroy(string $key) {} + public function destroy(string $id) {} /** @return int|bool */ - public function gc(int $maxlifetime) {} + public function gc(int $max_lifetime) {} /** @return string */ public function create_sid() {} diff --git a/ext/session/session_arginfo.h b/ext/session/session_arginfo.h index f29a0df86b8e2..0c82feabb2033 100644 --- a/ext/session/session_arginfo.h +++ b/ext/session/session_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9bdf602c14822b13553a5214a415e312c21cd30c */ + * Stub hash: 8175feea632f2832e43d830e70dc9332377b9f22 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_name, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") @@ -70,11 +70,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_set_save_handler, 0, 1, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_cache_limiter, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cache_limiter, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_cache_expire, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, new_cache_expire, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_set_cookie_params, 0, 1, _IS_BOOL, 0) @@ -90,26 +90,26 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_start, 0, 0, _IS_BOOL, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_open, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, save_path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, session_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_close, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_read, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_write, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_class_SessionHandlerInterface_destroy arginfo_class_SessionHandlerInterface_read ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_gc, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, max_lifetime, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_class_SessionIdInterface_create_sid arginfo_class_SessionHandlerInterface_close diff --git a/ext/session/tests/bug60860.phpt b/ext/session/tests/bug60860.phpt index 487fba53074c6..fbd8a6eeab9ed 100644 --- a/ext/session/tests/bug60860.phpt +++ b/ext/session/tests/bug60860.phpt @@ -15,5 +15,5 @@ echo "ok\n"; ?> --EXPECT-- -Recoverable fatal error: PHP Startup: Session save handler "user" cannot be set by ini_set() or session_module_name() in Unknown on line 0 +Fatal error: PHP Startup: Session save handler "user" cannot be set by ini_set() in Unknown on line 0 ok diff --git a/ext/session/tests/bug73100.phpt b/ext/session/tests/bug73100.phpt index a59e9f41cc123..a9c140aa88bd0 100644 --- a/ext/session/tests/bug73100.phpt +++ b/ext/session/tests/bug73100.phpt @@ -14,7 +14,11 @@ var_dump(session_start()); session_module_name("user"); var_dump(session_destroy()); -session_module_name("user"); +try { + session_module_name("user"); +} catch (\ValueError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ===DONE=== --EXPECTF-- @@ -22,5 +26,5 @@ bool(true) Warning: session_module_name(): Session save handler module cannot be changed when a session is active in %s on line %d bool(true) - -Recoverable fatal error: session_module_name(): Session save handler "user" cannot be set by ini_set() or session_module_name() in %s on line %d +session_module_name(): Argument #1 ($module) cannot be "user" +===DONE=== diff --git a/ext/session/tests/error_when_setting_save_handler_ini_setting_in_runtime.phpt b/ext/session/tests/error_when_setting_save_handler_ini_setting_in_runtime.phpt new file mode 100644 index 0000000000000..f176a7ae79d47 --- /dev/null +++ b/ext/session/tests/error_when_setting_save_handler_ini_setting_in_runtime.phpt @@ -0,0 +1,12 @@ +--TEST-- +Error when setting session.save_handler to user via ini_set +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: ini_set(): Session save handler "user" cannot be set by ini_set() in %s on line %d diff --git a/ext/session/tests/session_set_save_handler_class_014.phpt b/ext/session/tests/session_set_save_handler_class_014.phpt index 6eee4f8b6a31f..ff1b84a87e9d8 100644 --- a/ext/session/tests/session_set_save_handler_class_014.phpt +++ b/ext/session/tests/session_set_save_handler_class_014.phpt @@ -21,5 +21,5 @@ session_set_save_handler($handler); session_start(); ?> --EXPECT-- -Recoverable fatal error: PHP Startup: Session save handler "user" cannot be set by ini_set() or session_module_name() in Unknown on line 0 +Fatal error: PHP Startup: Session save handler "user" cannot be set by ini_set() in Unknown on line 0 *** Testing session_set_save_handler() : calling default handler when save_handler=user *** diff --git a/ext/shmop/shmop.stub.php b/ext/shmop/shmop.stub.php index cddb9c64f4892..94859535021af 100644 --- a/ext/shmop/shmop.stub.php +++ b/ext/shmop/shmop.stub.php @@ -4,15 +4,15 @@ final class Shmop {} -function shmop_open(int $key, string $flags, int $mode, int $size): Shmop|false {} +function shmop_open(int $key, string $mode, int $permissions, int $size): Shmop|false {} -function shmop_read(Shmop $shmid, int $start, int $count): string {} +function shmop_read(Shmop $shmop, int $offset, int $size): string {} /** @deprecated */ -function shmop_close(Shmop $shmid): void {} +function shmop_close(Shmop $shmop): void {} -function shmop_size(Shmop $shmid): int {} +function shmop_size(Shmop $shmop): int {} -function shmop_write(Shmop $shmid, string $data, int $offset): int {} +function shmop_write(Shmop $shmop, string $data, int $offset): int {} -function shmop_delete(Shmop $shmid): bool {} +function shmop_delete(Shmop $shmop): bool {} diff --git a/ext/shmop/shmop_arginfo.h b/ext/shmop/shmop_arginfo.h index 211204720ad0a..3b92a62c2c761 100644 --- a/ext/shmop/shmop_arginfo.h +++ b/ext/shmop/shmop_arginfo.h @@ -1,35 +1,35 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 1fe8d001718e20ca915480d1ab6cb6996115b547 */ + * Stub hash: 81173e82e0378d5b5c729a3cce8561e0ca56e092 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_shmop_open, 0, 4, Shmop, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, flags, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, permissions, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_read, 0, 3, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, shmid, Shmop, 0) - ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, shmop, Shmop, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_close, 0, 1, IS_VOID, 0) - ZEND_ARG_OBJ_INFO(0, shmid, Shmop, 0) + ZEND_ARG_OBJ_INFO(0, shmop, Shmop, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_size, 0, 1, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, shmid, Shmop, 0) + ZEND_ARG_OBJ_INFO(0, shmop, Shmop, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_write, 0, 3, IS_LONG, 0) - ZEND_ARG_OBJ_INFO(0, shmid, Shmop, 0) + ZEND_ARG_OBJ_INFO(0, shmop, Shmop, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shmop_delete, 0, 1, _IS_BOOL, 0) - ZEND_ARG_OBJ_INFO(0, shmid, Shmop, 0) + ZEND_ARG_OBJ_INFO(0, shmop, Shmop, 0) ZEND_END_ARG_INFO() diff --git a/ext/shmop/tests/002.phpt b/ext/shmop/tests/002.phpt index 40bbdbff23f84..2cd9db6187110 100644 --- a/ext/shmop/tests/002.phpt +++ b/ext/shmop/tests/002.phpt @@ -74,8 +74,8 @@ shmop_delete($shm_id); ?> --EXPECTF-- ## shmop_open function tests ## -shmop_open(): Argument #2 ($flags) must be a valid access mode -shmop_open(): Argument #2 ($flags) must be a valid access mode +shmop_open(): Argument #2 ($mode) must be a valid access mode +shmop_open(): Argument #2 ($mode) must be a valid access mode Warning: shmop_open(): Unable to attach or create shared memory segment "%s" in %s on line %d bool(false) @@ -84,8 +84,8 @@ Warning: shmop_open(): Unable to attach or create shared memory segment "%s" in shmop_open(): Argument #4 ($size) must be greater than 0 for the "c" and "n" access modes ## shmop_read function tests ## -shmop_read(): Argument #2 ($start) must be between 0 and the segment size -shmop_read(): Argument #3 ($count) is out of range +shmop_read(): Argument #2 ($offset) must be between 0 and the segment size +shmop_read(): Argument #3 ($size) is out of range ## shmop_write function tests ## shmop_write(): Argument #3 ($offset) is out of range diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 5eb8d0b33870d..0ca49fc208cd2 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -941,7 +941,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot) s->securityAuthProto = usmHMACSHA1AuthProtocol; s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN; } else { - zend_value_error("Authentication protocol must be either MD5 or SHA"); + zend_value_error("Authentication protocol must be either \"MD5\" or \"SHA\""); return (-1); } return (0); @@ -962,9 +962,9 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot) #endif } else { #ifdef HAVE_AES - zend_value_error("Security protocol must be one of DES, AES128, or AES"); + zend_value_error("Security protocol must be one of \"DES\", \"AES128\", or \"AES\""); #else - zend_value_error("Security protocol must be DES"); + zend_value_error("Security protocol must be \"DES\""); #endif return (-1); } diff --git a/ext/snmp/tests/snmp-object-setSecurity_error.phpt b/ext/snmp/tests/snmp-object-setSecurity_error.phpt index b0bf03bd3d5e2..7d5f1912daee5 100644 --- a/ext/snmp/tests/snmp-object-setSecurity_error.phpt +++ b/ext/snmp/tests/snmp-object-setSecurity_error.phpt @@ -59,15 +59,15 @@ var_dump($session->close()); --EXPECTF-- Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" -Authentication protocol must be either MD5 or SHA +Authentication protocol must be either "MD5" or "SHA" Warning: SNMP::setSecurity(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) Warning: SNMP::setSecurity(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d bool(false) -Security protocol must be one of DES, AES128, or AES -Security protocol must be one of DES, AES128, or AES +Security protocol must be one of "DES", "AES128", or "AES" +Security protocol must be one of "DES", "AES128", or "AES" Warning: SNMP::setSecurity(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) diff --git a/ext/snmp/tests/snmp3-error.phpt b/ext/snmp/tests/snmp3-error.phpt index 7c07d13fa957f..20b4ede70e50d 100644 --- a/ext/snmp/tests/snmp3-error.phpt +++ b/ext/snmp/tests/snmp3-error.phpt @@ -58,14 +58,14 @@ try { Checking error handling Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" -Authentication protocol must be either MD5 or SHA +Authentication protocol must be either "MD5" or "SHA" Warning: snmp3_get(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) Warning: snmp3_get(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d bool(false) -Security protocol must be one of DES, AES128, or AES +Security protocol must be one of "DES", "AES128", or "AES" Warning: snmp3_get(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index fc80b4a79ca25..c9ee033b146d3 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -1612,8 +1612,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp attr = get_attribute(attrs, "default"); if (attr) { if (ref != NULL) { - soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes"); - } else if (ref != NULL) { soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes"); } cur_type->def = estrdup((char*)attr->children->content); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 446436db5f87c..60a4ca5cc97fe 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -587,7 +587,7 @@ PHP_METHOD(SoapHeader, __construct) if ((actor_long == SOAP_ACTOR_NEXT || actor_long == SOAP_ACTOR_NONE || actor_long == SOAP_ACTOR_UNLIMATERECEIVER)) { add_property_long(this_ptr, "actor", actor_long); } else { - zend_argument_value_error(5, "must be either SOAP_ACTOR_NEXT, SOAP_ACTOR_NONE or SOAP_ACTOR_UNLIMATERECEIVER"); + zend_argument_value_error(5, "must be one of SOAP_ACTOR_NEXT, SOAP_ACTOR_NONE, or SOAP_ACTOR_UNLIMATERECEIVER"); RETURN_THROWS(); } } @@ -2023,8 +2023,8 @@ PHP_METHOD(SoapClient, __construct) } if ((tmp = zend_hash_str_find(ht, "soap_version", sizeof("soap_version")-1)) != NULL) { - if (Z_TYPE_P(tmp) == IS_LONG || - (Z_LVAL_P(tmp) == SOAP_1_1 && Z_LVAL_P(tmp) == SOAP_1_2)) { + if (Z_TYPE_P(tmp) == IS_LONG && + (Z_LVAL_P(tmp) == SOAP_1_1 || Z_LVAL_P(tmp) == SOAP_1_2)) { soap_version = Z_LVAL_P(tmp); } } diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 21c107adecfc7..0b21c4f6843ff 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1137,7 +1137,7 @@ PHP_FUNCTION(socket_getsockname) break; default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } } @@ -1212,7 +1212,7 @@ PHP_FUNCTION(socket_getpeername) break; default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } } @@ -1233,12 +1233,12 @@ PHP_FUNCTION(socket_create) && domain != AF_INET6 #endif && domain != AF_INET) { - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET6, or AF_INET"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET6, or AF_INET"); RETURN_THROWS(); } if (type > 10) { - zend_argument_value_error(2, "must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," + zend_argument_value_error(2, "must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," " SOCK_RAW, or SOCK_RDM"); RETURN_THROWS(); } @@ -1337,7 +1337,7 @@ PHP_FUNCTION(socket_connect) } default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1431,7 +1431,7 @@ PHP_FUNCTION(socket_bind) } #endif default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1625,7 +1625,7 @@ PHP_FUNCTION(socket_recvfrom) break; #endif default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1705,7 +1705,7 @@ PHP_FUNCTION(socket_sendto) break; #endif default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1987,12 +1987,12 @@ PHP_FUNCTION(socket_create_pair) && domain != AF_INET6 #endif && domain != AF_UNIX) { - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET6 or AF_INET"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET6, or AF_INET"); RETURN_THROWS(); } if (type > 10) { - zend_argument_value_error(2, "must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," + zend_argument_value_error(2, "must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," " SOCK_RAW, or SOCK_RDM"); RETURN_THROWS(); } @@ -2315,8 +2315,9 @@ PHP_FUNCTION(socket_addrinfo_lookup) } else if (zend_string_equals_literal(key, "ai_family")) { hints.ai_family = zval_get_long(hint); } else { - /* TODO Promote to warning/error? */ - php_error_docref(NULL, E_NOTICE, "Unknown hint %s", ZSTR_VAL(key)); + zend_argument_value_error(3, "must only contain array keys \"ai_flags\", \"ai_socktype\", " + "\"ai_protocol\", or \"ai_family\""); + RETURN_THROWS(); } } } ZEND_HASH_FOREACH_END(); @@ -2402,7 +2403,7 @@ PHP_FUNCTION(socket_addrinfo_bind) default: close(php_sock->bsd_socket); zval_ptr_dtor(return_value); - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -2463,7 +2464,7 @@ PHP_FUNCTION(socket_addrinfo_connect) break; } default: - zend_argument_value_error(1, "socket type must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "socket type must be one of AF_UNIX, AF_INET, or AF_INET6"); close(php_sock->bsd_socket); zval_ptr_dtor(return_value); RETURN_THROWS(); diff --git a/ext/sockets/tests/socket_addrinfo_lookup.phpt b/ext/sockets/tests/socket_addrinfo_lookup.phpt index 2d9ef391969c1..d85fef519e216 100644 --- a/ext/sockets/tests/socket_addrinfo_lookup.phpt +++ b/ext/sockets/tests/socket_addrinfo_lookup.phpt @@ -7,16 +7,16 @@ if (!extension_loaded('sockets')) { } --FILE-- AF_INET, - 'ai_socktype' => SOCK_DGRAM, - 'invalid' => null, -)); -var_dump($addrinfo[0]); -echo "Done"; -?> ---EXPECTF-- -Notice: socket_addrinfo_lookup(): Unknown hint invalid in %ssocket_addrinfo_lookup.php on line %d -object(AddressInfo)#%d (0) { +try { + $addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array( + 'ai_family' => AF_INET, + 'ai_socktype' => SOCK_DGRAM, + 'invalid' => null, + )); + var_dump($addrinfo[0]); +} catch (\ValueError $e) { + echo $e->getMessage(), \PHP_EOL; } -Done +?> +--EXPECT-- +socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" diff --git a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt index 1abab2a1e775c..ff4dd5de064ea 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt @@ -27,8 +27,8 @@ try { ?> --EXPECT-- bool(true) -socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET -socket_create_pair(): Argument #2 ($type) must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM +socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET +socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/sockets/tests/socket_create_pair-wrongparams.phpt b/ext/sockets/tests/socket_create_pair-wrongparams.phpt index 8dc56d1e366ad..57111c83f1901 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams.phpt @@ -29,8 +29,8 @@ try { --EXPECTF-- Warning: socket_create_pair(): Unable to create socket pair [%d]: %s not supported in %s on line %d bool(false) -socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET -socket_create_pair(): Argument #2 ($type) must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM +socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET +socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/spl/spl_array.stub.php b/ext/spl/spl_array.stub.php index 114f1b6e321ed..b3a058806c88a 100755 --- a/ext/spl/spl_array.stub.php +++ b/ext/spl/spl_array.stub.php @@ -98,118 +98,118 @@ public function __construct(array|object $array = [], int $flags = 0) {} /** * @param string|int $index * @return bool - * @alias ArrayObject::offsetExists + * @implementation-alias ArrayObject::offsetExists */ public function offsetExists($index) {} /** * @param string|int $index * @return mixed - * @alias ArrayObject::offsetGet + * @implementation-alias ArrayObject::offsetGet */ public function offsetGet($index) {} /** * @param string|int $index * @return void - * @alias ArrayObject::offsetSet + * @implementation-alias ArrayObject::offsetSet */ public function offsetSet($index, mixed $value) {} /** * @param string|int $index * @return void - * @alias ArrayObject::offsetUnset + * @implementation-alias ArrayObject::offsetUnset */ public function offsetUnset($index) {} /** * @return void - * @alias ArrayObject::append + * @implementation-alias ArrayObject::append */ public function append(mixed $value) {} /** * @return array - * @alias ArrayObject::getArrayCopy + * @implementation-alias ArrayObject::getArrayCopy */ public function getArrayCopy() {} /** * @return int - * @alias ArrayObject::count + * @implementation-alias ArrayObject::count */ public function count() {} /** * @return int - * @alias ArrayObject::getFlags + * @implementation-alias ArrayObject::getFlags */ public function getFlags() {} /** * @return void - * @alias ArrayObject::setFlags + * @implementation-alias ArrayObject::setFlags */ public function setFlags(int $flags) {} /** * @return bool - * @alias ArrayObject::asort + * @implementation-alias ArrayObject::asort */ public function asort(int $sort_flags = SORT_REGULAR) {} /** * @return bool - * @alias ArrayObject::ksort + * @implementation-alias ArrayObject::ksort */ public function ksort(int $sort_flags = SORT_REGULAR) {} /** * @return bool - * @alias ArrayObject::uasort + * @implementation-alias ArrayObject::uasort */ public function uasort(callable $cmp_function) {} /** * @return bool - * @alias ArrayObject::uksort + * @implementation-alias ArrayObject::uksort */ public function uksort(callable $cmp_function) {} /** * @return bool - * @alias ArrayObject::natsort + * @implementation-alias ArrayObject::natsort */ public function natsort() {} /** * @return bool - * @alias ArrayObject::natcasesort + * @implementation-alias ArrayObject::natcasesort */ public function natcasesort() {} /** * @return void - * @alias ArrayObject::unserialize + * @implementation-alias ArrayObject::unserialize */ public function unserialize(string $serialized) {} /** * @return string - * @alias ArrayObject::serialize + * @implementation-alias ArrayObject::serialize */ public function serialize() {} /** * @return array - * @alias ArrayObject::__serialize + * @implementation-alias ArrayObject::__serialize */ public function __serialize() {} /** * @return void - * @alias ArrayObject::__unserialize + * @implementation-alias ArrayObject::__unserialize */ public function __unserialize(array $data) {} @@ -233,7 +233,7 @@ public function seek(int $position) {} /** * @return array - * @alias ArrayObject::__debugInfo + * @implementation-alias ArrayObject::__debugInfo */ public function __debugInfo() {} } diff --git a/ext/spl/spl_array_arginfo.h b/ext/spl/spl_array_arginfo.h index 1f5fdcc0614ad..75bc3576133c3 100644 --- a/ext/spl/spl_array_arginfo.h +++ b/ext/spl/spl_array_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: bedd13338707177e28a021722df64be2f74a7945 */ + * Stub hash: 1b93d102c6dfa12f65a95a50bbc78c03802e261c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0) ZEND_ARG_TYPE_MASK(0, input, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]") diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index cc5e4b7ac4849..a67b9efb03d70 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2328,13 +2328,12 @@ PHP_METHOD(SplFileObject, fgetcsv) CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); - // TODO Align behaviour on normal fgetcsv() switch(ZEND_NUM_ARGS()) { case 3: if (esc_len > 1) { - php_error_docref(NULL, E_WARNING, "escape must be empty or a single character"); - RETURN_FALSE; + zend_argument_value_error(3, "must be empty or a single character"); + RETURN_THROWS(); } if (esc_len == 0) { escape = PHP_CSV_NO_ESCAPE; @@ -2344,15 +2343,15 @@ PHP_METHOD(SplFileObject, fgetcsv) /* no break */ case 2: if (e_len != 1) { - php_error_docref(NULL, E_WARNING, "enclosure must be a character"); - RETURN_FALSE; + zend_argument_value_error(2, "must be a single character"); + RETURN_THROWS(); } enclosure = enclo[0]; /* no break */ case 1: if (d_len != 1) { - php_error_docref(NULL, E_WARNING, "delimiter must be a character"); - RETURN_FALSE; + zend_argument_value_error(1, "must be a single character"); + RETURN_THROWS(); } delimiter = delim[0]; /* no break */ @@ -2377,7 +2376,6 @@ PHP_METHOD(SplFileObject, fputcsv) if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { - // TODO Align behaviour on normal fputcsv() switch(ZEND_NUM_ARGS()) { case 4: @@ -2389,21 +2387,21 @@ PHP_METHOD(SplFileObject, fputcsv) escape = (unsigned char) esc[0]; break; default: - php_error_docref(NULL, E_WARNING, "escape must be empty or a single character"); - RETURN_FALSE; + zend_argument_value_error(4, "must be empty or a single character"); + RETURN_THROWS(); } /* no break */ case 3: if (e_len != 1) { - php_error_docref(NULL, E_WARNING, "enclosure must be a character"); - RETURN_FALSE; + zend_argument_value_error(3, "must be a single character"); + RETURN_THROWS(); } enclosure = enclo[0]; /* no break */ case 2: if (d_len != 1) { - php_error_docref(NULL, E_WARNING, "delimiter must be a character"); - RETURN_FALSE; + zend_argument_value_error(2, "must be a single character"); + RETURN_THROWS(); } delimiter = delim[0]; /* no break */ @@ -2430,7 +2428,6 @@ PHP_METHOD(SplFileObject, setCsvControl) size_t d_len = 0, e_len = 0, esc_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) { - // TODO Align behaviour on normal fgetcsv() switch(ZEND_NUM_ARGS()) { case 3: @@ -2442,21 +2439,21 @@ PHP_METHOD(SplFileObject, setCsvControl) escape = (unsigned char) esc[0]; break; default: - php_error_docref(NULL, E_WARNING, "escape must be empty or a single character"); - RETURN_FALSE; + zend_argument_value_error(3, "must be empty or a single character"); + RETURN_THROWS(); } /* no break */ case 2: if (e_len != 1) { - php_error_docref(NULL, E_WARNING, "enclosure must be a character"); - RETURN_FALSE; + zend_argument_value_error(2, "must be a single character"); + RETURN_THROWS(); } enclosure = enclo[0]; /* no break */ case 1: if (d_len != 1) { - php_error_docref(NULL, E_WARNING, "delimiter must be a character"); - RETURN_FALSE; + zend_argument_value_error(1, "must be a single character"); + RETURN_THROWS(); } delimiter = delim[0]; /* no break */ diff --git a/ext/spl/spl_directory.stub.php b/ext/spl/spl_directory.stub.php index 92c9f8813a2c1..e72a4e5f415c3 100755 --- a/ext/spl/spl_directory.stub.php +++ b/ext/spl/spl_directory.stub.php @@ -90,7 +90,7 @@ public function setFileClass(string $class_name = SplFileObject::class) {} /** @return void */ public function setInfoClass(string $class_name = SplFileInfo::class) {} - /** @alias SplFileInfo::getPathname */ + /** @implementation-alias SplFileInfo::getPathname */ public function __toString(): string {} /** @return array */ @@ -134,7 +134,7 @@ public function next() {} /** @return void */ public function seek(int $position) {} - /** @alias DirectoryIterator::getFilename */ + /** @implementation-alias DirectoryIterator::getFilename */ public function __toString(): string {} } @@ -286,7 +286,7 @@ public function seek(int $line_pos) {} */ public function getCurrentLine() {} - /** @alias SplFileObject::fgets */ + /** @implementation-alias SplFileObject::fgets */ public function __toString(): string {} } diff --git a/ext/spl/spl_directory_arginfo.h b/ext/spl/spl_directory_arginfo.h index 4f1961345fd4f..3f961d2691ebf 100644 --- a/ext/spl/spl_directory_arginfo.h +++ b/ext/spl/spl_directory_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4bf9a6a3687e5d14883d35b26c13b05216c86ac3 */ + * Stub hash: 071a92d8e5998c518e377b5620dfdda6fb189a1d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFileInfo___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, file_name, IS_STRING, 0) diff --git a/ext/spl/spl_dllist.stub.php b/ext/spl/spl_dllist.stub.php index 176aa15848581..d3f679a7fbe7e 100755 --- a/ext/spl/spl_dllist.stub.php +++ b/ext/spl/spl_dllist.stub.php @@ -99,13 +99,13 @@ class SplQueue extends SplDoublyLinkedList { /** * @return void - * @alias SplDoublyLinkedList::push + * @implementation-alias SplDoublyLinkedList::push */ public function enqueue(mixed $value) {} /** * @return mixed - * @alias SplDoublyLinkedList::shift + * @implementation-alias SplDoublyLinkedList::shift */ public function dequeue() {} } diff --git a/ext/spl/spl_dllist_arginfo.h b/ext/spl/spl_dllist_arginfo.h index 4ad6e4db5574a..afd1278d58adf 100644 --- a/ext/spl/spl_dllist_arginfo.h +++ b/ext/spl/spl_dllist_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 26a454261393ea3bdb6252b2d8140434664b5771 */ + * Stub hash: 9d17266fba7a05a5fddca0ddf6b64b1c2f683cae */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplDoublyLinkedList_add, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 915e55f17cc6c..4b0d186a78d28 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -39,50 +39,66 @@ PHPAPI zend_class_entry *spl_ce_SplFixedArray; ZEND_GET_MODULE(spl_fixedarray) #endif -typedef struct _spl_fixedarray { /* {{{ */ +typedef struct _spl_fixedarray { zend_long size; zval *elements; } spl_fixedarray; -/* }}} */ - -typedef struct _spl_fixedarray_object { /* {{{ */ - spl_fixedarray array; - zend_function *fptr_offset_get; - zend_function *fptr_offset_set; - zend_function *fptr_offset_has; - zend_function *fptr_offset_del; - zend_function *fptr_count; - int current; - int flags; - zend_object std; + +typedef struct _spl_fixedarray_object { + spl_fixedarray array; + zend_function *fptr_offset_get; + zend_function *fptr_offset_set; + zend_function *fptr_offset_has; + zend_function *fptr_offset_del; + zend_function *fptr_count; + zend_object std; } spl_fixedarray_object; -/* }}} */ -typedef struct _spl_fixedarray_it { /* {{{ */ - zend_user_iterator intern; +typedef struct _spl_fixedarray_it { + zend_object_iterator intern; + zend_long current; } spl_fixedarray_it; -/* }}} */ - -#define SPL_FIXEDARRAY_OVERLOADED_REWIND 0x0001 -#define SPL_FIXEDARRAY_OVERLOADED_VALID 0x0002 -#define SPL_FIXEDARRAY_OVERLOADED_KEY 0x0004 -#define SPL_FIXEDARRAY_OVERLOADED_CURRENT 0x0008 -#define SPL_FIXEDARRAY_OVERLOADED_NEXT 0x0010 -static inline spl_fixedarray_object *spl_fixed_array_from_obj(zend_object *obj) /* {{{ */ { +static spl_fixedarray_object *spl_fixed_array_from_obj(zend_object *obj) +{ return (spl_fixedarray_object*)((char*)(obj) - XtOffsetOf(spl_fixedarray_object, std)); } -/* }}} */ #define Z_SPLFIXEDARRAY_P(zv) spl_fixed_array_from_obj(Z_OBJ_P((zv))) -static inline void spl_fixedarray_init_elems(spl_fixedarray *array, size_t from, size_t to) { - for (size_t i = from; i < to; i++) { - ZVAL_NULL(&array->elements[i]); +/* Helps enforce the invariants in debug mode: + * - if size == 0, then elements == NULL + * - if size > 0, then elements != NULL + * - size is not less than 0 + */ +static bool spl_fixedarray_empty(spl_fixedarray *array) +{ + if (array->elements) { + ZEND_ASSERT(array->size > 0); + return false; + } + ZEND_ASSERT(array->size == 0); + return true; +} + +static void spl_fixedarray_default_ctor(spl_fixedarray *array) +{ + array->size = 0; + array->elements = NULL; +} + +/* Initializes the range [from, to) to null. Does not dtor existing elements. */ +static void spl_fixedarray_init_elems(spl_fixedarray *array, zend_long from, zend_long to) +{ + ZEND_ASSERT(from <= to); + zval *begin = array->elements + from, *end = array->elements + to; + + while (begin != end) { + ZVAL_NULL(begin++); } } -static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) /* {{{ */ +static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) { if (size > 0) { array->size = 0; /* reset size in case ecalloc() fails */ @@ -90,13 +106,57 @@ static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) /* {{{ */ array->size = size; spl_fixedarray_init_elems(array, 0, size); } else { - array->elements = NULL; - array->size = 0; + spl_fixedarray_default_ctor(array); + } +} + +/* Copies the range [begin, end) into the fixedarray, beginning at `offset`. + * Does not dtor the existing elements. + */ +static void spl_fixedarray_copy_range(spl_fixedarray *array, zend_long offset, zval *begin, zval *end) +{ + ZEND_ASSERT(offset >= 0); + ZEND_ASSERT(array->size - offset >= end - begin); + + zval *to = &array->elements[offset]; + while (begin != end) { + ZVAL_COPY(to++, begin++); + } +} + +static void spl_fixedarray_copy_ctor(spl_fixedarray *to, spl_fixedarray *from) +{ + zend_long size = from->size; + spl_fixedarray_init(to, size); + + zval *begin = from->elements, *end = from->elements + size; + spl_fixedarray_copy_range(to, 0, begin, end); +} + +/* Destructs the elements in the range [from, to). + * Caller is expected to bounds check. + */ +static void spl_fixedarray_dtor_range(spl_fixedarray *array, zend_long from, zend_long to) +{ + zval *begin = array->elements + from, *end = array->elements + to; + while (begin != end) { + zval_ptr_dtor(begin++); + } +} + +/* Destructs and frees contents but not the array itself. + * If you want to re-use the array then you need to re-initialize it. + */ +static void spl_fixedarray_dtor(spl_fixedarray *array) +{ + zend_long size = array->size; + if (!spl_fixedarray_empty(array)) { + spl_fixedarray_dtor_range(array, 0, size); + efree(array->elements); } } -/* }}} */ -static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) /* {{{ */ +static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) { if (size == array->size) { /* nothing to do */ @@ -111,42 +171,20 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) /* {{{ /* clearing the array */ if (size == 0) { - zend_long i; - - for (i = 0; i < array->size; i++) { - zval_ptr_dtor(&(array->elements[i])); - } - - if (array->elements) { - efree(array->elements); - array->elements = NULL; - } + spl_fixedarray_dtor(array); + array->elements = NULL; } else if (size > array->size) { array->elements = safe_erealloc(array->elements, size, sizeof(zval), 0); spl_fixedarray_init_elems(array, array->size, size); } else { /* size < array->size */ - zend_long i; - - for (i = size; i < array->size; i++) { - zval_ptr_dtor(&(array->elements[i])); - } + spl_fixedarray_dtor_range(array, size, array->size); array->elements = erealloc(array->elements, sizeof(zval) * size); } array->size = size; } -/* }}} */ - -static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from) /* {{{ */ -{ - int i; - for (i = 0; i < from->size; i++) { - ZVAL_COPY(&to->elements[i], &from->elements[i]); - } -} -/* }}} */ -static HashTable* spl_fixedarray_object_get_gc(zend_object *obj, zval **table, int *n) /* {{{{ */ +static HashTable* spl_fixedarray_object_get_gc(zend_object *obj, zval **table, int *n) { spl_fixedarray_object *intern = spl_fixed_array_from_obj(obj); HashTable *ht = zend_std_get_properties(obj); @@ -156,23 +194,21 @@ static HashTable* spl_fixedarray_object_get_gc(zend_object *obj, zval **table, i return ht; } -/* }}}} */ -static HashTable* spl_fixedarray_object_get_properties(zend_object *obj) /* {{{{ */ +static HashTable* spl_fixedarray_object_get_properties(zend_object *obj) { spl_fixedarray_object *intern = spl_fixed_array_from_obj(obj); HashTable *ht = zend_std_get_properties(obj); - zend_long i = 0; - if (intern->array.size > 0) { + if (!spl_fixedarray_empty(&intern->array)) { zend_long j = zend_hash_num_elements(ht); - for (i = 0; i < intern->array.size; i++) { + for (zend_long i = 0; i < intern->array.size; i++) { zend_hash_index_update(ht, i, &intern->array.elements[i]); Z_TRY_ADDREF(intern->array.elements[i]); } if (j > intern->array.size) { - for (i = intern->array.size; i < j; ++i) { + for (zend_long i = intern->array.size; i < j; ++i) { zend_hash_index_del(ht, i); } } @@ -180,48 +216,28 @@ static HashTable* spl_fixedarray_object_get_properties(zend_object *obj) /* {{{{ return ht; } -/* }}}} */ -static void spl_fixedarray_object_free_storage(zend_object *object) /* {{{ */ +static void spl_fixedarray_object_free_storage(zend_object *object) { spl_fixedarray_object *intern = spl_fixed_array_from_obj(object); - zend_long i; - - if (intern->array.size > 0) { - for (i = 0; i < intern->array.size; i++) { - zval_ptr_dtor(&(intern->array.elements[i])); - } - - if (intern->array.size > 0 && intern->array.elements) { - efree(intern->array.elements); - } - } - + spl_fixedarray_dtor(&intern->array); zend_object_std_dtor(&intern->std); } -/* }}} */ - -zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref); -static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zend_object *orig, int clone_orig) /* {{{ */ +static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zend_object *orig, bool clone_orig) { spl_fixedarray_object *intern; - zend_class_entry *parent = class_type; - int inherited = 0; - zend_class_iterator_funcs *funcs_ptr; + zend_class_entry *parent = class_type; + bool inherited = false; intern = zend_object_alloc(sizeof(spl_fixedarray_object), parent); zend_object_std_init(&intern->std, class_type); object_properties_init(&intern->std, class_type); - intern->current = 0; - intern->flags = 0; - if (orig && clone_orig) { spl_fixedarray_object *other = spl_fixed_array_from_obj(orig); - spl_fixedarray_init(&intern->array, other->array.size); - spl_fixedarray_copy(&intern->array, &other->array); + spl_fixedarray_copy_ctor(&intern->array, &other->array); } while (parent) { @@ -231,36 +247,12 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z } parent = parent->parent; - inherited = 1; + inherited = true; } ZEND_ASSERT(parent); - funcs_ptr = class_type->iterator_funcs_ptr; - if (!funcs_ptr->zf_current) { - funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1); - funcs_ptr->zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1); - funcs_ptr->zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1); - funcs_ptr->zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1); - funcs_ptr->zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1); - } if (inherited) { - if (funcs_ptr->zf_rewind->common.scope != parent) { - intern->flags |= SPL_FIXEDARRAY_OVERLOADED_REWIND; - } - if (funcs_ptr->zf_valid->common.scope != parent) { - intern->flags |= SPL_FIXEDARRAY_OVERLOADED_VALID; - } - if (funcs_ptr->zf_key->common.scope != parent) { - intern->flags |= SPL_FIXEDARRAY_OVERLOADED_KEY; - } - if (funcs_ptr->zf_current->common.scope != parent) { - intern->flags |= SPL_FIXEDARRAY_OVERLOADED_CURRENT; - } - if (funcs_ptr->zf_next->common.scope != parent) { - intern->flags |= SPL_FIXEDARRAY_OVERLOADED_NEXT; - } - intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1); if (intern->fptr_offset_get->common.scope == parent) { intern->fptr_offset_get = NULL; @@ -285,15 +277,13 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z return &intern->std; } -/* }}} */ -static zend_object *spl_fixedarray_new(zend_class_entry *class_type) /* {{{ */ +static zend_object *spl_fixedarray_new(zend_class_entry *class_type) { return spl_fixedarray_object_new_ex(class_type, NULL, 0); } -/* }}} */ -static zend_object *spl_fixedarray_object_clone(zend_object *old_object) /* {{{ */ +static zend_object *spl_fixedarray_object_clone(zend_object *old_object) { zend_object *new_object = spl_fixedarray_object_new_ex(old_object->ce, old_object, 1); @@ -301,9 +291,8 @@ static zend_object *spl_fixedarray_object_clone(zend_object *old_object) /* {{{ return new_object; } -/* }}} */ -static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */ +static zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset) { zend_long index; @@ -327,11 +316,10 @@ static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_o return &intern->array.elements[index]; } } -/* }}} */ static int spl_fixedarray_object_has_dimension(zend_object *object, zval *offset, int check_empty); -static zval *spl_fixedarray_object_read_dimension(zend_object *object, zval *offset, int type, zval *rv) /* {{{ */ +static zval *spl_fixedarray_object_read_dimension(zend_object *object, zval *offset, int type, zval *rv) { spl_fixedarray_object *intern; @@ -359,9 +347,8 @@ static zval *spl_fixedarray_object_read_dimension(zend_object *object, zval *off return spl_fixedarray_object_read_dimension_helper(intern, offset); } -/* }}} */ -static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value) /* {{{ */ +static void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value) { zend_long index; @@ -385,9 +372,8 @@ static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_o ZVAL_COPY_DEREF(&intern->array.elements[index], value); } } -/* }}} */ -static void spl_fixedarray_object_write_dimension(zend_object *object, zval *offset, zval *value) /* {{{ */ +static void spl_fixedarray_object_write_dimension(zend_object *object, zval *offset, zval *value) { spl_fixedarray_object *intern; zval tmp; @@ -410,9 +396,8 @@ static void spl_fixedarray_object_write_dimension(zend_object *object, zval *off spl_fixedarray_object_write_dimension_helper(intern, offset, value); } -/* }}} */ -static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */ +static void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset) { zend_long index; @@ -430,9 +415,8 @@ static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_o ZVAL_NULL(&intern->array.elements[index]); } } -/* }}} */ -static void spl_fixedarray_object_unset_dimension(zend_object *object, zval *offset) /* {{{ */ +static void spl_fixedarray_object_unset_dimension(zend_object *object, zval *offset) { spl_fixedarray_object *intern; @@ -447,9 +431,8 @@ static void spl_fixedarray_object_unset_dimension(zend_object *object, zval *off spl_fixedarray_object_unset_dimension_helper(intern, offset); } -/* }}} */ -static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty) /* {{{ */ +static int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty) { zend_long index; int retval; @@ -472,9 +455,8 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje return retval; } -/* }}} */ -static int spl_fixedarray_object_has_dimension(zend_object *object, zval *offset, int check_empty) /* {{{ */ +static int spl_fixedarray_object_has_dimension(zend_object *object, zval *offset, int check_empty) { spl_fixedarray_object *intern; @@ -494,9 +476,8 @@ static int spl_fixedarray_object_has_dimension(zend_object *object, zval *offset return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty); } -/* }}} */ -static int spl_fixedarray_object_count_elements(zend_object *object, zend_long *count) /* {{{ */ +static int spl_fixedarray_object_count_elements(zend_object *object, zend_long *count) { spl_fixedarray_object *intern; @@ -515,9 +496,7 @@ static int spl_fixedarray_object_count_elements(zend_object *object, zend_long * } return SUCCESS; } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, __construct) { zval *object = ZEND_THIS; @@ -535,16 +514,14 @@ PHP_METHOD(SplFixedArray, __construct) intern = Z_SPLFIXEDARRAY_P(object); - if (intern->array.size > 0) { + if (!spl_fixedarray_empty(&intern->array)) { /* called __construct() twice, bail out */ return; } spl_fixedarray_init(&intern->array, size); } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, __wakeup) { spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); @@ -571,9 +548,7 @@ PHP_METHOD(SplFixedArray, __wakeup) zend_hash_clean(intern_ht); } } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, count) { zval *object = ZEND_THIS; @@ -586,9 +561,7 @@ PHP_METHOD(SplFixedArray, count) intern = Z_SPLFIXEDARRAY_P(object); RETURN_LONG(intern->array.size); } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, toArray) { spl_fixedarray_object *intern; @@ -599,11 +572,9 @@ PHP_METHOD(SplFixedArray, toArray) intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); - if (intern->array.size > 0) { - int i = 0; - + if (!spl_fixedarray_empty(&intern->array)) { array_init(return_value); - for (; i < intern->array.size; i++) { + for (zend_long i = 0; i < intern->array.size; i++) { zend_hash_index_update(Z_ARRVAL_P(return_value), i, &intern->array.elements[i]); Z_TRY_ADDREF(intern->array.elements[i]); } @@ -611,9 +582,7 @@ PHP_METHOD(SplFixedArray, toArray) RETURN_EMPTY_ARRAY(); } } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, fromArray) { zval *data; @@ -675,9 +644,7 @@ PHP_METHOD(SplFixedArray, fromArray) intern = Z_SPLFIXEDARRAY_P(return_value); intern->array = array; } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, getSize) { zval *object = ZEND_THIS; @@ -690,9 +657,7 @@ PHP_METHOD(SplFixedArray, getSize) intern = Z_SPLFIXEDARRAY_P(object); RETURN_LONG(intern->array.size); } -/* }}} */ -/* {{{ */ PHP_METHOD(SplFixedArray, setSize) { zval *object = ZEND_THIS; @@ -713,9 +678,8 @@ PHP_METHOD(SplFixedArray, setSize) spl_fixedarray_resize(&intern->array, size); RETURN_TRUE; } -/* }}} */ -/* {{{ Returns whether the requested $index exists. */ +/* Returns whether the requested $index exists. */ PHP_METHOD(SplFixedArray, offsetExists) { zval *zindex; @@ -728,9 +692,9 @@ PHP_METHOD(SplFixedArray, offsetExists) intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0)); -} /* }}} */ +} -/* {{{ Returns the value at the specified $index. */ +/* Returns the value at the specified $index. */ PHP_METHOD(SplFixedArray, offsetGet) { zval *zindex, *value; @@ -748,9 +712,9 @@ PHP_METHOD(SplFixedArray, offsetGet) } else { RETURN_NULL(); } -} /* }}} */ +} -/* {{{ Sets the value at the specified $index to $newval. */ +/* Sets the value at the specified $index to $newval. */ PHP_METHOD(SplFixedArray, offsetSet) { zval *zindex, *value; @@ -763,9 +727,9 @@ PHP_METHOD(SplFixedArray, offsetSet) intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); spl_fixedarray_object_write_dimension_helper(intern, zindex, value); -} /* }}} */ +} -/* {{{ Unsets the value at the specified $index. */ +/* Unsets the value at the specified $index. */ PHP_METHOD(SplFixedArray, offsetUnset) { zval *zindex; @@ -778,165 +742,64 @@ PHP_METHOD(SplFixedArray, offsetUnset) intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); spl_fixedarray_object_unset_dimension_helper(intern, zindex); -} /* }}} */ - -static void spl_fixedarray_it_dtor(zend_object_iterator *iter) /* {{{ */ -{ - spl_fixedarray_it *iterator = (spl_fixedarray_it *)iter; - - zend_user_it_invalidate_current(iter); - zval_ptr_dtor(&iterator->intern.it.data); } -/* }}} */ -static void spl_fixedarray_it_rewind(zend_object_iterator *iter) /* {{{ */ +/* Create a new iterator from a SplFixedArray instance. */ +PHP_METHOD(SplFixedArray, getIterator) { - spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); - - if (object->flags & SPL_FIXEDARRAY_OVERLOADED_REWIND) { - zend_user_it_rewind(iter); - } else { - object->current = 0; - } -} -/* }}} */ - -static int spl_fixedarray_it_valid(zend_object_iterator *iter) /* {{{ */ -{ - spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); - - if (object->flags & SPL_FIXEDARRAY_OVERLOADED_VALID) { - return zend_user_it_valid(iter); - } - - if (object->current >= 0 && object->current < object->array.size) { - return SUCCESS; + if (zend_parse_parameters_none() == FAILURE) { + return; } - return FAILURE; -} -/* }}} */ - -static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter) /* {{{ */ -{ - zval zindex; - spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); - - if (object->flags & SPL_FIXEDARRAY_OVERLOADED_CURRENT) { - return zend_user_it_get_current_data(iter); - } else { - zval *data; - - ZVAL_LONG(&zindex, object->current); - - data = spl_fixedarray_object_read_dimension_helper(object, &zindex); - - if (data == NULL) { - data = &EG(uninitialized_zval); - } - return data; - } + zend_create_internal_iterator_zval(return_value, ZEND_THIS); } -/* }}} */ -static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */ +static void spl_fixedarray_it_dtor(zend_object_iterator *iter) { - spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); - - if (object->flags & SPL_FIXEDARRAY_OVERLOADED_KEY) { - zend_user_it_get_current_key(iter, key); - } else { - ZVAL_LONG(key, object->current); - } + zval_ptr_dtor(&iter->data); } -/* }}} */ -static void spl_fixedarray_it_move_forward(zend_object_iterator *iter) /* {{{ */ +static void spl_fixedarray_it_rewind(zend_object_iterator *iter) { - spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); - - if (object->flags & SPL_FIXEDARRAY_OVERLOADED_NEXT) { - zend_user_it_move_forward(iter); - } else { - zend_user_it_invalidate_current(iter); - object->current++; - } + ((spl_fixedarray_it*)iter)->current = 0; } -/* }}} */ -/* {{{ Return current array key */ -PHP_METHOD(SplFixedArray, key) +static int spl_fixedarray_it_valid(zend_object_iterator *iter) { - spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); + spl_fixedarray_it *iterator = (spl_fixedarray_it*)iter; + spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); + if (iterator->current >= 0 && iterator->current < object->array.size) { + return SUCCESS; } - RETURN_LONG(intern->current); + return FAILURE; } -/* }}} */ -/* {{{ Move to next entry */ -PHP_METHOD(SplFixedArray, next) +static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter) { - spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); - - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } - - intern->current++; -} -/* }}} */ + zval zindex, *data; + spl_fixedarray_it *iterator = (spl_fixedarray_it*)iter; + spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data); -/* {{{ Check whether the datastructure contains more entries */ -PHP_METHOD(SplFixedArray, valid) -{ - spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); + ZVAL_LONG(&zindex, iterator->current); + data = spl_fixedarray_object_read_dimension_helper(object, &zindex); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); + if (data == NULL) { + data = &EG(uninitialized_zval); } - - RETURN_BOOL(intern->current >= 0 && intern->current < intern->array.size); + return data; } -/* }}} */ -/* {{{ Rewind the datastructure back to the start */ -PHP_METHOD(SplFixedArray, rewind) +static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key) { - spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); - - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } - - intern->current = 0; + ZVAL_LONG(key, ((spl_fixedarray_it*)iter)->current); } -/* }}} */ -/* {{{ Return current datastructure entry */ -PHP_METHOD(SplFixedArray, current) +static void spl_fixedarray_it_move_forward(zend_object_iterator *iter) { - zval zindex, *value; - spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS); - - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } - - ZVAL_LONG(&zindex, intern->current); - - value = spl_fixedarray_object_read_dimension_helper(intern, &zindex); - - if (value) { - ZVAL_COPY_DEREF(return_value, value); - } else { - RETURN_NULL(); - } + ((spl_fixedarray_it*)iter)->current++; } -/* }}} */ /* iterator handler table */ static const zend_object_iterator_funcs spl_fixedarray_it_funcs = { @@ -950,7 +813,7 @@ static const zend_object_iterator_funcs spl_fixedarray_it_funcs = { NULL, /* get_gc */ }; -zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ +zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) { spl_fixedarray_it *iterator; @@ -963,16 +826,12 @@ zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *ob zend_iterator_init((zend_object_iterator*)iterator); - ZVAL_OBJ_COPY(&iterator->intern.it.data, Z_OBJ_P(object)); - iterator->intern.it.funcs = &spl_fixedarray_it_funcs; - iterator->intern.ce = ce; - ZVAL_UNDEF(&iterator->intern.value); + ZVAL_OBJ_COPY(&iterator->intern.data, Z_OBJ_P(object)); + iterator->intern.funcs = &spl_fixedarray_it_funcs; - return &iterator->intern.it; + return &iterator->intern; } -/* }}} */ -/* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(spl_fixedarray) { REGISTER_SPL_STD_CLASS_EX(SplFixedArray, spl_fixedarray_new, class_SplFixedArray_methods); @@ -990,7 +849,7 @@ PHP_MINIT_FUNCTION(spl_fixedarray) spl_handler_SplFixedArray.dtor_obj = zend_objects_destroy_object; spl_handler_SplFixedArray.free_obj = spl_fixedarray_object_free_storage; - REGISTER_SPL_IMPLEMENTS(SplFixedArray, Iterator); + REGISTER_SPL_IMPLEMENTS(SplFixedArray, Aggregate); REGISTER_SPL_IMPLEMENTS(SplFixedArray, ArrayAccess); REGISTER_SPL_IMPLEMENTS(SplFixedArray, Countable); @@ -999,4 +858,3 @@ PHP_MINIT_FUNCTION(spl_fixedarray) return SUCCESS; } -/* }}} */ diff --git a/ext/spl/spl_fixedarray.stub.php b/ext/spl/spl_fixedarray.stub.php index 553de5c2faf35..b169dfdeac780 100755 --- a/ext/spl/spl_fixedarray.stub.php +++ b/ext/spl/spl_fixedarray.stub.php @@ -2,7 +2,7 @@ /** @generate-function-entries */ -class SplFixedArray implements Iterator, ArrayAccess, Countable +class SplFixedArray implements IteratorAggregate, ArrayAccess, Countable { public function __construct(int $size = 0) {} @@ -48,18 +48,5 @@ public function offsetSet($index, mixed $value) {} */ public function offsetUnset($index) {} - /** @return void */ - public function rewind() {} - - /** @return mixed */ - public function current() {} - - /** @return int */ - public function key() {} - - /** @return void */ - public function next() {} - - /** @return bool */ - public function valid() {} + public function getIterator(): Iterator {} } diff --git a/ext/spl/spl_fixedarray_arginfo.h b/ext/spl/spl_fixedarray_arginfo.h index 899202683e82c..e82ea83a6a76c 100644 --- a/ext/spl/spl_fixedarray_arginfo.h +++ b/ext/spl/spl_fixedarray_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4b6c37c54416ee46f610baba2a8b2be45d1db96f */ + * Stub hash: c820bad6bcfcc7c60a221464008a882515b5c05e */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplFixedArray___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 0, "0") @@ -36,15 +36,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_SplFixedArray_offsetUnset arginfo_class_SplFixedArray_offsetExists -#define arginfo_class_SplFixedArray_rewind arginfo_class_SplFixedArray___wakeup - -#define arginfo_class_SplFixedArray_current arginfo_class_SplFixedArray___wakeup - -#define arginfo_class_SplFixedArray_key arginfo_class_SplFixedArray___wakeup - -#define arginfo_class_SplFixedArray_next arginfo_class_SplFixedArray___wakeup - -#define arginfo_class_SplFixedArray_valid arginfo_class_SplFixedArray___wakeup +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_SplFixedArray_getIterator, 0, 0, Iterator, 0) +ZEND_END_ARG_INFO() ZEND_METHOD(SplFixedArray, __construct); @@ -58,11 +51,7 @@ ZEND_METHOD(SplFixedArray, offsetExists); ZEND_METHOD(SplFixedArray, offsetGet); ZEND_METHOD(SplFixedArray, offsetSet); ZEND_METHOD(SplFixedArray, offsetUnset); -ZEND_METHOD(SplFixedArray, rewind); -ZEND_METHOD(SplFixedArray, current); -ZEND_METHOD(SplFixedArray, key); -ZEND_METHOD(SplFixedArray, next); -ZEND_METHOD(SplFixedArray, valid); +ZEND_METHOD(SplFixedArray, getIterator); static const zend_function_entry class_SplFixedArray_methods[] = { @@ -77,10 +66,6 @@ static const zend_function_entry class_SplFixedArray_methods[] = { ZEND_ME(SplFixedArray, offsetGet, arginfo_class_SplFixedArray_offsetGet, ZEND_ACC_PUBLIC) ZEND_ME(SplFixedArray, offsetSet, arginfo_class_SplFixedArray_offsetSet, ZEND_ACC_PUBLIC) ZEND_ME(SplFixedArray, offsetUnset, arginfo_class_SplFixedArray_offsetUnset, ZEND_ACC_PUBLIC) - ZEND_ME(SplFixedArray, rewind, arginfo_class_SplFixedArray_rewind, ZEND_ACC_PUBLIC) - ZEND_ME(SplFixedArray, current, arginfo_class_SplFixedArray_current, ZEND_ACC_PUBLIC) - ZEND_ME(SplFixedArray, key, arginfo_class_SplFixedArray_key, ZEND_ACC_PUBLIC) - ZEND_ME(SplFixedArray, next, arginfo_class_SplFixedArray_next, ZEND_ACC_PUBLIC) - ZEND_ME(SplFixedArray, valid, arginfo_class_SplFixedArray_valid, ZEND_ACC_PUBLIC) + ZEND_ME(SplFixedArray, getIterator, arginfo_class_SplFixedArray_getIterator, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/ext/spl/spl_heap.stub.php b/ext/spl/spl_heap.stub.php index 49f67af85dc4b..8c01068eae54a 100644 --- a/ext/spl/spl_heap.stub.php +++ b/ext/spl/spl_heap.stub.php @@ -21,19 +21,19 @@ public function extract() {} /** * @return int - * @alias SplHeap::count + * @implementation-alias SplHeap::count */ public function count() {} /** * @return bool - * @alias SplHeap::isEmpty + * @implementation-alias SplHeap::isEmpty */ public function isEmpty() {} /** * @return void - * @alias SplHeap::rewind + * @implementation-alias SplHeap::rewind */ public function rewind() {} @@ -42,31 +42,31 @@ public function current() {} /** * @return int - * @alias SplHeap::key + * @implementation-alias SplHeap::key */ public function key() {} /** * @return void - * @alias SplHeap::next + * @implementation-alias SplHeap::next */ public function next() {} /** * @return bool - * @alias SplHeap::valid + * @implementation-alias SplHeap::valid */ public function valid() {} /** * @return bool - * @alias SplHeap::recoverFromCorruption + * @implementation-alias SplHeap::recoverFromCorruption */ public function recoverFromCorruption() {} /** * @return bool - * @alias SplHeap::isCorrupted + * @implementation-alias SplHeap::isCorrupted */ public function isCorrupted() {} diff --git a/ext/spl/spl_heap_arginfo.h b/ext/spl/spl_heap_arginfo.h index f68961ffbb260..aede7a3daf54c 100644 --- a/ext/spl/spl_heap_arginfo.h +++ b/ext/spl/spl_heap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: e57b1d7e9139aa2759f548cf800857cccf1d1f25 */ + * Stub hash: 510a58000a5473c4cbb33886f43b9f3050b3a36d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplPriorityQueue_compare, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, priority1, IS_MIXED, 0) diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 731f7f7b6e866..4735a257a89e7 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -684,13 +684,17 @@ PHP_METHOD(RecursiveIteratorIterator, getDepth) PHP_METHOD(RecursiveIteratorIterator, getSubIterator) { spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS); - zend_long level = object->level; + zend_long level; + zend_bool level_is_null = 1; zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &level) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &level, &level_is_null) == FAILURE) { RETURN_THROWS(); } - if (level < 0 || level > object->level) { + + if (level_is_null) { + level = object->level; + } else if (level < 0 || level > object->level) { RETURN_NULL(); } @@ -1318,14 +1322,14 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z } case DIT_IteratorIterator: { zend_class_entry *ce_cast; - zend_string *class_name; + zend_string *class_name = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|S", &zobject, ce_inner, &class_name) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|S!", &zobject, ce_inner, &class_name) == FAILURE) { return NULL; } ce = Z_OBJCE_P(zobject); if (!instanceof_function(ce, zend_ce_iterator)) { - if (ZEND_NUM_ARGS() > 1) { + if (class_name) { if (!(ce_cast = zend_lookup_class(class_name)) || !instanceof_function(ce, ce_cast) || !ce_cast->get_iterator diff --git a/ext/spl/spl_iterators.stub.php b/ext/spl/spl_iterators.stub.php index cda92886687ce..4d99e60df451b 100644 --- a/ext/spl/spl_iterators.stub.php +++ b/ext/spl/spl_iterators.stub.php @@ -34,7 +34,7 @@ public function __construct(RecursiveIterator $iterator, callable $callback) {} /** * @return bool - * @alias RecursiveFilterIterator::hasChildren + * @implementation-alias RecursiveFilterIterator::hasChildren */ public function hasChildren() {} @@ -74,7 +74,7 @@ public function next() {} public function getDepth() {} /** @return RecursiveIterator|null */ - public function getSubIterator(int $level = UNKNOWN) {} + public function getSubIterator(?int $level = null) {} /** @return RecursiveIterator */ public function getInnerIterator() {} @@ -115,8 +115,7 @@ public function getInnerIterator(); class IteratorIterator implements OuterIterator { - /** @param Traversable $iterator */ - public function __construct($iterator, string $class_name = UNKNOWN) {} + public function __construct(Traversable $iterator, ?string $class_name = null) {} /** @return Iterator|null */ public function getInnerIterator() {} @@ -168,7 +167,7 @@ public function __construct(RecursiveIterator $iterator) {} /** * @return bool - * @alias RecursiveFilterIterator::hasChildren + * @implementation-alias RecursiveFilterIterator::hasChildren */ public function accept() {} } @@ -357,7 +356,7 @@ public function accept() {} /** * @return bool - * @alias RecursiveFilterIterator::hasChildren + * @implementation-alias RecursiveFilterIterator::hasChildren */ public function hasChildren() {} diff --git a/ext/spl/spl_iterators_arginfo.h b/ext/spl/spl_iterators_arginfo.h index 58f414a16c307..7563521b46c84 100644 --- a/ext/spl/spl_iterators_arginfo.h +++ b/ext/spl/spl_iterators_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3d98c82203230f2636c7fedb5717da5f7ab973f2 */ + * Stub hash: 65bcea1c2313ff50b3e15588e1cdba036995c131 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_EmptyIterator_current, 0, 0, 0) ZEND_END_ARG_INFO() @@ -51,7 +51,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_RecursiveIteratorIterator_getDepth arginfo_class_EmptyIterator_current ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RecursiveIteratorIterator_getSubIterator, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, level, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #define arginfo_class_RecursiveIteratorIterator_getInnerIterator arginfo_class_EmptyIterator_current @@ -79,8 +79,8 @@ ZEND_END_ARG_INFO() #define arginfo_class_OuterIterator_getInnerIterator arginfo_class_EmptyIterator_current ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IteratorIterator___construct, 0, 0, 1) - ZEND_ARG_INFO(0, iterator) - ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 1, "null") ZEND_END_ARG_INFO() #define arginfo_class_IteratorIterator_getInnerIterator arginfo_class_EmptyIterator_current diff --git a/ext/spl/spl_observer.stub.php b/ext/spl/spl_observer.stub.php index 475f3b8dc7210..ba880a30903a2 100644 --- a/ext/spl/spl_observer.stub.php +++ b/ext/spl/spl_observer.stub.php @@ -73,7 +73,7 @@ public function serialize() {} /** * @param object $object * @return bool - * @alias SplObjectStorage::contains + * @implementation-alias SplObjectStorage::contains */ public function offsetExists($object) {} @@ -86,14 +86,14 @@ public function offsetGet($object) {} /** * @param object $object * @return void - * @alias SplObjectStorage::attach + * @implementation-alias SplObjectStorage::attach */ public function offsetSet($object, mixed $info = null) {} /** * @param object $object * @return void - * @alias SplObjectStorage::detach + * @implementation-alias SplObjectStorage::detach */ public function offsetUnset($object) {} @@ -149,7 +149,7 @@ public function next() {} /** * @return array - * @alias SplObjectStorage::__debugInfo + * @implementation-alias SplObjectStorage::__debugInfo */ public function __debugInfo() {} } diff --git a/ext/spl/spl_observer_arginfo.h b/ext/spl/spl_observer_arginfo.h index eed972b2830e4..5956aedd0a628 100644 --- a/ext/spl/spl_observer_arginfo.h +++ b/ext/spl/spl_observer_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: aab6134fb2223ffe4d686f3a601e66da17c99511 */ + * Stub hash: c526488c83b1de019f4257e2ddaaa8fb8f1bb323 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SplObserver_update, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, subject, SplSubject, 0) diff --git a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt index 2db10f989a09f..03010f3935c90 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_delimiter_error.phpt @@ -12,12 +12,15 @@ fputcsv($fp, array( fclose($fp); $fo = new SplFileObject('SplFileObject__fgetcsv3.csv'); -var_dump($fo->fgetcsv('invalid')); +try { + var_dump($fo->fgetcsv('invalid')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- ---EXPECTF-- -Warning: SplFileObject::fgetcsv(): delimiter must be a character in %s on line %d -bool(false) +--EXPECT-- +SplFileObject::fgetcsv(): Argument #1 ($delimiter) must be a single character diff --git a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt index 6dd0a593c5b38..b510ae909c3c4 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_enclosure_error.phpt @@ -12,12 +12,15 @@ fputcsv($fp, array( fclose($fp); $fo = new SplFileObject('SplFileObject__fgetcsv5.csv'); -var_dump($fo->fgetcsv(',', 'invalid')); +try { + var_dump($fo->fgetcsv(',', 'invalid')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- ---EXPECTF-- -Warning: SplFileObject::fgetcsv(): enclosure must be a character in %s on line %d -bool(false) +--EXPECT-- +SplFileObject::fgetcsv(): Argument #2 ($enclosure) must be a single character diff --git a/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt b/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt index 4873341e5a2b9..a1471c8e0e7d7 100644 --- a/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt +++ b/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt @@ -7,12 +7,15 @@ fwrite($fp, '"aaa","b""bb","ccc"'); fclose($fp); $fo = new SplFileObject('SplFileObject__fgetcsv8.csv'); -var_dump($fo->fgetcsv(',', '"', 'invalid')); +try { + var_dump($fo->fgetcsv(',', '"', 'invalid')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- ---EXPECTF-- -Warning: SplFileObject::fgetcsv(): escape must be empty or a single character in %s on line %d -bool(false) +--EXPECT-- +SplFileObject::fgetcsv(): Argument #3 ($escape) must be empty or a single character diff --git a/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt b/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt index a4c24510216b8..0dc2a4fe7e680 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_variation13.phpt @@ -10,7 +10,11 @@ echo "*** Testing fputcsv() : with default enclosure & delimiter of two chars ** $fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv_variation13.csv', 'w'); -var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '"')); +try { + var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '"')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} unset($fo); @@ -21,9 +25,7 @@ echo "Done\n"; $file = __DIR__ . '/SplFileObject_fputcsv_variation13.csv'; unlink($file); ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with default enclosure & delimiter of two chars *** - -Warning: SplFileObject::fputcsv(): delimiter must be a character in %s on line %d -bool(false) +SplFileObject::fputcsv(): Argument #2 ($delimiter) must be a single character Done diff --git a/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt b/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt index a659da92af46e..60efae632dae2 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_variation14.phpt @@ -10,7 +10,11 @@ echo "*** Testing fputcsv() : with enclosure & delimiter of two chars and file o $fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv_variation14.csv', 'w'); -var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '""')); +try { + var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '""')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} unset($fo); @@ -21,9 +25,7 @@ echo "Done\n"; $file = __DIR__ . '/SplFileObject_fputcsv_variation14.csv'; unlink($file); ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode *** - -Warning: SplFileObject::fputcsv(): enclosure must be a character in %s on line %d -bool(false) +SplFileObject::fputcsv(): Argument #3 ($enclosure) must be a single character Done diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt index 296c4a1aa0c44..75249dbce4e59 100644 --- a/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt +++ b/ext/spl/tests/SplFileObject_setCsvControl_error001.phpt @@ -13,11 +13,15 @@ CDATA ); $s = new SplFileObject('csv_control_data_error001.csv'); $s->setFlags(SplFileObject::READ_CSV); -$s->setCsvControl('||'); +try { + $s->setCsvControl('||'); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- ---EXPECTF-- -Warning: SplFileObject::setCsvControl(): delimiter must be a character in %s on line %d +--EXPECT-- +SplFileObject::setCsvControl(): Argument #1 ($delimiter) must be a single character diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt index 885d600225256..3e4c206fe0ab7 100644 --- a/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt +++ b/ext/spl/tests/SplFileObject_setCsvControl_error002.phpt @@ -13,11 +13,15 @@ CDATA ); $s = new SplFileObject('csv_control_data_error002.csv'); $s->setFlags(SplFileObject::READ_CSV); -$s->setCsvControl('|', 'two'); +try { + $s->setCsvControl('|', 'two'); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- ---EXPECTF-- -Warning: SplFileObject::setCsvControl(): enclosure must be a character in %s on line %d +--EXPECT-- +SplFileObject::setCsvControl(): Argument #2 ($enclosure) must be a single character diff --git a/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt b/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt index 9e885cbbe3dce..35934f5e5cb0a 100644 --- a/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt +++ b/ext/spl/tests/SplFileObject_setCsvControl_error003.phpt @@ -15,11 +15,15 @@ CDATA ); $s = new SplFileObject('csv_control_data_error003.csv'); $s->setFlags(SplFileObject::READ_CSV); -$s->setCsvControl('|', '\'', 'three'); +try { + $s->setCsvControl('|', '\'', 'three'); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --CLEAN-- ---EXPECTF-- -Warning: SplFileObject::setCsvControl(): escape must be empty or a single character in %s on line %d +--EXPECT-- +SplFileObject::setCsvControl(): Argument #3 ($escape) must be empty or a single character diff --git a/ext/spl/tests/SplFixedArray_change_size_during_iteration.phpt b/ext/spl/tests/SplFixedArray_change_size_during_iteration.phpt new file mode 100644 index 0000000000000..56565ff7aac83 --- /dev/null +++ b/ext/spl/tests/SplFixedArray_change_size_during_iteration.phpt @@ -0,0 +1,43 @@ +--TEST-- +SPL: FixedArray: change array size during iteration +--FILE-- + $v) { + echo "$k => $v\n"; + if ($k == 0) { + $splFixedArray->setSize(2); + } +} +echo "---\n"; + +$splFixedArray = SplFixedArray::fromArray(["a","b","c"]); +foreach ($splFixedArray as $k => $v) { + echo "$k => $v\n"; + if ($k == 1) { + $splFixedArray->setSize(2); + } +} +echo "---\n"; + +$splFixedArray = SplFixedArray::fromArray(["a","b","c"]); +foreach ($splFixedArray as $k => $v) { + echo "$k => $v\n"; + if ($k == 2) { + $splFixedArray->setSize(2); + } +} +echo "\n"; +--EXPECT-- +0 => a +1 => b +--- +0 => a +1 => b +--- +0 => a +1 => b +2 => c diff --git a/ext/spl/tests/SplFixedArray_key_setsize.phpt b/ext/spl/tests/SplFixedArray_key_setsize.phpt deleted file mode 100644 index 5c035e71c7774..0000000000000 --- a/ext/spl/tests/SplFixedArray_key_setsize.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -SplFixedArray::key() when the array has a size higher than the amount of values specified. ---CREDITS-- -PHPNW Test Fest 2009 - Jordan Hatch ---FILE-- -key( ); -} - -?> ---EXPECT-- -0123 diff --git a/ext/spl/tests/SplFixedArray_nested_foreach.phpt b/ext/spl/tests/SplFixedArray_nested_foreach.phpt new file mode 100644 index 0000000000000..0042ab7890523 --- /dev/null +++ b/ext/spl/tests/SplFixedArray_nested_foreach.phpt @@ -0,0 +1,19 @@ +--TEST-- +Nested iteration of SplFixedArray using foreach loops +--FILE-- + +--EXPECT-- +0 0 +0 1 +1 0 +1 1 diff --git a/ext/spl/tests/SplFixedArray_override_getIterator.phpt b/ext/spl/tests/SplFixedArray_override_getIterator.phpt new file mode 100644 index 0000000000000..52bf52f2a1b51 --- /dev/null +++ b/ext/spl/tests/SplFixedArray_override_getIterator.phpt @@ -0,0 +1,46 @@ +--TEST-- +SPL: FixedArray: overriding getIterator() +--FILE-- +valid()) { + echo "In A: key={$iterator->key()} value={$iterator->current()}\n"; + yield $iterator->key() => $iterator->current(); + $iterator->next(); + } + } +} + +echo "==SplFixedArray instance==\n"; +$a = new SplFixedArray(3); +$a[0] = "a"; +$a[1] = "b"; +$a[2] = "c"; +foreach ($a as $k => $v) { + echo "$k => $v\n"; +} + +echo "==Subclass instance==\n"; +$a = new A(3); +$a[0] = "d"; +$a[1] = "e"; +$a[2] = "f"; +foreach ($a as $k => $v) { + echo "$k => $v\n"; +} +--EXPECT-- +==SplFixedArray instance== +0 => a +1 => b +2 => c +==Subclass instance== +In A: key=0 value=d +0 => d +In A: key=1 value=e +1 => e +In A: key=2 value=f +2 => f diff --git a/ext/spl/tests/countable_count_variation1.phpt b/ext/spl/tests/countable_count_variation1.phpt index 8ce29410d9ab9..0e17eccbe68ab 100644 --- a/ext/spl/tests/countable_count_variation1.phpt +++ b/ext/spl/tests/countable_count_variation1.phpt @@ -60,7 +60,7 @@ Count returns a string: int(0) Count returns an object: -Notice: Object of class returnObject could not be converted to int in %s on line 40 +Warning: Object of class returnObject could not be converted to int in %s on line %d int(1) Count returns an array: int(1) diff --git a/ext/spl/tests/fixedarray_003.phpt b/ext/spl/tests/fixedarray_003.phpt deleted file mode 100644 index d2f8a78fdf080..0000000000000 --- a/ext/spl/tests/fixedarray_003.phpt +++ /dev/null @@ -1,86 +0,0 @@ ---TEST-- -SPL: FixedArray: Iterators ---FILE-- - $v) { - echo "$k => $v\n"; -} -echo "==Child instance==\n"; -$a = new A(5); -$a[0] = "a"; -$a[1] = "c"; -$a[2] = "d"; -$a[3] = "e"; -$a[4] = "f"; -foreach ($a as $k => $v) { - echo "$k => $v\n"; -} -?> ---EXPECT-- -==Direct instance== -0 => a -1 => c -2 => d -3 => e -4 => f -==Child instance== -A::rewind -A::valid -A::current -A::key -0 => a -A::next -A::valid -A::current -A::key -1 => c -A::next -A::valid -A::current -A::key -2 => d -A::next -A::valid -A::current -A::key -3 => e -A::next -A::valid -A::current -A::key -4 => f -A::next -A::valid diff --git a/ext/spl/tests/fixedarray_019.phpt b/ext/spl/tests/fixedarray_019.phpt deleted file mode 100644 index 9414e97304505..0000000000000 --- a/ext/spl/tests/fixedarray_019.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -SPL: FixedArray: overridden iterator methods ---FILE-- -$v) { - echo "$k=>"; - var_dump($v); -} -?> ---EXPECT-- -rewind -valid -current -key -0=>NULL -next -valid -current -key -1=>NULL -next -valid -current -key -2=>NULL -next -valid diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 464df5ae21aa5..cd91e68fd3e9a 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1243,12 +1243,7 @@ PHP_METHOD(SQLite3, openBlob) db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl|sl", &table, &table_len, &column, &column_len, &rowid, &dbname, &dbname_len, &flags) == FAILURE) { - RETURN_THROWS(); - } - - if (ZEND_NUM_ARGS() >= 4 && CHECK_NULL_PATH(dbname, dbname_len)) { - zend_argument_type_error(4, "must not contain null bytes"); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl|pl", &table, &table_len, &column, &column_len, &rowid, &dbname, &dbname_len, &flags) == FAILURE) { RETURN_THROWS(); } @@ -1346,17 +1341,7 @@ PHP_METHOD(SQLite3, backup) sqlite3_backup *dbBackup; int rc; // Return code - if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ss", &destination_zval, php_sqlite3_sc_entry, &source_dbname, &source_dbname_length, &destination_dbname, &destination_dbname_length) == FAILURE) { - RETURN_THROWS(); - } - - if (ZEND_NUM_ARGS() >= 2 && CHECK_NULL_PATH(source_dbname, source_dbname_length)) { - zend_argument_type_error(2, "must not contain null bytes"); - RETURN_THROWS(); - } - - if (ZEND_NUM_ARGS() >= 3 && CHECK_NULL_PATH(destination_dbname, destination_dbname_length)) { - zend_argument_type_error(3, "must not contain null bytes"); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|pp", &destination_zval, php_sqlite3_sc_entry, &source_dbname, &source_dbname_length, &destination_dbname, &destination_dbname_length) == FAILURE) { RETURN_THROWS(); } diff --git a/ext/sqlite3/sqlite3.stub.php b/ext/sqlite3/sqlite3.stub.php index 132bd44cbb8e7..e07286fd2d650 100644 --- a/ext/sqlite3/sqlite3.stub.php +++ b/ext/sqlite3/sqlite3.stub.php @@ -4,7 +4,7 @@ class SQLite3 { - /** @alias SQLite3::open */ + /** @implementation-alias SQLite3::open */ public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryption_key = "") {} /** @return void */ diff --git a/ext/sqlite3/sqlite3_arginfo.h b/ext/sqlite3/sqlite3_arginfo.h index ea462fb57ecf8..3f151f9ad1ecd 100644 --- a/ext/sqlite3/sqlite3_arginfo.h +++ b/ext/sqlite3/sqlite3_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 749f2c1a6b0bf3b889a294ad621995ba74e8ab39 */ + * Stub hash: 293f1041949989de457a4091b751674bf301c2bd */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) diff --git a/ext/standard/array.c b/ext/standard/array.c index bd2823a4076ca..f99af846114dd 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -740,11 +740,6 @@ PHP_FUNCTION(count) } switch (Z_TYPE_P(array)) { - case IS_NULL: - /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); - RETURN_LONG(0); - break; case IS_ARRAY: if (mode != COUNT_RECURSIVE) { cnt = zend_array_count(Z_ARRVAL_P(array)); @@ -774,18 +769,11 @@ PHP_FUNCTION(count) } return; } - - /* If There's no handler and it doesn't implement Countable then add a warning */ - /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); - RETURN_LONG(1); - break; } + /* fallthrough */ default: - /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); - RETURN_LONG(1); - break; + zend_argument_type_error(1, "must be of type Countable|array, %s given", zend_zval_type_name(array)); + RETURN_THROWS(); } } /* }}} */ diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index d0c8805fe461a..8a7d9ca895bfb 100755 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1658,6 +1658,7 @@ void user_shutdown_function_dtor(zval *zv) /* {{{ */ int i; php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv); + zval_ptr_dtor(&shutdown_function_entry->function_name); for (i = 0; i < shutdown_function_entry->arg_count; i++) { zval_ptr_dtor(&shutdown_function_entry->arguments[i]); } @@ -1682,18 +1683,18 @@ static int user_shutdown_function_call(zval *zv) /* {{{ */ php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv); zval retval; - if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, NULL)) { - zend_string *function_name = zend_get_callable_name(&shutdown_function_entry->arguments[0]); + if (!zend_is_callable(&shutdown_function_entry->function_name, 0, NULL)) { + zend_string *function_name = zend_get_callable_name(&shutdown_function_entry->function_name); zend_throw_error(NULL, "Registered shutdown function %s() cannot be called, function does not exist", ZSTR_VAL(function_name)); zend_string_release(function_name); return 0; } if (call_user_function(NULL, NULL, - &shutdown_function_entry->arguments[0], + &shutdown_function_entry->function_name, &retval, - shutdown_function_entry->arg_count - 1, - shutdown_function_entry->arguments + 1) == SUCCESS) + shutdown_function_entry->arg_count, + shutdown_function_entry->arguments) == SUCCESS) { zval_ptr_dtor(&retval); } @@ -1787,40 +1788,24 @@ PHPAPI void php_free_shutdown_functions(void) /* {{{ */ /* {{{ Register a user-level function to be called on request termination */ PHP_FUNCTION(register_shutdown_function) { - php_shutdown_function_entry shutdown_function_entry; - int i; - - shutdown_function_entry.arg_count = ZEND_NUM_ARGS(); - - if (shutdown_function_entry.arg_count < 1) { - WRONG_PARAM_COUNT; - } - - shutdown_function_entry.arguments = (zval *) safe_emalloc(sizeof(zval), shutdown_function_entry.arg_count, 0); - - if (zend_get_parameters_array(ZEND_NUM_ARGS(), shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) { - efree(shutdown_function_entry.arguments); - RETURN_FALSE; - } + php_shutdown_function_entry entry; + zend_fcall_info fci; + zend_fcall_info_cache fcc; + zval *args; + int arg_count = 0; - /* Prevent entering of anything but valid callback (syntax check only!) */ - if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, NULL)) { - zend_string *callback_name = zend_get_callable_name(&shutdown_function_entry.arguments[0]); - zend_argument_type_error(1, "must be a valid callback, function \"%s\" not found or invalid function name", ZSTR_VAL(callback_name)); - efree(shutdown_function_entry.arguments); - zend_string_release(callback_name); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fcc, &args, &arg_count) == FAILURE) { RETURN_THROWS(); } - if (!BG(user_shutdown_function_names)) { - ALLOC_HASHTABLE(BG(user_shutdown_function_names)); - zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0); + ZVAL_COPY(&entry.function_name, &fci.function_name); + entry.arguments = (zval *) safe_emalloc(sizeof(zval), arg_count, 0); + entry.arg_count = arg_count; + for (int i = 0; i < arg_count; i++) { + ZVAL_COPY(&entry.arguments[i], &args[i]); } - for (i = 0; i < shutdown_function_entry.arg_count; i++) { - Z_TRY_ADDREF(shutdown_function_entry.arguments[i]); - } - zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry)); + append_user_shutdown_function(&entry); } /* }}} */ @@ -1846,14 +1831,14 @@ PHPAPI zend_bool remove_user_shutdown_function(const char *function_name, size_t } /* }}} */ -PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry) /* {{{ */ +PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry) /* {{{ */ { if (!BG(user_shutdown_function_names)) { ALLOC_HASHTABLE(BG(user_shutdown_function_names)); zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0); } - return zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry)) != NULL; + return zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), shutdown_function_entry, sizeof(php_shutdown_function_entry)) != NULL; } /* }}} */ diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 6c0eb5c59edc0..97faf50fd92e9 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -143,13 +143,14 @@ PHPAPI double php_get_nan(void); PHPAPI double php_get_inf(void); typedef struct _php_shutdown_function_entry { + zval function_name; zval *arguments; int arg_count; } php_shutdown_function_entry; PHPAPI extern zend_bool register_user_shutdown_function(const char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry); PHPAPI extern zend_bool remove_user_shutdown_function(const char *function_name, size_t function_len); -PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry); +PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry *shutdown_function_entry); PHPAPI void php_call_shutdown_functions(void); PHPAPI void php_free_shutdown_functions(void); diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index aae651df0240a..5b8103f036fec 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -12,8 +12,8 @@ function header_register_callback(callable $callback): bool {} /* main/output.c */ -/** @param callable $user_function */ -function ob_start($user_function = null, int $chunk_size = 0, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): bool {} +/** @param callable $callback */ +function ob_start($callback = null, int $chunk_size = 0, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): bool {} function ob_flush(): bool {} @@ -37,7 +37,7 @@ function ob_list_handlers(): array {} function ob_get_status(bool $full_status = false): array {} -function ob_implicit_flush(bool $flag = true): void {} +function ob_implicit_flush(bool $enable = true): void {} function output_reset_rewrite_vars(): bool {} @@ -45,10 +45,10 @@ function output_add_rewrite_var(string $name, string $value): bool {} /* main/streams/userspace.c */ -function stream_wrapper_register(string $protocol, string $classname, int $flags = 0): bool {} +function stream_wrapper_register(string $protocol, string $class, int $flags = 0): bool {} /** @alias stream_wrapper_register */ -function stream_register_wrapper(string $protocol, string $classname, int $flags = 0): bool {} +function stream_register_wrapper(string $protocol, string $class, int $flags = 0): bool {} function stream_wrapper_unregister(string $protocol): bool {} @@ -56,20 +56,16 @@ function stream_wrapper_restore(string $protocol): bool {} /* array.c */ -function array_push(array &$stack, mixed ...$values): int {} +function array_push(array &$array, mixed ...$values): int {} function krsort(array &$array, int $flags = SORT_REGULAR): bool {} function ksort(array &$array, int $flags = SORT_REGULAR): bool {} -/** @param Countable|array $var */ -function count($var, int $mode = COUNT_NORMAL): int {} +function count(Countable|array $value, int $mode = COUNT_NORMAL): int {} -/** - * @param Countable|array $var - * @alias count - */ -function sizeof($var, int $mode = COUNT_NORMAL): int {} +/** @alias count */ +function sizeof(Countable|array $value, int $mode = COUNT_NORMAL): int {} function natsort(array &$array): bool {} @@ -89,35 +85,35 @@ function uasort(array &$array, callable $callback): bool {} function uksort(array &$array, callable $callback): bool {} -function end(array|object &$arg): mixed {} +function end(array|object &$array): mixed {} -function prev(array|object &$arg): mixed {} +function prev(array|object &$array): mixed {} -function next(array|object &$arg): mixed {} +function next(array|object &$array): mixed {} -function reset(array|object &$arg): mixed {} +function reset(array|object &$array): mixed {} -function current(array|object $arg): mixed {} +function current(array|object $array): mixed {} /** @alias current */ -function pos(array|object $arg): mixed {} +function pos(array|object $array): mixed {} -function key(array|object $arg): int|string|null {} +function key(array|object $array): int|string|null {} -function min(mixed $arg, mixed ...$args): mixed {} +function min(mixed $value, mixed ...$values): mixed {} -function max(mixed $arg, mixed ...$args): mixed {} +function max(mixed $value, mixed ...$values): mixed {} -function array_walk(array|object &$input, callable $callback, mixed $argument = UNKNOWN): bool {} +function array_walk(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {} -function array_walk_recursive(array|object &$input, callable $callback, mixed $argument = UNKNOWN): bool {} +function array_walk_recursive(array|object &$array, callable $callback, mixed $arg = UNKNOWN): bool {} function in_array(mixed $needle, array $haystack, bool $strict = false): bool {} function array_search(mixed $needle, array $haystack, bool $strict = false): int|string|false {} /** @prefer-ref $array */ -function extract(array &$array, int $extract_type = EXTR_OVERWRITE, string $prefix = ""): int {} +function extract(array &$array, int $flags = EXTR_OVERWRITE, string $prefix = ""): int {} /** * @param array|string $var_name @@ -125,25 +121,25 @@ function extract(array &$array, int $extract_type = EXTR_OVERWRITE, string $pref */ function compact($var_name, ...$var_names): array {} -function array_fill(int $start_key, int $count, mixed $value): array {} +function array_fill(int $start_index, int $count, mixed $value): array {} function array_fill_keys(array $keys, mixed $value): array {} /** - * @param string|int|float $low - * @param string|int|float $high + * @param string|int|float $start + * @param string|int|float $end */ -function range($low, $high, int|float $step = 1): array {} +function range($start, $end, int|float $step = 1): array {} function shuffle(array &$array): bool {} -function array_pop(array &$stack): mixed {} +function array_pop(array &$array): mixed {} -function array_shift(array &$stack): mixed {} +function array_shift(array &$array): mixed {} -function array_unshift(array &$stack, mixed ...$values): int {} +function array_unshift(array &$array, mixed ...$values): int {} -function array_splice(array &$array, int $offset, ?int $length = null, mixed $replacements = []): array {} +function array_splice(array &$array, int $offset, ?int $length = null, mixed $replacement = []): array {} function array_slice(array $array, int $offset, ?int $length = null, bool $preserve_keys = false): array {} @@ -169,7 +165,7 @@ function array_column(array $array, int|string|null $column_key, int|string|null function array_reverse(array $array, bool $preserve_keys = false): array {} -function array_pad(array $array, int $pad_size, mixed $pad_value): array {} +function array_pad(array $array, int $length, mixed $value): array {} function array_flip(array $array): array {} @@ -220,14 +216,14 @@ function array_udiff_assoc(array $array, ...$rest): array {} function array_udiff_uassoc(array $array, ...$rest): array {} /** - * @param array $array1 + * @param array $array * @param array|int $rest - * @prefer-ref $array1 + * @prefer-ref $array * @prefer-ref $rest */ -function array_multisort(&$array1, &...$rest): bool {} +function array_multisort(&$array, &...$rest): bool {} -function array_rand(array $array, int $num_req = 1): int|string|array {} +function array_rand(array $array, int $num = 1): int|string|array {} function array_sum(array $array): int|float {} @@ -235,7 +231,7 @@ function array_product(array $array): int|float {} function array_reduce(array $array, callable $callback, mixed $initial = null): mixed {} -function array_filter(array $array, ?callable $callback = null, int $use_keys = 0): array {} +function array_filter(array $array, ?callable $callback = null, int $mode = 0): array {} function array_map(?callable $callback, array $array, array ...$arrays): array {} @@ -248,32 +244,32 @@ function array_key_exists($key, array $array): bool {} */ function key_exists($key, array $array): bool {} -function array_chunk(array $array, int $size, bool $preserve_keys = false): array {} +function array_chunk(array $array, int $length, bool $preserve_keys = false): array {} function array_combine(array $keys, array $values): array {} /* base64.c */ -function base64_encode(string $str): string {} +function base64_encode(string $string): string {} -function base64_decode(string $str, bool $strict = false): string|false {} +function base64_decode(string $string, bool $strict = false): string|false {} /* basic_functions.c */ function constant(string $name): mixed {} -function ip2long(string $ip_address): int|false {} +function ip2long(string $ip): int|false {} -function long2ip(int $proper_address): string|false {} +function long2ip(int $ip): string|false {} -function getenv(?string $variable = null, bool $local_only = false): string|array|false {} +function getenv(?string $name = null, bool $local_only = false): string|array|false {} #ifdef HAVE_PUTENV -function putenv(string $setting): bool {} +function putenv(string $assignment): bool {} #endif -/** @param int $optind */ -function getopt(string $options, array $longopts = [], &$optind = null): array|false {} +/** @param int $rest_index */ +function getopt(string $short_options, array $long_options = [], &$rest_index = null): array|false {} function flush(): void {} @@ -289,24 +285,23 @@ function time_sleep_until(float $timestamp): bool {} function get_current_user(): string {} -function get_cfg_var(string $option_name): string|array|false {} +function get_cfg_var(string $name): string|array|false {} -function error_log(string $message, int $message_type = 0, ?string $destination = null, ?string $extra_headers = null): bool {} +function error_log(string $message, int $message_type = 0, ?string $destination = null, ?string $additional_headers = null): bool {} function error_get_last(): ?array {} function error_clear_last(): void {} -function call_user_func(callable $function, mixed ...$args): mixed {} +function call_user_func(callable $callback, mixed ...$args): mixed {} -function call_user_func_array(callable $function, array $args): mixed {} +function call_user_func_array(callable $callback, array $args): mixed {} -function forward_static_call(callable $function, mixed ...$args): mixed {} +function forward_static_call(callable $callback, mixed ...$args): mixed {} -function forward_static_call_array(callable $function, array $args): mixed {} +function forward_static_call_array(callable $callback, array $args): mixed {} -/** @param callable $function */ -function register_shutdown_function($function, mixed ...$args): ?bool {} +function register_shutdown_function(callable $callback, mixed ...$args): ?bool {} function highlight_file(string $filename, bool $return = false): string|bool {} @@ -317,28 +312,28 @@ function php_strip_whitespace(string $filename): string {} function highlight_string(string $string, bool $return = false): string|bool {} -function ini_get(string $varname): string|false {} +function ini_get(string $name): string|false {} function ini_get_all(?string $extension = null, bool $details = true): array|false {} -function ini_set(string $varname, string $value): string|false {} +function ini_set(string $name, string $value): string|false {} /** @alias ini_set */ -function ini_alter(string $varname, string $value): string|false {} +function ini_alter(string $name, string $value): string|false {} -function ini_restore(string $varname): void {} +function ini_restore(string $name): void {} function set_include_path(string $include_path): string|false {} function get_include_path(): string|false {} -function print_r(mixed $var, bool $return = false): string|bool {} +function print_r(mixed $value, bool $return = false): string|bool {} function connection_aborted(): int {} function connection_status(): int {} -function ignore_user_abort(?bool $value = null): int {} +function ignore_user_abort(?bool $enable = null): int {} #if HAVE_GETSERVBYNAME function getservbyname(string $service, string $protocol): int|false {} @@ -349,20 +344,20 @@ function getservbyport(int $port, string $protocol): string|false {} #endif #if HAVE_GETPROTOBYNAME -function getprotobyname(string $name): int|false {} +function getprotobyname(string $protocol): int|false {} #endif #if HAVE_GETPROTOBYNUMBER function getprotobynumber(int $protocol): string|false {} #endif -function register_tick_function(callable $function, mixed ...$args): bool {} +function register_tick_function(callable $callback, mixed ...$args): bool {} -function unregister_tick_function(callable $function): void {} +function unregister_tick_function(callable $callback): void {} -function is_uploaded_file(string $path): bool {} +function is_uploaded_file(string $filename): bool {} -function move_uploaded_file(string $path, string $new_path): bool {} +function move_uploaded_file(string $from, string $to): bool {} function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array|false {} @@ -378,15 +373,15 @@ function sys_getloadavg(): array|false {} /* browscap.c */ -function get_browser(?string $browser_name = null, bool $return_array = false): object|array|false {} +function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {} /* crc32.c */ -function crc32(string $str): int {} +function crc32(string $string): int {} /* crypt.c */ -function crypt(string $str, string $salt): string {} +function crypt(string $string, string $salt): string {} /* datetime.c */ @@ -400,7 +395,7 @@ function strptime(string $timestamp, string $format): array|false {} function gethostname(): string|false {} #endif -function gethostbyaddr(string $ip_address): string|false {} +function gethostbyaddr(string $ip): string|false {} function gethostbyname(string $hostname): string {} @@ -413,23 +408,23 @@ function dns_check_record(string $hostname, string $type = "MX"): bool {} function checkdnsrr(string $hostname, string $type = "MX"): bool {} /** - * @param array $authns - * @param array $addtl + * @param array $authoritative_name_servers + * @param array $additional_records */ -function dns_get_record(string $hostname, int $type = DNS_ANY, &$authns = null, &$addtl = null, bool $raw = false): array|false {} +function dns_get_record(string $hostname, int $type = DNS_ANY, &$authoritative_name_servers = null, &$additional_records = null, bool $raw = false): array|false {} /** - * @param array $mxhosts - * @param array $weight + * @param array $hosts + * @param array $weights */ -function dns_get_mx(string $hostname, &$mxhosts, &$weight = null): bool {} +function dns_get_mx(string $hostname, &$hosts, &$weights = null): bool {} /** - * @param array $mxhosts - * @param array $weight + * @param array $hosts + * @param array $weights * @alias dns_get_mx */ -function getmxrr(string $hostname, &$mxhosts, &$weight = null): bool {} +function getmxrr(string $hostname, &$hosts, &$weights = null): bool {} #endif /* net.c */ @@ -439,12 +434,12 @@ function net_get_interfaces(): array|false {} /* ftok.c */ #if HAVE_FTOK -function ftok(string $pathname, string $proj): int {} +function ftok(string $filename, string $project_id): int {} #endif /* hrtime.c */ -function hrtime(bool $get_as_number = false): array|int|float|false {} +function hrtime(bool $as_number = false): array|int|float|false {} /* lcg.c */ @@ -452,9 +447,9 @@ function lcg_value(): float {} /* md5.c */ -function md5(string $str, bool $raw_output = false): string {} +function md5(string $string, bool $binary = false): string {} -function md5_file(string $filename, bool $raw_output = false): string|false {} +function md5_file(string $filename, bool $binary = false): string|false {} /* pageinfo.c */ @@ -470,14 +465,14 @@ function getlastmod(): int {} /* sha1.c */ -function sha1(string $str, bool $raw_output = false): string {} +function sha1(string $string, bool $binary = false): string {} -function sha1_file(string $filename, bool $raw_output = false): string|false {} +function sha1_file(string $filename, bool $binary = false): string|false {} /* syslog.c */ #ifdef HAVE_SYSLOG_H -function openlog(string $ident, int $option, int $facility): bool {} +function openlog(string $prefix, int $flags, int $facility): bool {} function closelog(): bool {} @@ -485,19 +480,19 @@ function syslog(int $priority, string $message): bool {} #endif #ifdef HAVE_INET_NTOP -function inet_ntop(string $in_addr): string|false {} +function inet_ntop(string $ip): string|false {} #endif #ifdef HAVE_INET_PTON -function inet_pton(string $ip_address): string|false {} +function inet_pton(string $ip): string|false {} #endif /* metaphone.c */ -function metaphone(string $text, int $phones = 0): string|false {} +function metaphone(string $string, int $max_phonemes = 0): string {} /* {{{ head.c */ -function header(string $string, bool $replace = true, int $http_response_code = 0): void {} +function header(string $header, bool $replace = true, int $response_code = 0): void {} function header_remove(?string $name = null): void {} @@ -508,24 +503,24 @@ function setcookie(string $name, string $value = "", array|int $expires_or_optio function http_response_code(int $response_code = 0): int|bool {} /** - * @param string $file + * @param string $filename * @param int $line */ -function headers_sent(&$file = null, &$line = null): bool {} +function headers_sent(&$filename = null, &$line = null): bool {} function headers_list(): array {} /* {{{ html.c */ -function htmlspecialchars(string $string, int $quote_style = ENT_COMPAT, ?string $encoding = null, bool $double_encode = true): string {} +function htmlspecialchars(string $string, int $flags = ENT_COMPAT, ?string $encoding = null, bool $double_encode = true): string {} -function htmlspecialchars_decode(string $string, int $quote_style = ENT_COMPAT): string|false {} +function htmlspecialchars_decode(string $string, int $flags = ENT_COMPAT): string {} -function html_entity_decode(string $string, int $quote_style = ENT_COMPAT, ?string $encoding = null): string|false {} +function html_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string {} -function htmlentities(string $string, int $quote_style = ENT_COMPAT, ?string $encoding = null, bool $double_encode = true): string {} +function htmlentities(string $string, int $flags = ENT_COMPAT, ?string $encoding = null, bool $double_encode = true): string {} -function get_html_translation_table(int $table = HTML_SPECIALCHARS, int $quote_style = ENT_COMPAT, string $encoding = "UTF-8"): array {} +function get_html_translation_table(int $table = HTML_SPECIALCHARS, int $flags = ENT_COMPAT, string $encoding = "UTF-8"): array {} /* }}} */ @@ -534,53 +529,53 @@ function get_html_translation_table(int $table = HTML_SPECIALCHARS, int $quote_s function assert(mixed $assertion, Throwable|string|null $description = null): bool {} /** @param string|callable|null $value */ -function assert_options(int $what, $value = UNKNOWN): array|object|int|string|null {} +function assert_options(int $option, $value = UNKNOWN): array|object|int|string|null {} /* string.c */ -function bin2hex(string $data): string {} +function bin2hex(string $string): string {} -function hex2bin(string $data): string|false {} +function hex2bin(string $string): string|false {} -function strspn(string $str, string $mask, int $start = 0, ?int $len = null): int|false {} +function strspn(string $string, string $characters, int $offset = 0, ?int $length = null): int {} -function strcspn(string $str, string $mask, int $start = 0, ?int $len = null): int|false {} +function strcspn(string $string, string $characters, int $offset = 0, ?int $length = null): int {} #if HAVE_NL_LANGINFO function nl_langinfo(int $item): string|false {} #endif -function strcoll(string $str1, string $str2): int {} +function strcoll(string $string1, string $string2): int {} -function trim(string $str, string $character_mask = " \n\r\t\v\0"): string {} +function trim(string $string, string $characters = " \n\r\t\v\0"): string {} -function rtrim(string $str, string $character_mask = " \n\r\t\v\0"): string {} +function rtrim(string $string, string $characters = " \n\r\t\v\0"): string {} /** @alias rtrim */ -function chop(string $str, string $character_mask = " \n\r\t\v\0"): string {} +function chop(string $string, string $characters = " \n\r\t\v\0"): string {} -function ltrim(string $str, string $character_mask = " \n\r\t\v\0"): string {} +function ltrim(string $string, string $characters = " \n\r\t\v\0"): string {} -function wordwrap(string $str, int $width = 75, string $break = "\n", bool $cut = false): string {} +function wordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false): string {} -function explode(string $separator, string $str, int $limit = PHP_INT_MAX): array {} +function explode(string $separator, string $string, int $limit = PHP_INT_MAX): array {} -function implode(string|array $glue, ?array $pieces = null): string {} +function implode(string|array $separator, ?array $array = null): string {} /** @alias implode */ -function join(string|array $glue, ?array $pieces = null): string {} +function join(string|array $separator, ?array $array = null): string {} -function strtok(string $str, ?string $token = null): string|false {} +function strtok(string $string, ?string $token = null): string|false {} -function strtoupper(string $str): string {} +function strtoupper(string $string): string {} -function strtolower(string $str): string {} +function strtolower(string $string): string {} function basename(string $path, string $suffix = ""): string {} function dirname(string $path, int $levels = 1): string {} -function pathinfo(string $path, int $options = PATHINFO_ALL): array|string {} +function pathinfo(string $path, int $flags = PATHINFO_ALL): array|string {} function stristr(string $haystack, string $needle, bool $before_needle = false): string|false {} @@ -605,50 +600,50 @@ function str_starts_with(string $haystack, string $needle): bool {} function str_ends_with(string $haystack, string $needle): bool {} -function chunk_split(string $str, int $chunklen = 76, string $ending = "\r\n"): string {} +function chunk_split(string $string, int $length = 76, string $separator = "\r\n"): string {} -function substr(string $str, int $start, ?int $length = null): string|false {} +function substr(string $string, int $offset, ?int $length = null): string {} -function substr_replace(array|string $str, array|string $replace, array|int $start, array|int|null $length = null): string|array|false {} +function substr_replace(array|string $string, array|string $replace, array|int $offset, array|int|null $length = null): string|array {} -function quotemeta(string $str): string {} +function quotemeta(string $string): string {} function ord(string $character): int {} function chr(int $codepoint): string {} -function ucfirst(string $str): string {} +function ucfirst(string $string): string {} -function lcfirst(string $str): string {} +function lcfirst(string $string): string {} -function ucwords(string $str, string $delimiters = " \t\r\n\f\v"): string {} +function ucwords(string $string, string $separators = " \t\r\n\f\v"): string {} -function strtr(string $str, string|array $from, ?string $to = null): string {} +function strtr(string $string, string|array $from, ?string $to = null): string {} -function strrev(string $str): string {} +function strrev(string $string): string {} /** @param float $percent */ -function similar_text(string $str1, string $str2, &$percent = null): int {} +function similar_text(string $string1, string $string2, &$percent = null): int {} -function addcslashes(string $str, string $charlist): string {} +function addcslashes(string $string, string $characters): string {} -function addslashes(string $str): string {} +function addslashes(string $string): string {} -function stripcslashes(string $str): string {} +function stripcslashes(string $string): string {} -function stripslashes(string $str): string {} +function stripslashes(string $string): string {} -/** @param int $replace_count */ -function str_replace(array|string $search, array|string $replace, string|array $subject, &$replace_count = null): string|array {} +/** @param int $count */ +function str_replace(array|string $search, array|string $replace, string|array $subject, &$count = null): string|array {} -/** @param int $replace_count */ -function str_ireplace(array|string $search, array|string $replace, string|array $subject, &$replace_count = null): string|array {} +/** @param int $count */ +function str_ireplace(array|string $search, array|string $replace, string|array $subject, &$count = null): string|array {} -function hebrev(string $str, int $max_chars_per_line = 0): string {} +function hebrev(string $string, int $max_chars_per_line = 0): string {} -function nl2br(string $str, bool $is_xhtml = true): string {} +function nl2br(string $string, bool $use_xhtml = true): string {} -function strip_tags(string $str, array|string|null $allowable_tags = null): string {} +function strip_tags(string $string, array|string|null $allowed_tags = null): string {} /** * @param array|string $locales @@ -657,56 +652,58 @@ function strip_tags(string $str, array|string|null $allowable_tags = null): stri function setlocale(int $category, $locales, ...$rest): string|false {} /** @param array $result */ -function parse_str(string $encoded_string, &$result): void {} +function parse_str(string $string, &$result): void {} -function str_getcsv(string $string, string $delimiter = ",", string $enclosure = "\"", string $escape = '\\'): array {} +function str_getcsv(string $string, string $separator = ",", string $enclosure = "\"", string $escape = '\\'): array {} -function str_repeat(string $input, int $mult): string {} +function str_repeat(string $string, int $times): string {} -function count_chars(string $input, int $mode = 0): array|string {} +function count_chars(string $string, int $mode = 0): array|string {} -function strnatcmp(string $s1, string $s2): int {} +function strnatcmp(string $string1, string $string2): int {} function localeconv(): array {} -function strnatcasecmp(string $s1, string $s2): int {} +function strnatcasecmp(string $string1, string $string2): int {} function substr_count(string $haystack, string $needle, int $offset = 0, ?int $length = null): int {} -function str_pad(string $input, int $pad_length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT): string {} +function str_pad(string $string, int $length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT): string {} -function sscanf(string $str, string $format, mixed &...$vars): array|int|null {} +function sscanf(string $string, string $format, mixed &...$vars): array|int|null {} -function str_rot13(string $str): string {} +function str_rot13(string $string): string {} -function str_shuffle(string $str): string {} +function str_shuffle(string $string): string {} -function str_word_count(string $str, int $format = 0, ?string $charlist = null): array|int {} +function str_word_count(string $string, int $format = 0, ?string $characters = null): array|int {} -function str_split(string $str, int $split_length = 1): array {} +function str_split(string $string, int $length = 1): array {} -function strpbrk(string $haystack, string $char_list): string|false {} +function strpbrk(string $string, string $characters): string|false {} -function substr_compare(string $main_str, string $str, int $offset, ?int $length = null, bool $case_insensitivity = false): int|false {} +function substr_compare(string $haystack, string $needle, int $offset, ?int $length = null, bool $case_insensitive = false): int {} -function utf8_encode(string $data): string {} +function utf8_encode(string $string): string {} -function utf8_decode(string $data): string {} +function utf8_decode(string $string): string {} + +/* dir.c */ /** * @param resource|null $context * @return resource|false */ -function opendir(string $path, $context = null) {} +function opendir(string $directory, $context = null) {} /** @param resource $context */ -function getdir(string $path, $context = null): Directory|false {} +function getdir(string $directory, $context = null): Directory|false {} /** * @param resource|null $context * @alias getdir */ -function dir(string $path, $context = null): Directory|false {} +function dir(string $directory, $context = null): Directory|false {} /** @param resource|null $dir_handle */ function closedir($dir_handle = null): void {} @@ -759,10 +756,10 @@ function proc_nice(int $priority): bool {} /* file.c */ /** - * @param resource $handle - * @param int $wouldblock + * @param resource $stream + * @param int $would_block */ -function flock($handle, int $operation, &$wouldblock = null): bool {} +function flock($stream, int $operation, &$would_block = null): bool {} function get_meta_tags(string $filename, bool $use_include_path = false): array|false {} @@ -775,28 +772,28 @@ function popen(string $command, string $mode) {} /** @param resource|null $context */ function readfile(string $filename, bool $use_include_path = false, $context = null): int|false {} -/** @param resource $handle */ -function rewind($handle): bool {} +/** @param resource $stream */ +function rewind($stream): bool {} /** @param resource|null $context */ -function rmdir(string $dirname, $context = null): bool {} +function rmdir(string $directory, $context = null): bool {} function umask(?int $mask = null): int {} -/** @param resource $handle */ -function fclose($handle): bool {} +/** @param resource $stream */ +function fclose($stream): bool {} -/** @param resource $handle */ -function feof($handle): bool {} +/** @param resource $stream */ +function feof($stream): bool {} -/** @param resource $handle */ -function fgetc($handle): string|false {} +/** @param resource $stream */ +function fgetc($stream): string|false {} -/** @param resource $handle */ -function fgets($handle, ?int $length = null): string|false {} +/** @param resource $stream */ +function fgets($stream, ?int $length = null): string|false {} -/** @param resource $handle */ -function fread($handle, int $length): string|false {} +/** @param resource $stream */ +function fread($stream, int $length): string|false {} /** * @param resource|null $context @@ -805,45 +802,45 @@ function fread($handle, int $length): string|false {} function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) {} /** @param resource $stream */ -function fscanf($stream, string $format, mixed &...$args): array|int|false|null {} +function fscanf($stream, string $format, mixed &...$vars): array|int|false|null {} -/** @param resource $handle */ -function fpassthru($handle): int {} +/** @param resource $stream */ +function fpassthru($stream): int {} -/** @param resource $handle */ -function ftruncate($handle, int $size): bool {} +/** @param resource $stream */ +function ftruncate($stream, int $size): bool {} -/** @param resource $handle */ -function fstat($handle): array|false {} +/** @param resource $stream */ +function fstat($stream): array|false {} -/** @param resource $handle */ -function fseek($handle, int $offset, int $whence = SEEK_SET): int {} +/** @param resource $stream */ +function fseek($stream, int $offset, int $whence = SEEK_SET): int {} -/** @param resource $handle */ -function ftell($handle): int|false {} +/** @param resource $stream */ +function ftell($stream): int|false {} -/** @param resource $handle */ -function fflush($handle): bool {} +/** @param resource $stream */ +function fflush($stream): bool {} -/** @param resource $handle */ -function fwrite($handle, string $content, ?int $max_length = null): int|false {} +/** @param resource $stream */ +function fwrite($stream, string $string, ?int $max_length = null): int|false {} /** - * @param resource $handle + * @param resource $stream * @alias fwrite */ -function fputs($handle, string $content, ?int $max_length = null): int|false {} +function fputs($stream, string $string, ?int $max_length = null): int|false {} /** @param resource|null $context */ -function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): bool {} +function mkdir(string $directory, int $mode = 0777, bool $recursive = false, $context = null): bool {} /** @param resource|null $context */ -function rename(string $oldname, string $newname, $context = null): bool {} +function rename(string $from, string $to, $context = null): bool {} /** @param resource|null $context */ -function copy(string $source, string $dest, $context = null): bool {} +function copy(string $from, string $to, $context = null): bool {} -function tempnam(string $dir, string $prefix): string|false {} +function tempnam(string $directory, string $prefix): string|false {} /** @return resource|false */ function tmpfile() {} @@ -852,7 +849,7 @@ function tmpfile() {} function file(string $filename, int $flags = 0, $context = null): array|false {} /** @param resource|null $context */ -function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $maxlen = null): string|false {} +function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $max_length = null): string|false {} /** @param resource|null $context */ function unlink(string $filename, $context = null): bool {} @@ -860,11 +857,11 @@ function unlink(string $filename, $context = null): bool {} /** @param resource|null $context */ function file_put_contents(string $filename, mixed $content, int $flags = 0, $context = null): int|false {} -/** @param resource $handle */ -function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\"): int|false {} +/** @param resource $stream */ +function fputcsv($stream, array $fields, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): int|false {} -/** @param resource $handle */ -function fgetcsv($handle, ?int $length = null, string $delimiter = ",", string $enclosure = "\"", string $escape = "\\"): array|false {} +/** @param resource $stream */ +function fgetcsv($stream, ?int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false {} function realpath(string $path): string|false {} @@ -928,7 +925,7 @@ function lchgrp(string $filename, string|int $group): bool {} function chmod(string $filename, int $mode): bool {} #if HAVE_UTIME -function touch(string $filename, ?int $time = null, ?int $atime = null): bool {} +function touch(string $filename, ?int $mtime = null, ?int $atime = null): bool {} #endif function clearstatcache(bool $clear_realpath_cache = false, string $filename = ""): void {} @@ -946,39 +943,39 @@ function realpath_cache_size(): int {} /* formatted_print.c */ -function sprintf(string $format, mixed ...$args): string {} +function sprintf(string $format, mixed ...$values): string {} -function printf(string $format, mixed ...$args): int {} +function printf(string $format, mixed ...$values): int {} -function vprintf(string $format, array $args): int {} +function vprintf(string $format, array $values): int {} -function vsprintf(string $format, array $args): string {} +function vsprintf(string $format, array $values): string {} -/** @param resource $handle */ -function fprintf($handle, string $format, mixed ...$args): int {} +/** @param resource $stream */ +function fprintf($stream, string $format, mixed ...$values): int {} -/** @param resource $handle */ -function vfprintf($handle, string $format, array $args): int {} +/** @param resource $stream */ +function vfprintf($stream, string $format, array $values): int {} /* fsock.c */ /** - * @param int $errno - * @param string $errstr + * @param int $error_code + * @param string $error_message * @return resource|false */ -function fsockopen(string $hostname, int $port = -1, &$errno = null, &$errstr = null, ?float $timeout = null) {} +function fsockopen(string $hostname, int $port = -1, &$error_code = null, &$error_message = null, ?float $timeout = null) {} /** - * @param int $errno - * @param string $errstr + * @param int $error_code + * @param string $error_message * @return resource|false */ -function pfsockopen(string $hostname, int $port = -1, &$errno = null, &$errstr = null, ?float $timeout = null) {} +function pfsockopen(string $hostname, int $port = -1, &$error_code = null, &$error_message = null, ?float $timeout = null) {} /* http.c */ -function http_build_query(array|object $data, string $numeric_prefix = "", ?string $arg_separator = null, int $enc_type = PHP_QUERY_RFC1738): string|false {} +function http_build_query(array|object $data, string $numeric_prefix = "", ?string $arg_separator = null, int $encoding_type = PHP_QUERY_RFC1738): string {} /* image.c */ @@ -987,18 +984,18 @@ function image_type_to_mime_type(int $image_type): string {} function image_type_to_extension(int $image_type, bool $include_dot = true): string|false {} /** @param array $image_info */ -function getimagesize(string $image_path, &$image_info = null): array|false {} +function getimagesize(string $filename, &$image_info = null): array|false {} /** @param array $image_info */ -function getimagesizefromstring(string $image, &$image_info = null): array|false {} +function getimagesizefromstring(string $string, &$image_info = null): array|false {} /* info.c */ -function phpinfo(int $what = INFO_ALL): bool {} +function phpinfo(int $flags = INFO_ALL): bool {} function phpversion(?string $extension = null): string|false {} -function phpcredits(int $flag = CREDITS_ALL): bool {} +function phpcredits(int $flags = CREDITS_ALL): bool {} function php_sapi_name(): string|false {} @@ -1010,13 +1007,13 @@ function php_ini_loaded_file(): string|false {} /* iptc.c */ -function iptcembed(string $iptcdata, string $jpeg_file_name, int $spool = 0): string|bool {} +function iptcembed(string $iptc_data, string $filename, int $spool = 0): string|bool {} -function iptcparse(string $iptcblock): array|false {} +function iptcparse(string $iptc_block): array|false {} /* levenshtein.c */ -function levenshtein(string $str1, string $str2, int $cost_ins = 1, int $cost_rep = 1, int $cost_del = 1): int {} +function levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $repetition_cost = 1, int $deletion_cost = 1): int {} /* link.c */ @@ -1032,73 +1029,73 @@ function link(string $target, string $link): bool {} /* mail.c */ -function mail(string $to, string $subject, string $message, array|string $additional_headers = [], string $additional_parameters = ""): bool {} +function mail(string $to, string $subject, string $message, array|string $additional_headers = [], string $additional_params = ""): bool {} /* math.c */ -function abs(int|float $number): int|float {} +function abs(int|float $num): int|float {} -function ceil(int|float $number): float {} +function ceil(int|float $num): float {} -function floor(int|float $number): float {} +function floor(int|float $num): float {} -function round(int|float $number, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float {} +function round(int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float {} -function sin(float $number): float {} +function sin(float $num): float {} -function cos(float $number): float {} +function cos(float $num): float {} -function tan(float $number): float {} +function tan(float $num): float {} -function asin(float $number): float {} +function asin(float $num): float {} -function acos(float $number): float {} +function acos(float $num): float {} -function atan(float $number): float {} +function atan(float $num): float {} -function atanh(float $number): float {} +function atanh(float $num): float {} function atan2(float $y, float $x): float {} -function sinh(float $number): float {} +function sinh(float $num): float {} -function cosh(float $number): float {} +function cosh(float $num): float {} -function tanh(float $number): float {} +function tanh(float $num): float {} -function asinh(float $number): float {} +function asinh(float $num): float {} -function acosh(float $number): float {} +function acosh(float $num): float {} -function expm1(float $number): float {} +function expm1(float $num): float {} -function log1p(float $number): float {} +function log1p(float $num): float {} function pi(): float {} -function is_finite(float $number): bool {} +function is_finite(float $num): bool {} -function is_nan(float $number): bool {} +function is_nan(float $num): bool {} -function intdiv(int $dividend, int $divisor): int {} +function intdiv(int $num1, int $num2): int {} -function is_infinite(float $number): bool {} +function is_infinite(float $num): bool {} -function pow(mixed $base, mixed $exp): int|float|object {} +function pow(mixed $num, mixed $exponent): int|float|object {} -function exp(float $number): float {} +function exp(float $num): float {} -function log(float $number, float $base = M_E): float {} +function log(float $num, float $base = M_E): float {} -function log10(float $number): float {} +function log10(float $num): float {} -function sqrt(float $number): float {} +function sqrt(float $num): float {} function hypot(float $x, float $y): float {} -function deg2rad(float $number): float {} +function deg2rad(float $num): float {} -function rad2deg(float $number): float {} +function rad2deg(float $num): float {} function bindec(string $binary_string): int|float {} @@ -1106,37 +1103,37 @@ function hexdec(string $hex_string): int|float {} function octdec(string $octal_string): int|float {} -function decbin(int $number): string {} +function decbin(int $num): string {} -function decoct(int $number): string {} +function decoct(int $num): string {} -function dechex(int $number): string {} +function dechex(int $num): string {} -function base_convert(string $number, int $frombase, int $tobase): string {} +function base_convert(string $num, int $from_base, int $to_base): string {} -function number_format(float $number, int $decimals = 0, ?string $decimal_point = "." , ?string $thousands_separator = ","): string {} +function number_format(float $num, int $decimals = 0, ?string $decimal_separator = "." , ?string $thousands_separator = ","): string {} -function fmod(float $x, float $y): float {} +function fmod(float $num1, float $num2): float {} -function fdiv(float $dividend, float $divisor): float {} +function fdiv(float $num1, float $num2): float {} /* microtime.c */ #ifdef HAVE_GETTIMEOFDAY -function microtime(bool $getAsFloat = false): string|float {} +function microtime(bool $as_float = false): string|float {} -function gettimeofday(bool $returnFloat = false): array|float {} +function gettimeofday(bool $as_float = false): array|float {} #endif #ifdef HAVE_GETRUSAGE -function getrusage(int $who = 0): array|false {} +function getrusage(bool $mode = 0): array|false {} #endif /* pack.c */ -function pack(string $format, mixed ...$args): string|false {} +function pack(string $format, mixed ...$values): string {} -function unpack(string $format, string $data, int $offset = 0): array|false {} +function unpack(string $format, string $string, int $offset = 0): array|false {} /* password.c */ @@ -1157,7 +1154,7 @@ function password_algos(): array {} * @param array $pipes * @return resource|false */ -function proc_open(array|string $cmd, array $descriptorspec, &$pipes, ?string $cwd = null, ?array $env = null, ?array $other_options = null) {} +function proc_open(array|string $command, array $descriptor_spec, &$pipes, ?string $cwd = null, ?array $env_vars = null, ?array $options = null) {} /** @param resource $process */ function proc_close($process): int {} @@ -1171,9 +1168,9 @@ function proc_get_status($process): array {} /* quot_print.c */ -function quoted_printable_decode(string $str): string {} +function quoted_printable_decode(string $string): string {} -function quoted_printable_encode(string $str): string {} +function quoted_printable_encode(string $string): string {} /* mt_rand.c */ @@ -1199,11 +1196,11 @@ function random_int(int $min, int $max): int {} /* soundex.c */ -function soundex(string $string): string|false {} +function soundex(string $string): string {} /* streamsfuncs.c */ -function stream_select(?array &$read, ?array &$write, ?array &$except, ?int $tv_sec, int $tv_usec = 0): int|false {} +function stream_select(?array &$read, ?array &$write, ?array &$except, ?int $seconds, int $microseconds = 0): int|false {} /** @return resource */ function stream_context_create(?array $options = null, ?array $params = null) {} @@ -1230,43 +1227,43 @@ function stream_context_set_default(array $options) {} * @param resource $stream * @return resource|false */ -function stream_filter_prepend($stream, string $filtername, int $read_write = 0, mixed $params = UNKNOWN) {} +function stream_filter_prepend($stream, string $filter_name, int $mode = 0, mixed $params = UNKNOWN) {} /** * @param resource $stream * @return resource|false */ -function stream_filter_append($stream, string $filtername, int $read_write = 0, mixed $params = UNKNOWN) {} +function stream_filter_append($stream, string $filter_name, int $mode = 0, mixed $params = UNKNOWN) {} /** @param resource $stream_filter */ function stream_filter_remove($stream_filter): bool {} /** - * @param int $errno - * @param string $errstr + * @param int $error_code + * @param string $error_message * @param resource|null $context * @return resource|false */ -function stream_socket_client(string $remote_socket, &$errno = null, &$errstr = null, ?float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null) {} +function stream_socket_client(string $address, &$error_code = null, &$error_message = null, ?float $timeout = null, int $flags = STREAM_CLIENT_CONNECT, $context = null) {} /** - * @param int $errno - * @param string $errstr + * @param int $error_code + * @param string $error_message * @param resource|null $context * @return resource|false */ -function stream_socket_server(string $local_socket, &$errno = null, &$errstr = null, int $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context = null) {} +function stream_socket_server(string $address, &$error_code = null, &$error_message = null, int $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context = null) {} /** - * @param resource $server_socket + * @param resource $socket * @param float $timeout - * @param string $peername + * @param string $peer_name * @return resource|false */ -function stream_socket_accept($server_socket, ?float $timeout = null, &$peername = null) {} +function stream_socket_accept($socket, ?float $timeout = null, &$peer_name = null) {} -/** @param resource $handle */ -function stream_socket_get_name($handle, bool $want_peer): string|false {} +/** @param resource $socket */ +function stream_socket_get_name($socket, bool $remote): string|false {} /** * @param resource $socket @@ -1285,7 +1282,7 @@ function stream_socket_enable_crypto($stream, bool $enable, ?int $crypto_type = #ifdef HAVE_SHUTDOWN /** @param resource $stream */ -function stream_socket_shutdown($stream, int $how): bool {} +function stream_socket_shutdown($stream, int $mode): bool {} #endif #if HAVE_SOCKETPAIR @@ -1293,36 +1290,37 @@ function stream_socket_pair(int $domain, int $type, int $protocol): array|false #endif /** - * @param resource $source - * @param resource $dest + * @param resource $from + * @param resource $to */ -function stream_copy_to_stream($source, $dest, ?int $maxlength = null, int $position = 0): int|false {} +function stream_copy_to_stream($from, $to, ?int $max_length = null, int $offset = 0): int|false {} -/** @param resource $handle */ -function stream_get_contents($handle, ?int $maxlength = null, int $position = -1): string|false {} +/** @param resource $stream */ +function stream_get_contents($stream, ?int $max_length = null, int $offset = -1): string|false {} /** @param resource $stream */ function stream_supports_lock($stream): bool {} /** @param resource $stream */ -function stream_set_write_buffer($stream, int $buffer): int {} +function stream_set_write_buffer($stream, int $size): int {} /** * @param resource $stream - * @alias stream_set_write_buffer */ -function set_file_buffer($stream, int $buffer): int {} + * @alias stream_set_write_buffer + */ +function set_file_buffer($stream, int $size): int {} /** @param resource $stream */ -function stream_set_read_buffer($stream, int $buffer): int {} +function stream_set_read_buffer($stream, int $size): int {} /** @param resource $stream */ -function stream_set_blocking($stream, bool $mode): bool {} +function stream_set_blocking($stream, bool $enable): bool {} /** * @param resource $stream * @alias stream_set_blocking */ -function socket_set_blocking($stream, bool $mode): bool {} +function socket_set_blocking($stream, bool $enable): bool {} /** @param resource $stream */ function stream_get_meta_data($stream): array {} @@ -1333,14 +1331,14 @@ function stream_get_meta_data($stream): array {} */ function socket_get_status($stream): array {} -/** @param resource $handle */ -function stream_get_line($handle, int $max_length, string $ending = ""): string|false {} +/** @param resource $stream */ +function stream_get_line($stream, int $max_length, string $ending = ""): string|false {} function stream_resolve_include_path(string $filename): string|false {} -function stream_get_wrappers(): array|false {} +function stream_get_wrappers(): array {} -function stream_get_transports(): array|false {} +function stream_get_transports(): array {} /** @param resource|string $stream */ function stream_is_local($stream): bool {} @@ -1357,21 +1355,21 @@ function sapi_windows_vt100_support($stream, ?bool $enable = null): bool {} function stream_set_chunk_size($stream, int $size): int {} #if HAVE_SYS_TIME_H || defined(PHP_WIN32) -/** @param resource $socket */ -function stream_set_timeout($socket, int $seconds, int $microseconds = 0): bool {} +/** @param resource $stream */ +function stream_set_timeout($stream, int $seconds, int $microseconds = 0): bool {} /** - * @param resource $socket + * @param resource $stream * @alias stream_set_timeout */ -function socket_set_timeout($socket, int $seconds, int $microseconds = 0): bool {} +function socket_set_timeout($stream, int $seconds, int $microseconds = 0): bool {} #endif /* type.c */ -function gettype(mixed $var): string {} +function gettype(mixed $value): string {} -function get_debug_type(mixed $var): string {} +function get_debug_type(mixed $value): string {} function settype(mixed &$var, string $type): bool {} @@ -1442,7 +1440,10 @@ function rawurlencode(string $string): string {} function rawurldecode(string $string): string {} /** @param resource $context */ -function get_headers(string $url, int $format = 0, $context = null): array|false {} +// TODO: Make bool argument? +function get_headers(string $url, int $as_assoc_array = 0, $context = null): array|false {} + +/* user_filters.c */ /** @param resource $brigade */ function stream_bucket_make_writeable($brigade): ?object {} @@ -1454,17 +1455,17 @@ function stream_bucket_prepend($brigade, object $bucket): void {} function stream_bucket_append($brigade, object $bucket): void {} /** @param resource $stream */ -function stream_bucket_new($stream, string $buffer): object|false {} +function stream_bucket_new($stream, string $buffer): object {} function stream_get_filters(): array {} -function stream_filter_register(string $filtername, string $classname): bool {} +function stream_filter_register(string $filter_name, string $class): bool {} /* uuencode.c */ -function convert_uuencode(string $data): string|false {} +function convert_uuencode(string $string): string {} -function convert_uudecode(string $data): string|false {} +function convert_uudecode(string $string): string|false {} /* var.c */ @@ -1489,7 +1490,7 @@ function version_compare(string $version1, string $version2, ?string $operator = /* win32/codepage.c */ #ifdef PHP_WIN32 -function sapi_windows_cp_set(int $cp): bool {} +function sapi_windows_cp_set(int $codepage): bool {} function sapi_windows_cp_get(string $kind = ""): int {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 37f6d8c159c67..5ee5b9602900b 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: df6d5ebb0449274b94f1e8707ab54978fd4b7d2f */ + * Stub hash: af5b921b66f7dd68ba8c771199825a439a07dba0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -10,7 +10,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header_register_callback, 0, 1, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_start, 0, 0, _IS_BOOL, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, user_function, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, callback, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, chunk_size, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "PHP_OUTPUT_HANDLER_STDFLAGS") ZEND_END_ARG_INFO() @@ -45,7 +45,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_get_status, 0, 0, IS_ARRAY, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_implicit_flush, 0, 0, IS_VOID, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, _IS_BOOL, 0, "true") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() #define arginfo_output_reset_rewrite_vars arginfo_ob_flush @@ -57,7 +57,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_wrapper_register, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, classname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -70,7 +70,7 @@ ZEND_END_ARG_INFO() #define arginfo_stream_wrapper_restore arginfo_stream_wrapper_unregister ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_push, 0, 1, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(1, stack, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -82,7 +82,7 @@ ZEND_END_ARG_INFO() #define arginfo_ksort arginfo_krsort ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, var) + ZEND_ARG_OBJ_TYPE_MASK(0, value, Countable, MAY_BE_ARRAY, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "COUNT_NORMAL") ZEND_END_ARG_INFO() @@ -112,7 +112,7 @@ ZEND_END_ARG_INFO() #define arginfo_uksort arginfo_usort ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_end, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_MASK(1, arg, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) + ZEND_ARG_TYPE_MASK(1, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_END_ARG_INFO() #define arginfo_prev arginfo_end @@ -122,26 +122,26 @@ ZEND_END_ARG_INFO() #define arginfo_reset arginfo_end ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_current, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_MASK(0, arg, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) + ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_END_ARG_INFO() #define arginfo_pos arginfo_current ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_key, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) - ZEND_ARG_TYPE_MASK(0, arg, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) + ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_min, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, arg, IS_MIXED, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_max arginfo_min ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_walk, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_MASK(1, input, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) + ZEND_ARG_TYPE_MASK(1, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) - ZEND_ARG_TYPE_INFO(0, argument, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, arg, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_array_walk_recursive arginfo_array_walk @@ -160,7 +160,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_extract, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(ZEND_SEND_PREFER_REF, array, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extract_type, IS_LONG, 0, "EXTR_OVERWRITE") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "EXTR_OVERWRITE") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prefix, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() @@ -170,7 +170,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_compact, 0, 1, IS_ARRAY, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_fill, 0, 3, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, start_key, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, start_index, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, count, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -181,15 +181,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_fill_keys, 0, 2, IS_ARRAY, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_range, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, low) - ZEND_ARG_INFO(0, high) + ZEND_ARG_INFO(0, start) + ZEND_ARG_INFO(0, end) ZEND_ARG_TYPE_MASK(0, step, MAY_BE_LONG|MAY_BE_DOUBLE, "1") ZEND_END_ARG_INFO() #define arginfo_shuffle arginfo_natsort ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_pop, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(1, stack, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) ZEND_END_ARG_INFO() #define arginfo_array_shift arginfo_array_pop @@ -200,7 +200,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_splice, 0, 2, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(1, array, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, replacements, IS_MIXED, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, replacement, IS_MIXED, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_slice, 0, 2, IS_ARRAY, 0) @@ -254,8 +254,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_pad, 0, 3, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, pad_size, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, pad_value, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_array_flip arginfo_array_values @@ -309,13 +309,13 @@ ZEND_END_ARG_INFO() #define arginfo_array_udiff_uassoc arginfo_array_intersect_ukey ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_multisort, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, array1) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, array) ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, rest) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_array_rand, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_ARRAY) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, num_req, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, num, IS_LONG, 0, "1") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_array_sum, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) @@ -333,7 +333,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_filter, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_keys, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_map, 0, 2, IS_ARRAY, 0) @@ -351,7 +351,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_chunk, 0, 2, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preserve_keys, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() @@ -361,11 +361,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_combine, 0, 2, IS_ARRAY, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base64_encode, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_base64_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, strict, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() @@ -374,28 +374,28 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_constant, 0, 1, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ip2long, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_long2ip, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, proper_address, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, ip, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getenv, 0, 0, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, variable, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, local_only, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() #if defined(HAVE_PUTENV) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_putenv, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, setting, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, assignment, IS_STRING, 0) ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getopt, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, longopts, IS_ARRAY, 0, "[]") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, optind, "null") + ZEND_ARG_TYPE_INFO(0, short_options, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, long_options, IS_ARRAY, 0, "[]") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, rest_index, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_flush, 0, 0, IS_VOID, 0) @@ -426,14 +426,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_current_user, 0, 0, IS_STRIN ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_cfg_var, 0, 1, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, option_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_log, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message_type, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extra_headers, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_headers, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_error_get_last, 0, 0, IS_ARRAY, 1) @@ -442,12 +442,12 @@ ZEND_END_ARG_INFO() #define arginfo_error_clear_last arginfo_flush ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_call_user_func, 0, 1, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, function, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_call_user_func_array, 0, 2, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, function, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -456,7 +456,7 @@ ZEND_END_ARG_INFO() #define arginfo_forward_static_call_array arginfo_call_user_func_array ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_register_shutdown_function, 0, 1, _IS_BOOL, 1) - ZEND_ARG_INFO(0, function) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -477,7 +477,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_highlight_string, 0, 1, MAY_BE_S ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, varname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get_all, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) @@ -486,14 +486,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_get_all, 0, 0, MAY_BE_ARRAY| ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ini_set, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, varname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_ini_alter arginfo_ini_set ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ini_restore, 0, 1, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, varname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_set_include_path, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) @@ -503,7 +503,7 @@ ZEND_END_ARG_INFO() #define arginfo_get_include_path arginfo_ob_get_flush ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_print_r, 0, 1, MAY_BE_STRING|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, var, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() @@ -512,7 +512,7 @@ ZEND_END_ARG_INFO() #define arginfo_connection_status arginfo_ob_get_level ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ignore_user_abort, 0, 0, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, _IS_BOOL, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 1, "null") ZEND_END_ARG_INFO() #if HAVE_GETSERVBYNAME @@ -531,7 +531,7 @@ ZEND_END_ARG_INFO() #if HAVE_GETPROTOBYNAME ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getprotobyname, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) ZEND_END_ARG_INFO() #endif @@ -542,21 +542,21 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_register_tick_function, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, function, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unregister_tick_function, 0, 1, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, function, IS_CALLABLE, 0) + ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_uploaded_file, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_move_uploaded_file, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, new_path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_parse_ini_file, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) @@ -582,16 +582,16 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_browser, 0, 0, MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, browser_name, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, user_agent, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, return_array, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crc32, 0, 1, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_crypt, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -608,7 +608,7 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gethostbyaddr, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gethostbyname, 0, 1, IS_STRING, 0) @@ -634,8 +634,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dns_get_record, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "DNS_ANY") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, authns, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, addtl, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, authoritative_name_servers, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, additional_records, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() #endif @@ -643,8 +643,8 @@ ZEND_END_ARG_INFO() #if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dns_get_mx, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) - ZEND_ARG_INFO(1, mxhosts) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, weight, "null") + ZEND_ARG_INFO(1, hosts) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, weights, "null") ZEND_END_ARG_INFO() #endif @@ -657,26 +657,26 @@ ZEND_END_ARG_INFO() #if HAVE_FTOK ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftok, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, pathname, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, proj, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, project_id, IS_STRING, 0) ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hrtime, 0, 0, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get_as_number, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_number, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lcg_value, 0, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_md5, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_md5_file, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, raw_output, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() #define arginfo_getmyuid arginfo_ob_get_length @@ -695,8 +695,8 @@ ZEND_END_ARG_INFO() #if defined(HAVE_SYSLOG_H) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openlog, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, ident, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, facility, IS_LONG, 0) ZEND_END_ARG_INFO() #endif @@ -715,25 +715,25 @@ ZEND_END_ARG_INFO() #if defined(HAVE_INET_NTOP) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inet_ntop, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, in_addr, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) ZEND_END_ARG_INFO() #endif #if defined(HAVE_INET_PTON) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_inet_pton, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, ip_address, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, ip, IS_STRING, 0) ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_metaphone, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, phones, IS_LONG, 0, "0") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_metaphone, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_phonemes, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header, 0, 1, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, replace, _IS_BOOL, 0, "true") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, http_response_code, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, response_code, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_header_remove, 0, 0, IS_VOID, 0) @@ -757,7 +757,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_http_response_code, 0, 0, MAY_BE ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_headers_sent, 0, 0, _IS_BOOL, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, file, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, filename, "null") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, line, "null") ZEND_END_ARG_INFO() @@ -765,19 +765,19 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_htmlspecialchars, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quote_style, IS_LONG, 0, "ENT_COMPAT") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_COMPAT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, double_encode, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_htmlspecialchars_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_htmlspecialchars_decode, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quote_style, IS_LONG, 0, "ENT_COMPAT") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_COMPAT") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_html_entity_decode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_html_entity_decode, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quote_style, IS_LONG, 0, "ENT_COMPAT") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_COMPAT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -785,7 +785,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get_html_translation_table, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, table, IS_LONG, 0, "HTML_SPECIALCHARS") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, quote_style, IS_LONG, 0, "ENT_COMPAT") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "ENT_COMPAT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 0, "\"UTF-8\"") ZEND_END_ARG_INFO() @@ -795,23 +795,21 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_assert, 0, 1, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_assert_options, 0, 1, MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_LONG|MAY_BE_STRING|MAY_BE_NULL) - ZEND_ARG_TYPE_INFO(0, what, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bin2hex, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_bin2hex arginfo_base64_encode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hex2bin, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strspn, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, mask, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, start, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, len, IS_LONG, 1, "null") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strspn, 0, 2, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, characters, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #define arginfo_strcspn arginfo_strspn @@ -823,13 +821,13 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strcoll, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, str1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trim, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, character_mask, IS_STRING, 0, "\" \\n\\r\\t\\v\\0\"") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, characters, IS_STRING, 0, "\" \\n\\r\\t\\v\\0\"") ZEND_END_ARG_INFO() #define arginfo_rtrim arginfo_trim @@ -839,27 +837,27 @@ ZEND_END_ARG_INFO() #define arginfo_ltrim arginfo_trim ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_wordwrap, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, width, IS_LONG, 0, "75") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, break, IS_STRING, 0, "\"\\n\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cut, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cut_long_words, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_explode, 0, 2, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, separator, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "PHP_INT_MAX") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_implode, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_MASK(0, glue, MAY_BE_STRING|MAY_BE_ARRAY, NULL) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pieces, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_MASK(0, separator, MAY_BE_STRING|MAY_BE_ARRAY, NULL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, array, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() #define arginfo_join arginfo_implode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtok, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, token, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -879,7 +877,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pathinfo, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING) ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "PATHINFO_ALL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "PATHINFO_ALL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stristr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) @@ -919,21 +917,21 @@ ZEND_END_ARG_INFO() #define arginfo_str_ends_with arginfo_str_contains ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chunk_split, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, chunklen, IS_LONG, 0, "76") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ending, IS_STRING, 0, "\"\\r\\n\"") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "76") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\r\\n\"") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr, 0, 2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_MASK(0, str, MAY_BE_ARRAY|MAY_BE_STRING, NULL) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_replace, 0, 3, MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_TYPE_MASK(0, string, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, replace, MAY_BE_ARRAY|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_MASK(0, start, MAY_BE_ARRAY|MAY_BE_LONG, NULL) + ZEND_ARG_TYPE_MASK(0, offset, MAY_BE_ARRAY|MAY_BE_LONG, NULL) ZEND_ARG_TYPE_MASK(0, length, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() @@ -952,12 +950,12 @@ ZEND_END_ARG_INFO() #define arginfo_lcfirst arginfo_base64_encode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ucwords, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiters, IS_STRING, 0, "\" \\t\\r\\n\\f\\v\"") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separators, IS_STRING, 0, "\" \\t\\r\\n\\f\\v\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strtr, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, from, MAY_BE_STRING|MAY_BE_ARRAY, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, to, IS_STRING, 1, "null") ZEND_END_ARG_INFO() @@ -965,14 +963,14 @@ ZEND_END_ARG_INFO() #define arginfo_strrev arginfo_base64_encode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_similar_text, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, str1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, percent, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_addcslashes, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, charlist, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, characters, IS_STRING, 0) ZEND_END_ARG_INFO() #define arginfo_addslashes arginfo_base64_encode @@ -985,24 +983,24 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_str_replace, 0, 3, MAY_BE_STRING ZEND_ARG_TYPE_MASK(0, search, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, replace, MAY_BE_ARRAY|MAY_BE_STRING, NULL) ZEND_ARG_TYPE_MASK(0, subject, MAY_BE_STRING|MAY_BE_ARRAY, NULL) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, replace_count, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, count, "null") ZEND_END_ARG_INFO() #define arginfo_str_ireplace arginfo_str_replace ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hebrev, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_chars_per_line, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_nl2br, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, is_xhtml, _IS_BOOL, 0, "true") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_xhtml, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strip_tags, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_MASK(0, allowable_tags, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_MASK(0, allowed_tags, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_setlocale, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) @@ -1012,35 +1010,32 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_setlocale, 0, 2, MAY_BE_STRING|M ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_parse_str, 0, 2, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, encoded_string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_getcsv, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\",\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\'\\\\\'") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_repeat, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, mult, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, times, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_count_chars, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING) - ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strnatcmp, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, s1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, s2, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_strnatcmp arginfo_strcoll #define arginfo_localeconv arginfo_ob_list_handlers -#define arginfo_strnatcasecmp arginfo_strnatcmp +#define arginfo_strnatcasecmp arginfo_strcoll ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr_count, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) @@ -1050,14 +1045,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr_count, 0, 2, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_pad, 0, 2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, pad_length, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pad_string, IS_STRING, 0, "\" \"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pad_type, IS_LONG, 0, "STR_PAD_RIGHT") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sscanf, 0, 2, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_NULL) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -1067,40 +1062,40 @@ ZEND_END_ARG_INFO() #define arginfo_str_shuffle arginfo_base64_encode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_str_word_count, 0, 1, MAY_BE_ARRAY|MAY_BE_LONG) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, charlist, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, characters, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_str_split, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, split_length, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "1") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strpbrk, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, char_list, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, characters, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_substr_compare, 0, 3, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, main_str, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_substr_compare, 0, 3, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case_insensitivity, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, case_insensitive, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() -#define arginfo_utf8_encode arginfo_bin2hex +#define arginfo_utf8_encode arginfo_base64_encode -#define arginfo_utf8_decode arginfo_bin2hex +#define arginfo_utf8_decode arginfo_base64_encode ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_getdir, 0, 1, Directory, MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -1176,9 +1171,9 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_flock, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, operation, IS_LONG, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, wouldblock, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, would_block, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_meta_tags, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) @@ -1202,11 +1197,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_readfile, 0, 1, MAY_BE_LONG|MAY_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rewind, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rmdir, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, dirname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -1219,16 +1214,16 @@ ZEND_END_ARG_INFO() #define arginfo_feof arginfo_rewind ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgetc, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgets, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fread, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -1242,61 +1237,59 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fscanf, 0, 2, MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_NULL) ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(1, args, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(1, vars, IS_MIXED, 0) ZEND_END_ARG_INFO() -#define arginfo_fpassthru arginfo_pclose +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fpassthru, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftruncate, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fstat, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fseek, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "SEEK_SET") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftell, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() #define arginfo_fflush arginfo_rewind ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fwrite, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) - ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #define arginfo_fputs arginfo_fwrite ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mkdir, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, pathname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0777") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recursive, _IS_BOOL, 0, "false") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rename, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, oldname, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, newname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_copy, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, dest, IS_STRING, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") -ZEND_END_ARG_INFO() +#define arginfo_copy arginfo_rename ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_tempnam, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, dir, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -1314,7 +1307,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_file_get_contents, 0, 1, MAY_BE_ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_include_path, _IS_BOOL, 0, "false") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unlink, 0, 1, _IS_BOOL, 0) @@ -1330,17 +1323,17 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_file_put_contents, 0, 2, MAY_BE_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fputcsv, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, fields, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\",\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgetcsv, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\",\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\",\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enclosure, IS_STRING, 0, "\"\\\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, escape, IS_STRING, 0, "\"\\\\\"") ZEND_END_ARG_INFO() @@ -1381,23 +1374,21 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_filetype, 0, 1, MAY_BE_STRING|MA ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_file_exists, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_file_exists arginfo_is_uploaded_file -#define arginfo_is_writable arginfo_file_exists +#define arginfo_is_writable arginfo_is_uploaded_file -#define arginfo_is_writeable arginfo_file_exists +#define arginfo_is_writeable arginfo_is_uploaded_file -#define arginfo_is_readable arginfo_file_exists +#define arginfo_is_readable arginfo_is_uploaded_file -#define arginfo_is_executable arginfo_file_exists +#define arginfo_is_executable arginfo_is_uploaded_file -#define arginfo_is_file arginfo_file_exists +#define arginfo_is_file arginfo_is_uploaded_file -#define arginfo_is_dir arginfo_file_exists +#define arginfo_is_dir arginfo_is_uploaded_file -#define arginfo_is_link arginfo_file_exists +#define arginfo_is_link arginfo_is_uploaded_file ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stat, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -1437,7 +1428,7 @@ ZEND_END_ARG_INFO() #if HAVE_UTIME ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_touch, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, time, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mtime, IS_LONG, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, atime, IS_LONG, 1, "null") ZEND_END_ARG_INFO() #endif @@ -1461,51 +1452,51 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sprintf, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_printf, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_vprintf, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_vsprintf, 0, 2, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fprintf, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) + ZEND_ARG_VARIADIC_TYPE_INFO(0, values, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_vfprintf, 0, 3, IS_LONG, 0) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "-1") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errno, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errstr, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 1, "null") ZEND_END_ARG_INFO() #define arginfo_pfsockopen arginfo_fsockopen -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_http_build_query, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_http_build_query, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, data, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numeric_prefix, IS_STRING, 0, "\"\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg_separator, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enc_type, IS_LONG, 0, "PHP_QUERY_RFC1738") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding_type, IS_LONG, 0, "PHP_QUERY_RFC1738") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_image_type_to_mime_type, 0, 1, IS_STRING, 0) @@ -1518,17 +1509,17 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_image_type_to_extension, 0, 1, M ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getimagesize, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, image_path, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, image_info, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getimagesizefromstring, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, image_info, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpinfo, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, what, IS_LONG, 0, "INFO_ALL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "INFO_ALL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_phpversion, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) @@ -1536,7 +1527,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_phpversion, 0, 0, MAY_BE_STRING| ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpcredits, 0, 0, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "CREDITS_ALL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "CREDITS_ALL") ZEND_END_ARG_INFO() #define arginfo_php_sapi_name arginfo_ob_get_flush @@ -1550,21 +1541,21 @@ ZEND_END_ARG_INFO() #define arginfo_php_ini_loaded_file arginfo_ob_get_flush ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iptcembed, 0, 2, MAY_BE_STRING|MAY_BE_BOOL) - ZEND_ARG_TYPE_INFO(0, iptcdata, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, jpeg_file_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, iptc_data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, spool, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iptcparse, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, iptcblock, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, iptc_block, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_levenshtein, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, str1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str2, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cost_ins, IS_LONG, 0, "1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cost_rep, IS_LONG, 0, "1") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cost_del, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, insertion_cost, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, repetition_cost, IS_LONG, 0, "1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, deletion_cost, IS_LONG, 0, "1") ZEND_END_ARG_INFO() #if defined(HAVE_SYMLINK) || defined(PHP_WIN32) @@ -1595,27 +1586,27 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mail, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_MASK(0, additional_headers, MAY_BE_ARRAY|MAY_BE_STRING, "[]") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_parameters, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_params, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_abs, 0, 1, MAY_BE_LONG|MAY_BE_DOUBLE) - ZEND_ARG_TYPE_MASK(0, number, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ceil, 0, 1, IS_DOUBLE, 0) - ZEND_ARG_TYPE_MASK(0, number, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) ZEND_END_ARG_INFO() #define arginfo_floor arginfo_ceil ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_round, 0, 1, IS_DOUBLE, 0) - ZEND_ARG_TYPE_MASK(0, number, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) + ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_DOUBLE, NULL) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, precision, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "PHP_ROUND_HALF_UP") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sin, 0, 1, IS_DOUBLE, 0) - ZEND_ARG_TYPE_INFO(0, number, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) ZEND_END_ARG_INFO() #define arginfo_cos arginfo_sin @@ -1652,27 +1643,27 @@ ZEND_END_ARG_INFO() #define arginfo_pi arginfo_lcg_value ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_finite, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, number, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) ZEND_END_ARG_INFO() #define arginfo_is_nan arginfo_is_finite ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intdiv, 0, 2, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, dividend, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, divisor, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, num1, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, num2, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_is_infinite arginfo_is_finite ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pow, 0, 2, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_OBJECT) - ZEND_ARG_TYPE_INFO(0, base, IS_MIXED, 0) - ZEND_ARG_TYPE_INFO(0, exp, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, exponent, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_exp arginfo_sin ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_log, 0, 1, IS_DOUBLE, 0) - ZEND_ARG_TYPE_INFO(0, number, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, base, IS_DOUBLE, 0, "M_E") ZEND_END_ARG_INFO() @@ -1702,7 +1693,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_octdec, 0, 1, MAY_BE_LONG|MAY_BE ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_decbin, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, number, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_decoct arginfo_decbin @@ -1710,51 +1701,48 @@ ZEND_END_ARG_INFO() #define arginfo_dechex arginfo_decbin ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_base_convert, 0, 3, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, number, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, frombase, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, tobase, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, from_base, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, to_base, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_number_format, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, number, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, decimals, IS_LONG, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, decimal_point, IS_STRING, 1, "\".\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, decimal_separator, IS_STRING, 1, "\".\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, thousands_separator, IS_STRING, 1, "\",\"") ZEND_END_ARG_INFO() -#define arginfo_fmod arginfo_hypot - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fdiv, 0, 2, IS_DOUBLE, 0) - ZEND_ARG_TYPE_INFO(0, dividend, IS_DOUBLE, 0) - ZEND_ARG_TYPE_INFO(0, divisor, IS_DOUBLE, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fmod, 0, 2, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num1, IS_DOUBLE, 0) + ZEND_ARG_TYPE_INFO(0, num2, IS_DOUBLE, 0) ZEND_END_ARG_INFO() +#define arginfo_fdiv arginfo_fmod + #if defined(HAVE_GETTIMEOFDAY) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_microtime, 0, 0, MAY_BE_STRING|MAY_BE_DOUBLE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, getAsFloat, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_float, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() #endif #if defined(HAVE_GETTIMEOFDAY) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_gettimeofday, 0, 0, MAY_BE_ARRAY|MAY_BE_DOUBLE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, returnFloat, _IS_BOOL, 0, "false") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_float, _IS_BOOL, 0, "false") ZEND_END_ARG_INFO() #endif #if defined(HAVE_GETRUSAGE) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_getrusage, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, who, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, _IS_BOOL, 0, "0") ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pack, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_VARIADIC_TYPE_INFO(0, args, IS_MIXED, 0) -ZEND_END_ARG_INFO() +#define arginfo_pack arginfo_sprintf ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_unpack, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -1783,12 +1771,12 @@ ZEND_END_ARG_INFO() #if defined(PHP_CAN_SUPPORT_PROC_OPEN) ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3) - ZEND_ARG_TYPE_MASK(0, cmd, MAY_BE_ARRAY|MAY_BE_STRING, NULL) - ZEND_ARG_TYPE_INFO(0, descriptorspec, IS_ARRAY, 0) + ZEND_ARG_TYPE_MASK(0, command, MAY_BE_ARRAY|MAY_BE_STRING, NULL) + ZEND_ARG_TYPE_INFO(0, descriptor_spec, IS_ARRAY, 0) ZEND_ARG_INFO(1, pipes) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cwd, IS_STRING, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, env, IS_ARRAY, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, other_options, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, env_vars, IS_ARRAY, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() #endif @@ -1842,16 +1830,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_random_int, 0, 2, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, max, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_soundex, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_soundex arginfo_base64_encode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1) ZEND_ARG_TYPE_INFO(1, except, IS_ARRAY, 1) - ZEND_ARG_TYPE_INFO(0, tv_sec, IS_LONG, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tv_usec, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 1) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0) @@ -1889,8 +1875,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2) ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, filtername, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, read_write, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO(0, filter_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO(0, params, IS_MIXED, 0) ZEND_END_ARG_INFO() @@ -1901,31 +1887,31 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_filter_remove, 0, 1, _IS_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, remote_socket, IS_STRING, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errno, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errstr, "null") + ZEND_ARG_TYPE_INFO(0, address, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 1, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "STREAM_CLIENT_CONNECT") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, local_socket, IS_STRING, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errno, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, errstr, "null") + ZEND_ARG_TYPE_INFO(0, address, IS_STRING, 0) + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_code, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, error_message, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "STREAM_SERVER_BIND | STREAM_SERVER_LISTEN") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1) - ZEND_ARG_INFO(0, server_socket) + ZEND_ARG_INFO(0, socket) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 1, "null") - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, peername, "null") + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, peer_name, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_get_name, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) - ZEND_ARG_TYPE_INFO(0, want_peer, _IS_BOOL, 0) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_TYPE_INFO(0, remote, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_socket_recvfrom, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) @@ -1952,7 +1938,7 @@ ZEND_END_ARG_INFO() #if defined(HAVE_SHUTDOWN) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_socket_shutdown, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, how, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) ZEND_END_ARG_INFO() #endif @@ -1965,25 +1951,23 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_copy_to_stream, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) - ZEND_ARG_INFO(0, source) - ZEND_ARG_INFO(0, dest) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlength, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, position, IS_LONG, 0, "0") + ZEND_ARG_INFO(0, from) + ZEND_ARG_INFO(0, to) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_get_contents, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlength, IS_LONG, 1, "null") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, position, IS_LONG, 0, "-1") -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_supports_lock, 0, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, stream) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_length, IS_LONG, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() +#define arginfo_stream_supports_lock arginfo_rewind + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_write_buffer, 0, 2, IS_LONG, 0) ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, buffer, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) ZEND_END_ARG_INFO() #define arginfo_set_file_buffer arginfo_stream_set_write_buffer @@ -1992,7 +1976,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_blocking, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, mode, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0) ZEND_END_ARG_INFO() #define arginfo_socket_set_blocking arginfo_stream_set_blocking @@ -2004,20 +1988,20 @@ ZEND_END_ARG_INFO() #define arginfo_socket_get_status arginfo_stream_get_meta_data ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_get_line, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, max_length, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ending, IS_STRING, 0, "\"\"") ZEND_END_ARG_INFO() #define arginfo_stream_resolve_include_path arginfo_filetype -#define arginfo_stream_get_wrappers arginfo_net_get_interfaces +#define arginfo_stream_get_wrappers arginfo_ob_list_handlers -#define arginfo_stream_get_transports arginfo_net_get_interfaces +#define arginfo_stream_get_transports arginfo_ob_list_handlers -#define arginfo_stream_is_local arginfo_stream_supports_lock +#define arginfo_stream_is_local arginfo_rewind -#define arginfo_stream_isatty arginfo_stream_supports_lock +#define arginfo_stream_isatty arginfo_rewind #if defined(PHP_WIN32) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_vt100_support, 0, 1, _IS_BOOL, 0) @@ -2026,14 +2010,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_vt100_support, 0, 1 ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_chunk_size, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) -ZEND_END_ARG_INFO() +#define arginfo_stream_set_chunk_size arginfo_stream_set_write_buffer #if HAVE_SYS_TIME_H || defined(PHP_WIN32) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_set_timeout, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -2044,7 +2025,7 @@ ZEND_END_ARG_INFO() #endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gettype, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, var, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() #define arginfo_get_debug_type arginfo_gettype @@ -2069,9 +2050,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_boolval, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strval, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) -ZEND_END_ARG_INFO() +#define arginfo_strval arginfo_gettype #define arginfo_is_null arginfo_boolval @@ -2121,19 +2100,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, component, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_urlencode, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_urlencode arginfo_base64_encode -#define arginfo_urldecode arginfo_urlencode +#define arginfo_urldecode arginfo_base64_encode -#define arginfo_rawurlencode arginfo_urlencode +#define arginfo_rawurlencode arginfo_base64_encode -#define arginfo_rawurldecode arginfo_urlencode +#define arginfo_rawurldecode arginfo_base64_encode ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_headers, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, format, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, as_assoc_array, IS_LONG, 0, "0") ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, context, "null") ZEND_END_ARG_INFO() @@ -2148,7 +2125,7 @@ ZEND_END_ARG_INFO() #define arginfo_stream_bucket_append arginfo_stream_bucket_prepend -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stream_bucket_new, 0, 2, MAY_BE_OBJECT|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_bucket_new, 0, 2, IS_OBJECT, 0) ZEND_ARG_INFO(0, stream) ZEND_ARG_TYPE_INFO(0, buffer, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -2156,11 +2133,11 @@ ZEND_END_ARG_INFO() #define arginfo_stream_get_filters arginfo_ob_list_handlers ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stream_filter_register, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, filtername, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, classname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, filter_name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, class, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_convert_uuencode arginfo_hex2bin +#define arginfo_convert_uuencode arginfo_base64_encode #define arginfo_convert_uudecode arginfo_hex2bin @@ -2176,7 +2153,7 @@ ZEND_END_ARG_INFO() #define arginfo_debug_zval_dump arginfo_var_dump -#define arginfo_serialize arginfo_strval +#define arginfo_serialize arginfo_gettype ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unserialize, 0, 1, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) @@ -2197,7 +2174,7 @@ ZEND_END_ARG_INFO() #if defined(PHP_WIN32) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_cp_set, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, cp, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, codepage, IS_LONG, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 98bff12fc2bc3..c1c264d1f0a8b 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -59,30 +59,32 @@ php_dir_globals dir_globals; static zend_class_entry *dir_class_entry_ptr; #define FETCH_DIRP() \ - ZEND_PARSE_PARAMETERS_START(0, 1) \ - Z_PARAM_OPTIONAL \ - Z_PARAM_RESOURCE_OR_NULL(id) \ - ZEND_PARSE_PARAMETERS_END(); \ - if (!id) { \ - myself = getThis(); \ - if (myself) { \ - if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \ - zend_throw_error(NULL, "Unable to find my handle property"); \ - RETURN_THROWS(); \ - } \ - if ((dirp = (php_stream *)zend_fetch_resource_ex(tmp, "Directory", php_file_le_stream())) == NULL) { \ + myself = getThis(); \ + if (!myself) { \ + ZEND_PARSE_PARAMETERS_START(0, 1) \ + Z_PARAM_OPTIONAL \ + Z_PARAM_RESOURCE_OR_NULL(id) \ + ZEND_PARSE_PARAMETERS_END(); \ + if (id) { \ + if ((dirp = (php_stream *)zend_fetch_resource(Z_RES_P(id), "Directory", php_file_le_stream())) == NULL) { \ RETURN_THROWS(); \ } \ } else { \ if (!DIRG(default_dir)) { \ zend_type_error("No resource supplied"); \ RETURN_THROWS(); \ - } else if ((dirp = (php_stream *)zend_fetch_resource(DIRG(default_dir), "Directory", php_file_le_stream())) == NULL) { \ + } \ + if ((dirp = (php_stream *)zend_fetch_resource(DIRG(default_dir), "Directory", php_file_le_stream())) == NULL) { \ RETURN_THROWS(); \ } \ } \ } else { \ - if ((dirp = (php_stream *)zend_fetch_resource(Z_RES_P(id), "Directory", php_file_le_stream())) == NULL) { \ + ZEND_PARSE_PARAMETERS_NONE(); \ + if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \ + zend_throw_error(NULL, "Unable to find my handle property"); \ + RETURN_THROWS(); \ + } \ + if ((dirp = (php_stream *)zend_fetch_resource_ex(tmp, "Directory", php_file_le_stream())) == NULL) { \ RETURN_THROWS(); \ } \ } diff --git a/ext/standard/dir.stub.php b/ext/standard/dir.stub.php index 86d08c1e1de3e..9904c6bc992d6 100755 --- a/ext/standard/dir.stub.php +++ b/ext/standard/dir.stub.php @@ -5,23 +5,20 @@ class Directory { /** - * @param resource|null $dir_handle * @return void - * @alias closedir + * @implementation-alias closedir */ - public function close($dir_handle = null) {} + public function close() {} /** - * @param resource|null $dir_handle * @return void - * @alias rewinddir + * @implementation-alias rewinddir */ - public function rewind($dir_handle = null) {} + public function rewind() {} /** - * @param resource|null $dir_handle * @return string|false - * @alias readdir + * @implementation-alias readdir */ - public function read($dir_handle = null) {} + public function read() {} } diff --git a/ext/standard/dir_arginfo.h b/ext/standard/dir_arginfo.h index 67a22b7249319..a2fa03611cab8 100644 --- a/ext/standard/dir_arginfo.h +++ b/ext/standard/dir_arginfo.h @@ -1,8 +1,7 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2670287ef059725cceda0a8f9ac6515cdcedb521 */ + * Stub hash: a715bf6a8d5fe69732623cc17f03bd463f369648 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Directory_close, 0, 0, 0) - ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, dir_handle, "null") ZEND_END_ARG_INFO() #define arginfo_class_Directory_rewind arginfo_class_Directory_close diff --git a/ext/standard/dl.c b/ext/standard/dl.c index b7e3b3bfeb8ad..c1e9fabf404d6 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -161,19 +161,17 @@ PHPAPI int php_load_extension(const char *filename, int type, int start_now) efree(orig_libpath); efree(err1); } + efree(libpath); #ifdef PHP_WIN32 - if (!php_win32_image_compatible(libpath, &err1)) { + if (!php_win32_image_compatible(handle, &err1)) { php_error_docref(NULL, error_type, err1); efree(err1); - efree(libpath); DL_UNLOAD(handle); return FAILURE; } #endif - efree(libpath); - get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, "get_module"); /* Some OS prepend _ to symbol names while their dynamic linker diff --git a/ext/standard/file.c b/ext/standard/file.c index 224e69ffdd553..c9cf1d29b064d 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -333,7 +333,7 @@ PHPAPI void php_flock_common(php_stream *stream, zend_long operation, act = operation & PHP_LOCK_UN; if (act < 1 || act > 3) { - zend_argument_value_error(operation_arg_num, "must be either LOCK_SH, LOCK_EX, or LOCK_UN"); + zend_argument_value_error(operation_arg_num, "must be one of LOCK_SH, LOCK_EX, or LOCK_UN"); RETURN_THROWS(); } @@ -387,7 +387,7 @@ PHP_FUNCTION(get_meta_tags) php_meta_tags_token tok, tok_last; php_meta_tags_data md; - /* Initiailize our structure */ + /* Initialize our structure */ memset(&md, 0, sizeof(md)); /* Parse arguments */ @@ -1815,11 +1815,9 @@ PHP_FUNCTION(fputcsv) if (delimiter_str != NULL) { /* Make sure that there is at least one character in string */ - if (delimiter_str_len < 1) { + if (delimiter_str_len != 1) { zend_argument_value_error(3, "must be a single character"); RETURN_THROWS(); - } else if (delimiter_str_len > 1) { - php_error_docref(NULL, E_WARNING, "Argument #3 ($delimiter) must be a single character"); } /* use first character from string */ @@ -1827,11 +1825,9 @@ PHP_FUNCTION(fputcsv) } if (enclosure_str != NULL) { - if (enclosure_str_len < 1) { + if (enclosure_str_len != 1) { zend_argument_value_error(4, "must be a single character"); RETURN_THROWS(); - } else if (enclosure_str_len > 1) { - php_error_docref(NULL, E_WARNING, "Argument #4 ($enclosure) must be a single character"); } /* use first character from string */ enclosure = *enclosure_str; @@ -1839,7 +1835,8 @@ PHP_FUNCTION(fputcsv) if (escape_str != NULL) { if (escape_str_len > 1) { - php_error_docref(NULL, E_WARNING, "Argument #5 ($escape) must be empty or a single character"); + zend_argument_value_error(5, "must be empty or a single character"); + RETURN_THROWS(); } if (escape_str_len < 1) { escape_char = PHP_CSV_NO_ESCAPE; @@ -1953,11 +1950,9 @@ PHP_FUNCTION(fgetcsv) if (delimiter_str != NULL) { /* Make sure that there is at least one character in string */ - if (delimiter_str_len < 1) { + if (delimiter_str_len != 1) { zend_argument_value_error(3, "must be a single character"); RETURN_THROWS(); - } else if (delimiter_str_len > 1) { - php_error_docref(NULL, E_WARNING, "Argument #3 ($delimiter) must be a single character"); } /* use first character from string */ @@ -1965,11 +1960,9 @@ PHP_FUNCTION(fgetcsv) } if (enclosure_str != NULL) { - if (enclosure_str_len < 1) { + if (enclosure_str_len != 1) { zend_argument_value_error(4, "must be a single character"); RETURN_THROWS(); - } else if (enclosure_str_len > 1) { - php_error_docref(NULL, E_WARNING, "Argument #4 ($enclosure) must be a single character"); } /* use first character from string */ @@ -1978,7 +1971,8 @@ PHP_FUNCTION(fgetcsv) if (escape_str != NULL) { if (escape_str_len > 1) { - php_error_docref(NULL, E_WARNING, "Argument #5 ($enclosure) must be empty or a single character"); + zend_argument_value_error(5, "must be empty or a single character"); + RETURN_THROWS(); } if (escape_str_len < 1) { diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 3e431c744d63f..61546c3da6368 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -59,11 +59,7 @@ #endif #if HAVE_GRP_H -# ifdef PHP_WIN32 -# include "win32/grp.h" -# else -# include -# endif +# include #endif #if HAVE_UTIME diff --git a/ext/standard/html.c b/ext/standard/html.c index 463e55c255cb8..c949e058c1a2c 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1377,10 +1377,7 @@ PHP_FUNCTION(htmlspecialchars_decode) ZEND_PARSE_PARAMETERS_END(); replaced = php_unescape_html_entities(str, 0 /*!all*/, (int)quote_style, NULL); - if (replaced) { - RETURN_STR(replaced); - } - RETURN_FALSE; + RETURN_STR(replaced); } /* }}} */ @@ -1400,11 +1397,7 @@ PHP_FUNCTION(html_entity_decode) replaced = php_unescape_html_entities( str, 1 /*all*/, (int)quote_style, hint_charset ? ZSTR_VAL(hint_charset) : NULL); - - if (replaced) { - RETURN_STR(replaced); - } - RETURN_FALSE; + RETURN_STR(replaced); } /* }}} */ diff --git a/ext/standard/http.c b/ext/standard/http.c index 804940fd1a63e..18b7c6070bb03 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -21,7 +21,7 @@ #define URL_DEFAULT_ARG_SEP "&" /* {{{ php_url_encode_hash */ -PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, +PHPAPI void php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, size_t num_prefix_len, const char *key_prefix, size_t key_prefix_len, const char *key_suffix, size_t key_suffix_len, @@ -33,14 +33,11 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, size_t arg_sep_len, newprefix_len, prop_len; zend_ulong idx; zval *zdata = NULL; - - if (!ht) { - return FAILURE; - } + ZEND_ASSERT(ht); if (GC_IS_RECURSIVE(ht)) { /* Prevent recursion */ - return SUCCESS; + return; } if (!arg_sep) { @@ -219,8 +216,6 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, } } } ZEND_HASH_FOREACH_END(); - - return SUCCESS; } /* }}} */ @@ -241,12 +236,7 @@ PHP_FUNCTION(http_build_query) Z_PARAM_LONG(enc_type) ZEND_PARSE_PARAMETERS_END(); - if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type) == FAILURE) { - if (formstr.s) { - smart_str_free(&formstr); - } - RETURN_FALSE; - } + php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type); if (!formstr.s) { RETURN_EMPTY_STRING(); diff --git a/ext/standard/link.c b/ext/standard/link.c index 002f9576eb6cb..86ad6707c3755 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -40,11 +40,7 @@ #endif #endif #if HAVE_GRP_H -#ifdef PHP_WIN32 -#include "win32/grp.h" -#else -#include -#endif +# include #endif #include #include diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 1665caddceb48..573bf9a4b0d0f 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -20,7 +20,7 @@ #include "php.h" -static int metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional); +static void metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional); /* {{{ Break english phrases down into their phonemes */ PHP_FUNCTION(metaphone) @@ -35,14 +35,13 @@ PHP_FUNCTION(metaphone) Z_PARAM_LONG(phones) ZEND_PARSE_PARAMETERS_END(); - if (metaphone((unsigned char *)ZSTR_VAL(str), ZSTR_LEN(str), phones, &result, 1) == 0) { - RETVAL_STR(result); - } else { - if (result) { - zend_string_free(result); - } - RETURN_FALSE; + if (phones < 0) { + zend_argument_value_error(2, "must be greater than or equal to 0"); + RETURN_THROWS(); } + + metaphone((unsigned char *)ZSTR_VAL(str), ZSTR_LEN(str), phones, &result, 1); + RETVAL_STR(result); } /* }}} */ @@ -145,7 +144,7 @@ static char Lookahead(char *word, int how_far) ZSTR_LEN(*phoned_word) = p_idx; \ } /* Slap a null character on the end of the phoned word */ -#define End_Phoned_Word { \ +#define End_Phoned_Word() { \ if (p_idx == max_buffer_len) { \ *phoned_word = zend_string_extend(*phoned_word, 1 * sizeof(char) + max_buffer_len, 0); \ max_buffer_len += 1; \ @@ -160,24 +159,13 @@ static char Lookahead(char *word, int how_far) #define Isbreak(c) (!isalpha(c)) /* {{{ metaphone */ -static int metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional) +static void metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional) { int w_idx = 0; /* point in the phonization we're at. */ size_t p_idx = 0; /* end of the phoned phrase */ size_t max_buffer_len = 0; /* maximum length of the destination buffer */ - -/*-- Parameter checks --*/ - /* Negative phoneme length is meaningless */ - - if (max_phonemes < 0) - return -1; - - /* Empty/null string is meaningless */ - /* Overly paranoid */ - /* assert(word != NULL && word[0] != '\0'); */ - - if (word == NULL) - return -1; + ZEND_ASSERT(word != NULL); + ZEND_ASSERT(max_phonemes >= 0); /*-- Allocate memory for our phoned_phrase --*/ if (max_phonemes == 0) { /* Assume largest possible */ @@ -194,8 +182,8 @@ static int metaphone(unsigned char *word, size_t word_len, zend_long max_phoneme for (; !isalpha(Curr_Letter); w_idx++) { /* On the off chance we were given nothing but crap... */ if (Curr_Letter == '\0') { - End_Phoned_Word - return SUCCESS; /* For testing */ + End_Phoned_Word(); + return; } } @@ -460,8 +448,6 @@ static int metaphone(unsigned char *word, size_t word_len, zend_long max_phoneme w_idx += skip_letter; } /* END FOR */ - End_Phoned_Word; - - return 0; + End_Phoned_Word(); } /* END metaphone */ /* }}} */ diff --git a/ext/standard/net.c b/ext/standard/net.c index 424dad44f4263..2700c7b24390b 100644 --- a/ext/standard/net.c +++ b/ext/standard/net.c @@ -301,7 +301,7 @@ PHP_FUNCTION(net_get_interfaces) { freeifaddrs(addrs); #else /* Should never happen as we never register the function */ - ZEND_UNREACHABLE("No support for net_get_interfaces"); + ZEND_UNREACHABLE(); #endif } /* }}} */ diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 013173dc7386a..e14bbbcedbd8e 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -47,8 +47,8 @@ if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \ efree(formatcodes); \ efree(formatargs); \ - php_error_docref(NULL, E_WARNING, "Type %c: integer overflow in format string", code); \ - RETURN_FALSE; \ + zend_value_error("Type %c: integer overflow in format string", code); \ + RETURN_THROWS(); \ } \ outputpos += (a)*(b); @@ -282,8 +282,8 @@ PHP_FUNCTION(pack) if (currentarg >= num_args) { efree(formatcodes); efree(formatargs); - php_error_docref(NULL, E_WARNING, "Type %c: not enough arguments", code); - RETURN_FALSE; + zend_value_error("Type %c: not enough arguments", code); + RETURN_THROWS(); } if (arg < 0) { @@ -313,8 +313,8 @@ PHP_FUNCTION(pack) #if SIZEOF_ZEND_LONG < 8 efree(formatcodes); efree(formatargs); - php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); - RETURN_FALSE; + zend_value_error("64-bit format codes are not available for 32-bit versions of PHP"); + RETURN_THROWS(); #endif case 'c': case 'C': @@ -346,16 +346,16 @@ PHP_FUNCTION(pack) too_few_args: efree(formatcodes); efree(formatargs); - php_error_docref(NULL, E_WARNING, "Type %c: too few arguments", code); - RETURN_FALSE; + zend_value_error("Type %c: too few arguments", code); + RETURN_THROWS(); } break; default: efree(formatcodes); efree(formatargs); - php_error_docref(NULL, E_WARNING, "Type %c: unknown format code", code); - RETURN_FALSE; + zend_value_error("Type %c: unknown format code", code); + RETURN_THROWS(); } formatcodes[formatcount] = code; @@ -731,9 +731,10 @@ PHP_FUNCTION(unpack) if (offset < 0 || offset > inputlen) { - php_error_docref(NULL, E_WARNING, "Offset " ZEND_LONG_FMT " is out of input range" , offset); - RETURN_FALSE; + zend_argument_value_error(3, "must be contained in argument #2 ($data)"); + RETURN_THROWS(); } + input += offset; inputlen -= offset; @@ -844,9 +845,8 @@ PHP_FUNCTION(unpack) size = 8; break; #else - php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); - zend_array_destroy(Z_ARR_P(return_value)); - RETURN_FALSE; + zend_value_error("64-bit format codes are not available for 32-bit versions of PHP"); + RETURN_THROWS(); #endif /* Use sizeof(float) bytes of input */ @@ -864,10 +864,8 @@ PHP_FUNCTION(unpack) break; default: - php_error_docref(NULL, E_WARNING, "Invalid format type %c", type); - zend_array_destroy(Z_ARR_P(return_value)); - RETURN_FALSE; - break; + zend_value_error("Invalid format type %c", type); + RETURN_THROWS(); } if (size != 0 && size != -1 && size < 0) { diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 56e5462f3c84c..798f7cdbb3d08 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -28,11 +28,7 @@ #endif #endif #if HAVE_GRP_H -# ifdef PHP_WIN32 -# include "win32/grp.h" -# else -# include -# endif +# include #endif #ifdef PHP_WIN32 #undef getgid diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index b77cd0bda38bf..1df941ee00949 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -20,7 +20,7 @@ #include "php.h" #include "zend_smart_str.h" -PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, +PHPAPI void php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, size_t num_prefix_len, const char *key_prefix, size_t key_prefix_len, const char *key_suffix, size_t key_suffix_len, diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index 5342139f98d00..db57c1ef6991a 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -60,10 +60,6 @@ PHP_FUNCTION(soundex) Z_PARAM_STRING(str, str_len) ZEND_PARSE_PARAMETERS_END(); - if (str_len == 0) { - RETURN_FALSE; - } - /* build soundex string */ last = -1; for (i = 0, _small = 0; i < str_len && _small < 4; i++) { diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 8e4c4ff2611a6..1600b99794335 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -573,14 +573,11 @@ PHP_FUNCTION(stream_get_transports) ZEND_PARSE_PARAMETERS_NONE(); - if ((stream_xport_hash = php_stream_xport_get_hash())) { - array_init(return_value); - ZEND_HASH_FOREACH_STR_KEY(stream_xport_hash, stream_xport) { - add_next_index_str(return_value, zend_string_copy(stream_xport)); - } ZEND_HASH_FOREACH_END(); - } else { - RETURN_FALSE; - } + stream_xport_hash = php_stream_xport_get_hash(); + array_init(return_value); + ZEND_HASH_FOREACH_STR_KEY(stream_xport_hash, stream_xport) { + add_next_index_str(return_value, zend_string_copy(stream_xport)); + } ZEND_HASH_FOREACH_END(); } /* }}} */ @@ -592,16 +589,13 @@ PHP_FUNCTION(stream_get_wrappers) ZEND_PARSE_PARAMETERS_NONE(); - if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) { - array_init(return_value); - ZEND_HASH_FOREACH_STR_KEY(url_stream_wrappers_hash, stream_protocol) { - if (stream_protocol) { - add_next_index_str(return_value, zend_string_copy(stream_protocol)); - } - } ZEND_HASH_FOREACH_END(); - } else { - RETURN_FALSE; - } + url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash(); + array_init(return_value); + ZEND_HASH_FOREACH_STR_KEY(url_stream_wrappers_hash, stream_protocol) { + if (stream_protocol) { + add_next_index_str(return_value, zend_string_copy(stream_protocol)); + } + } ZEND_HASH_FOREACH_END(); } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index 7e6f05ad71c7c..06222303bd37c 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -258,33 +258,28 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) / Z_PARAM_LONG_OR_NULL(len, len_is_null) ZEND_PARSE_PARAMETERS_END(); - if (len_is_null) { - len = ZSTR_LEN(s11); - } - - /* look at substr() function for more information */ - if (start < 0) { start += (zend_long)ZSTR_LEN(s11); - if (start < 0) { - start = 0; - } - } else if ((size_t)start > ZSTR_LEN(s11)) { - RETURN_FALSE; + } + if (start < 0 || (size_t)start > ZSTR_LEN(s11)) { + zend_argument_value_error(3, "must be contained in argument #1 ($str)"); + RETURN_THROWS(); } - if (len < 0) { - len += (ZSTR_LEN(s11) - start); + size_t remain_len = ZSTR_LEN(s11) - start; + if (!len_is_null) { if (len < 0) { - len = 0; + len += remain_len; } + if (len < 0 || (size_t)len > remain_len) { + zend_argument_value_error(4, "must be contained in argument #1 ($str)"); + RETURN_THROWS(); + } + } else { + len = remain_len; } - if (len > (zend_long)ZSTR_LEN(s11) - start) { - len = ZSTR_LEN(s11) - start; - } - - if(len == 0) { + if (len == 0) { RETURN_LONG(0); } @@ -293,13 +288,13 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) / ZSTR_VAL(s22) /*str2_start*/, ZSTR_VAL(s11) + start + len /*str1_end*/, ZSTR_VAL(s22) + ZSTR_LEN(s22) /*str2_end*/)); - } else if (behavior == STR_STRCSPN) { + } else { + ZEND_ASSERT(behavior == STR_STRCSPN); RETURN_LONG(php_strcspn(ZSTR_VAL(s11) + start /*str1_start*/, ZSTR_VAL(s22) /*str2_start*/, ZSTR_VAL(s11) + start + len /*str1_end*/, ZSTR_VAL(s22) + ZSTR_LEN(s22) /*str2_end*/)); } - } /* }}} */ @@ -2175,9 +2170,7 @@ PHP_FUNCTION(substr) Z_PARAM_LONG_OR_NULL(l, len_is_null) ZEND_PARSE_PARAMETERS_END(); - if (f > (zend_long)ZSTR_LEN(str)) { - RETURN_FALSE; - } else if (f < 0) { + if (f < 0) { /* if "from" position is negative, count start position from the end * of the string */ @@ -2186,41 +2179,24 @@ PHP_FUNCTION(substr) } else { f = (zend_long)ZSTR_LEN(str) + f; } - if (!len_is_null) { - if (l < 0) { - /* if "length" position is negative, set it to the length - * needed to stop that many chars from the end of the string - */ - if ((size_t)(-l) > ZSTR_LEN(str) - (size_t)f) { - if ((size_t)(-l) > ZSTR_LEN(str)) { - RETURN_FALSE; - } else { - l = 0; - } - } else { - l = (zend_long)ZSTR_LEN(str) - f + l; - } - } else if ((size_t)l > ZSTR_LEN(str) - (size_t)f) { - goto truncate_len; - } - } else { - goto truncate_len; - } - } else if (!len_is_null) { + } else if ((size_t)f > ZSTR_LEN(str)) { + RETURN_EMPTY_STRING(); + } + + if (!len_is_null) { if (l < 0) { /* if "length" position is negative, set it to the length * needed to stop that many chars from the end of the string */ if ((size_t)(-l) > ZSTR_LEN(str) - (size_t)f) { - RETURN_FALSE; + l = 0; } else { l = (zend_long)ZSTR_LEN(str) - f + l; } } else if ((size_t)l > ZSTR_LEN(str) - (size_t)f) { - goto truncate_len; + l = (zend_long)ZSTR_LEN(str) - f; } } else { -truncate_len: l = (zend_long)ZSTR_LEN(str) - f; } @@ -2265,87 +2241,87 @@ PHP_FUNCTION(substr_replace) } if (str) { - if ((len_is_null && from_ht) || (!len_is_null && (from_ht == NULL) != (len_ht == NULL))) { - php_error_docref(NULL, E_WARNING, "'start' and 'length' should be of same type - numerical or array "); - RETURN_STR_COPY(str); + if (from_ht) { + zend_argument_type_error(3, "cannot be an array when working on a single string"); + RETURN_THROWS(); } - if (!len_is_null && from_ht) { - if (zend_hash_num_elements(from_ht) != zend_hash_num_elements(len_ht)) { - php_error_docref(NULL, E_WARNING, "'start' and 'length' should have the same number of elements"); - RETURN_STR_COPY(str); - } + if (len_ht) { + zend_argument_type_error(4, "cannot be an array when working on a single string"); + RETURN_THROWS(); } - } - if (str) { - if (!from_ht) { - f = from_long; + f = from_long; - /* if "from" position is negative, count start position from the end - * of the string - */ + /* if "from" position is negative, count start position from the end + * of the string + */ + if (f < 0) { + f = (zend_long)ZSTR_LEN(str) + f; if (f < 0) { - f = (zend_long)ZSTR_LEN(str) + f; - if (f < 0) { - f = 0; - } - } else if ((size_t)f > ZSTR_LEN(str)) { - f = ZSTR_LEN(str); + f = 0; } - /* if "length" position is negative, set it to the length - * needed to stop that many chars from the end of the string - */ + } else if ((size_t)f > ZSTR_LEN(str)) { + f = ZSTR_LEN(str); + } + /* if "length" position is negative, set it to the length + * needed to stop that many chars from the end of the string + */ + if (l < 0) { + l = ((zend_long)ZSTR_LEN(str) - f) + l; if (l < 0) { - l = ((zend_long)ZSTR_LEN(str) - f) + l; - if (l < 0) { - l = 0; - } + l = 0; } + } - if ((size_t)l > ZSTR_LEN(str) || (l < 0 && (size_t)(-l) > ZSTR_LEN(str))) { - l = ZSTR_LEN(str); - } + if ((size_t)l > ZSTR_LEN(str) || (l < 0 && (size_t)(-l) > ZSTR_LEN(str))) { + l = ZSTR_LEN(str); + } - if ((f + l) > (zend_long)ZSTR_LEN(str)) { - l = ZSTR_LEN(str) - f; - } + if ((f + l) > (zend_long)ZSTR_LEN(str)) { + l = ZSTR_LEN(str) - f; + } - zend_string *tmp_repl_str = NULL; - if (repl_ht) { - repl_idx = 0; - while (repl_idx < repl_ht->nNumUsed) { - tmp_repl = &repl_ht->arData[repl_idx].val; - if (Z_TYPE_P(tmp_repl) != IS_UNDEF) { - break; - } - repl_idx++; - } - if (repl_idx < repl_ht->nNumUsed) { - repl_str = zval_get_tmp_string(tmp_repl, &tmp_repl_str); - } else { - repl_str = STR_EMPTY_ALLOC(); + zend_string *tmp_repl_str = NULL; + if (repl_ht) { + repl_idx = 0; + while (repl_idx < repl_ht->nNumUsed) { + tmp_repl = &repl_ht->arData[repl_idx].val; + if (Z_TYPE_P(tmp_repl) != IS_UNDEF) { + break; } + repl_idx++; + } + if (repl_idx < repl_ht->nNumUsed) { + repl_str = zval_get_tmp_string(tmp_repl, &tmp_repl_str); + } else { + repl_str = STR_EMPTY_ALLOC(); } + } - result = zend_string_safe_alloc(1, ZSTR_LEN(str) - l + ZSTR_LEN(repl_str), 0, 0); + result = zend_string_safe_alloc(1, ZSTR_LEN(str) - l + ZSTR_LEN(repl_str), 0, 0); - memcpy(ZSTR_VAL(result), ZSTR_VAL(str), f); - if (ZSTR_LEN(repl_str)) { - memcpy((ZSTR_VAL(result) + f), ZSTR_VAL(repl_str), ZSTR_LEN(repl_str)); - } - memcpy((ZSTR_VAL(result) + f + ZSTR_LEN(repl_str)), ZSTR_VAL(str) + f + l, ZSTR_LEN(str) - f - l); - ZSTR_VAL(result)[ZSTR_LEN(result)] = '\0'; - zend_tmp_string_release(tmp_repl_str); - RETURN_NEW_STR(result); - } else { - php_error_docref(NULL, E_WARNING, "Functionality of 'start' and 'length' as arrays is not implemented"); - RETURN_STR_COPY(str); + memcpy(ZSTR_VAL(result), ZSTR_VAL(str), f); + if (ZSTR_LEN(repl_str)) { + memcpy((ZSTR_VAL(result) + f), ZSTR_VAL(repl_str), ZSTR_LEN(repl_str)); } + memcpy((ZSTR_VAL(result) + f + ZSTR_LEN(repl_str)), ZSTR_VAL(str) + f + l, ZSTR_LEN(str) - f - l); + ZSTR_VAL(result)[ZSTR_LEN(result)] = '\0'; + zend_tmp_string_release(tmp_repl_str); + RETURN_NEW_STR(result); } else { /* str is array of strings */ zend_string *str_index = NULL; size_t result_len; zend_ulong num_index; + /* TODO + if (!len_is_null && from_ht) { + if (zend_hash_num_elements(from_ht) != zend_hash_num_elements(len_ht)) { + php_error_docref(NULL, E_WARNING, "'start' and 'length' should have the same number of elements"); + RETURN_STR_COPY(str); + } + } + */ + array_init(return_value); from_idx = len_idx = repl_idx = 0; diff --git a/ext/standard/tests/array/array_chunk2.phpt b/ext/standard/tests/array/array_chunk2.phpt index f3846a1d7806d..c83f051a271de 100644 --- a/ext/standard/tests/array/array_chunk2.phpt +++ b/ext/standard/tests/array/array_chunk2.phpt @@ -24,8 +24,8 @@ var_dump(array_chunk($input_array, 10)); var_dump(array_chunk($input_array, 10, true)); ?> --EXPECT-- -array_chunk(): Argument #2 ($size) must be greater than 0 -array_chunk(): Argument #2 ($size) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 array(5) { [0]=> array(1) { diff --git a/ext/standard/tests/array/array_chunk_variation5.phpt b/ext/standard/tests/array/array_chunk_variation5.phpt index 4aa4ea1172358..24123b03707a4 100644 --- a/ext/standard/tests/array/array_chunk_variation5.phpt +++ b/ext/standard/tests/array/array_chunk_variation5.phpt @@ -42,9 +42,9 @@ foreach ($sizes as $size){ *** Testing array_chunk() : usage variations *** -- Testing array_chunk() when size = -1 -- -array_chunk(): Argument #2 ($size) must be greater than 0 -array_chunk(): Argument #2 ($size) must be greater than 0 -array_chunk(): Argument #2 ($size) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 -- Testing array_chunk() when size = 4 -- array(1) { @@ -82,9 +82,9 @@ array(1) { } -- Testing array_chunk() when size = 0 -- -array_chunk(): Argument #2 ($size) must be greater than 0 -array_chunk(): Argument #2 ($size) must be greater than 0 -array_chunk(): Argument #2 ($size) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 +array_chunk(): Argument #2 ($length) must be greater than 0 -- Testing array_chunk() when size = 1.5 -- array(3) { diff --git a/ext/standard/tests/array/array_multisort_variation1.phpt b/ext/standard/tests/array/array_multisort_variation1.phpt index f93ad2cfc7df9..c6cb286231e49 100644 --- a/ext/standard/tests/array/array_multisort_variation1.phpt +++ b/ext/standard/tests/array/array_multisort_variation1.phpt @@ -103,76 +103,76 @@ foreach($inputs as $key =>$value) { *** Testing array_multisort() : usage variation *** --int 0-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag that has not already been specified +array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified --int 1-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag that has not already been specified +array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified --int 12345-- -array_multisort(): Argument #1 ($array1) must be a valid sort flag +array_multisort(): Argument #1 ($array) must be a valid sort flag --int -12345-- -array_multisort(): Argument #1 ($array1) must be a valid sort flag +array_multisort(): Argument #1 ($array) must be a valid sort flag --float 10.5-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --float .5-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase NULL-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --string DQ-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --string SQ-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --heredoc-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --undefined var-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag --unset var-- -array_multisort(): Argument #1 ($array1) must be an array or a sort flag +array_multisort(): Argument #1 ($array) must be an array or a sort flag diff --git a/ext/standard/tests/array/array_multisort_variation9.phpt b/ext/standard/tests/array/array_multisort_variation9.phpt index 0451daca330d7..d7203c335b7ae 100644 --- a/ext/standard/tests/array/array_multisort_variation9.phpt +++ b/ext/standard/tests/array/array_multisort_variation9.phpt @@ -33,13 +33,13 @@ var_dump($inputs); --EXPECTF-- *** Testing array_multisort() : usage variation - test sort order of all types*** -Notice: Object of class classWithToString could not be converted to float in %sarray_multisort_variation9.php on line %d +Warning: Object of class classWithToString could not be converted to float in %s on line %d -Notice: Object of class classWithToString could not be converted to float in %sarray_multisort_variation9.php on line %d +Warning: Object of class classWithToString could not be converted to float in %s on line %d -Notice: Object of class classWithoutToString could not be converted to float in %sarray_multisort_variation9.php on line %d +Warning: Object of class classWithoutToString could not be converted to float in %s on line %d -Notice: Object of class classWithoutToString could not be converted to float in %sarray_multisort_variation9.php on line %d +Warning: Object of class classWithoutToString could not be converted to float in %s on line %d bool(true) array(10) { ["float -10.5"]=> diff --git a/ext/standard/tests/array/array_next_error2.phpt b/ext/standard/tests/array/array_next_error2.phpt index e9df624e0e3e4..ca4626558edda 100644 --- a/ext/standard/tests/array/array_next_error2.phpt +++ b/ext/standard/tests/array/array_next_error2.phpt @@ -8,7 +8,7 @@ function f() { var_dump(next(array(1, 2))); ?> --EXPECTF-- -Fatal error: Uncaught Error: next(): Argument #1 ($arg) cannot be passed by reference in %s:%d +Fatal error: Uncaught Error: next(): Argument #1 ($array) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/ext/standard/tests/array/array_pad.phpt b/ext/standard/tests/array/array_pad.phpt index 6efef020b9dfd..5abcbac87ef7d 100644 --- a/ext/standard/tests/array/array_pad.phpt +++ b/ext/standard/tests/array/array_pad.phpt @@ -84,4 +84,4 @@ array(4) { [3]=> float(2) } -array_pad(): Argument #2 ($pad_size) must be less than or equal to 1048576 +array_pad(): Argument #2 ($length) must be less than or equal to 1048576 diff --git a/ext/standard/tests/array/array_rand.phpt b/ext/standard/tests/array/array_rand.phpt index 52890dcafd2c5..03fb91eb53062 100644 --- a/ext/standard/tests/array/array_rand.phpt +++ b/ext/standard/tests/array/array_rand.phpt @@ -40,9 +40,9 @@ var_dump(array_rand(array(1,2,3), 2)); --EXPECTF-- array_rand(): Argument #1 ($array) cannot be empty array_rand(): Argument #1 ($array) cannot be empty -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) array(3) { [0]=> int(%d) diff --git a/ext/standard/tests/array/array_rand_variation5.phpt b/ext/standard/tests/array/array_rand_variation5.phpt index 8b877c8a9108c..4a4295c615391 100644 --- a/ext/standard/tests/array/array_rand_variation5.phpt +++ b/ext/standard/tests/array/array_rand_variation5.phpt @@ -65,13 +65,13 @@ int(%d) int(%d) -- With num_req = 0 -- -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req = -1 -- -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req = -2 -- -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req more than number of members in 'input' array -- -array_rand(): Argument #2 ($num_req) must be between 1 and the number of elements in argument #1 ($array) +array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) diff --git a/ext/standard/tests/array/array_walk_objects.phpt b/ext/standard/tests/array/array_walk_objects.phpt index 2c95b5a6d0a9d..44b5b27e51e84 100644 --- a/ext/standard/tests/array/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk_objects.phpt @@ -43,5 +43,5 @@ string(10) "%r\0%r*%r\0%rvar_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" -array_walk(): Argument #1 ($input) must be of type array, string given +array_walk(): Argument #1 ($array) must be of type array, string given Done diff --git a/ext/standard/tests/array/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk_rec_objects.phpt index 4577e1af0c62c..a3513437a28e2 100644 Binary files a/ext/standard/tests/array/array_walk_rec_objects.phpt and b/ext/standard/tests/array/array_walk_rec_objects.phpt differ diff --git a/ext/standard/tests/array/count_invalid.phpt b/ext/standard/tests/array/count_invalid.phpt index 4b146de85b933..b4fb27c8a967b 100644 --- a/ext/standard/tests/array/count_invalid.phpt +++ b/ext/standard/tests/array/count_invalid.phpt @@ -3,40 +3,54 @@ Only arrays and countable objects can be counted --FILE-- getMessage() . \PHP_EOL; +} + +try { + $result = count("string"); + var_dump($result); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +try { + $result = count(123); + var_dump($result); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +try { + $result = count(true); + var_dump($result); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +try { + $result = count(false); + var_dump($result); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} + +try { + $result = count((object) []); + var_dump($result); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -Warning: count(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -Warning: count(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -Warning: count(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) +--EXPECT-- +count(): Argument #1 ($var) must be of type Countable|array, null given +count(): Argument #1 ($var) must be of type Countable|array, string given +count(): Argument #1 ($var) must be of type Countable|array, int given +count(): Argument #1 ($var) must be of type Countable|array, bool given +count(): Argument #1 ($var) must be of type Countable|array, bool given +count(): Argument #1 ($var) must be of type Countable|array, stdClass given -Warning: count(): Argument #1 ($var) must be of type Countable|array, stdClass given in %s on line %d -int(1) diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index 8532a74cb68ed..321706bc24869 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -3,10 +3,6 @@ Test count() function --FILE-- 1, "b" => 2, array("c" => 3, array("d" => 5))); print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n"; print "COUNT_RECURSIVE: should be 6, is ".count($arr, COUNT_RECURSIVE)."\n"; -print "-- Testing strings --\n"; -print "COUNT_NORMAL: should be 1, is ".count("string", COUNT_NORMAL)."\n"; -print "COUNT_RECURSIVE: should be 1, is ".count("string", COUNT_RECURSIVE)."\n"; - print "-- Testing various types with no second argument --\n"; -print "COUNT_NORMAL: should be 1, is ".count("string")."\n"; print "COUNT_NORMAL: should be 2, is ".count(array("a", array("b")))."\n"; $arr = array('a'=>array(NULL, NULL, NULL), 1=>array(NULL=>1, 1=>NULL), @@ -56,18 +47,6 @@ foreach ($count_array as $count_value) { $i++; } - -/* Testing count() by passing constant with no second argument */ -print "\n-- Testing count() on constants with no second argument --\n"; -print "COUNT_NORMAL: should be 1, is ".count(100)."\n"; -print "COUNT_NORMAL: should be 1, is ".count(-23.45)."\n"; - -print "\n-- Testing count() on NULL and Unset variables --\n"; -print "COUNT_NORMAL: should be 0, is ".count(NULL)."\n"; -print "COUNT_NORMAL: should be 1, is ".count("")."\n"; -print "COUNT_NORMAL: should be 0, is ".@count($a)."\n"; - - print "\n-- Testing count() on an empty sub-array --\n"; $arr = array(1, array(3, 4, array())); print "COUNT_NORMAL: should be 2, is ".count($arr, COUNT_NORMAL)."\n"; @@ -111,30 +90,13 @@ closedir( $resource2 ); ?> --EXPECTF-- *** Testing basic functionality of count() function *** --- Testing NULL -- - -Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -COUNT_NORMAL: should be 0, is 0 - -Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -COUNT_RECURSIVE: should be 0, is 0 -- Testing arrays -- COUNT_NORMAL: should be 2, is 2 COUNT_RECURSIVE: should be 8, is 8 -- Testing hashes -- COUNT_NORMAL: should be 3, is 3 COUNT_RECURSIVE: should be 6, is 6 --- Testing strings -- - -Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -COUNT_NORMAL: should be 1, is 1 - -Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -COUNT_RECURSIVE: should be 1, is 1 -- Testing various types with no second argument -- - -Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -COUNT_NORMAL: should be 1, is 1 COUNT_NORMAL: should be 2, is 2 -- Testing really cool arrays -- COUNT_NORMAL: should be 3, is 3 @@ -173,23 +135,6 @@ COUNT_RECURSIVE is 6 COUNT_NORMAL is 4 COUNT_RECURSIVE is 7 --- Testing count() on constants with no second argument -- - -Warning: count(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -COUNT_NORMAL: should be 1, is 1 - -Warning: count(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -COUNT_NORMAL: should be 1, is 1 - --- Testing count() on NULL and Unset variables -- - -Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -COUNT_NORMAL: should be 0, is 0 - -Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -COUNT_NORMAL: should be 1, is 1 -COUNT_NORMAL: should be 0, is 0 - -- Testing count() on an empty sub-array -- COUNT_NORMAL: should be 2, is 2 COUNT_RECURSIVE: should be 5, is 5 diff --git a/ext/standard/tests/array/extract_error.phpt b/ext/standard/tests/array/extract_error.phpt index e5b057222ff0f..f2b0cfa69c7e9 100644 --- a/ext/standard/tests/array/extract_error.phpt +++ b/ext/standard/tests/array/extract_error.phpt @@ -31,6 +31,6 @@ try { ?> --EXPECT-- *** Testing Error Conditions *** -extract(): Argument #2 ($extract_type) must be a valid extract type -extract(): Argument #2 ($extract_type) must be a valid extract type +extract(): Argument #2 ($flags) must be a valid extract type +extract(): Argument #2 ($flags) must be a valid extract type extract(): Argument #3 ($prefix) is required when using this extract type diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt index 4360b915256d3..065461001690c 100644 --- a/ext/standard/tests/array/max.phpt +++ b/ext/standard/tests/array/max.phpt @@ -33,9 +33,9 @@ var_dump(max(0, true, false, true)); ?> --EXPECT-- -max(): Argument #1 ($arg) must be of type array, int given -max(): Argument #1 ($arg) must contain at least one element -max(): Argument #1 ($arg) must be of type array, stdClass given +max(): Argument #1 ($value) must be of type array, int given +max(): Argument #1 ($value) must contain at least one element +max(): Argument #1 ($value) must be of type array, stdClass given int(2) float(2.11) string(1) "t" diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt index ad32ae4226924..97be4ad6828e0 100644 --- a/ext/standard/tests/array/min.phpt +++ b/ext/standard/tests/array/min.phpt @@ -33,9 +33,9 @@ var_dump(min(0, true, false, true)); ?> --EXPECT-- -min(): Argument #1 ($arg) must be of type array, int given -min(): Argument #1 ($arg) must contain at least one element -min(): Argument #1 ($arg) must be of type array, stdClass given +min(): Argument #1 ($value) must be of type array, int given +min(): Argument #1 ($value) must contain at least one element +min(): Argument #1 ($value) must be of type array, stdClass given int(1) float(2.09) string(0) "" diff --git a/ext/standard/tests/array/prev_error3.phpt b/ext/standard/tests/array/prev_error3.phpt index 7777527f16ab4..f7444975946cc 100644 --- a/ext/standard/tests/array/prev_error3.phpt +++ b/ext/standard/tests/array/prev_error3.phpt @@ -10,7 +10,7 @@ prev - ensure we cannot pass a temporary var_dump(prev(array(1, 2))); ?> --EXPECTF-- -Fatal error: Uncaught Error: prev(): Argument #1 ($arg) cannot be passed by reference in %s:%d +Fatal error: Uncaught Error: prev(): Argument #1 ($array) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/ext/standard/tests/array/sizeof_basic1.phpt b/ext/standard/tests/array/sizeof_basic1.phpt deleted file mode 100644 index 4c5910e3570e6..0000000000000 --- a/ext/standard/tests/array/sizeof_basic1.phpt +++ /dev/null @@ -1,65 +0,0 @@ ---TEST-- -Test sizeof() function : basic functionality - for scalar types ---FILE-- - ---EXPECTF-- -*** Testing sizeof() : basic functionality *** --- Testing sizeof() for integer type in default, COUNT_NORMAL and COUNT_RECURSIVE modes -- -default mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -COUNT_NORMAL mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -COUNT_RECURSIVE mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - --- Testing sizeof() for float type in default, COUNT_NORMAL and COUNT_RECURSIVE modes -- -default mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_NORMAL mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_RECURSIVE mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) -Done diff --git a/ext/standard/tests/array/sizeof_object2.phpt b/ext/standard/tests/array/sizeof_object2.phpt index 9a96719eb68c0..7f165bc5a893a 100644 --- a/ext/standard/tests/array/sizeof_object2.phpt +++ b/ext/standard/tests/array/sizeof_object2.phpt @@ -74,88 +74,52 @@ for($i = 0; $i < count($objects); $i++) $var = $objects[$i]; echo "Default Mode: "; - var_dump( sizeof($var) ); - echo "\n"; + try { + var_dump( sizeof($var) ); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } echo "COUNT_NORMAL Mode: "; - var_dump( sizeof($var, COUNT_NORMAL) ); - echo "\n"; + try { + var_dump( sizeof($var, COUNT_NORMAL) ); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } echo "COUNT_RECURSIVE Mode: "; - var_dump( sizeof($var, COUNT_RECURSIVE) ); - echo "\n"; + try { + var_dump( sizeof($var, COUNT_RECURSIVE) ); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } $counter++; } echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing sizeof() : object functionality *** --- Testing sizeof() with objects which doesn't implement Countable interface --- -- Iteration 1 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d -int(1) - +Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test given +COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -- Iteration 2 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d -int(1) - +Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given +COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -- Iteration 3 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d -int(1) - +Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given +COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -- Iteration 4 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d -int(1) - +Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given +COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -- Iteration 5 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d -int(1) - +Default Mode: sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given +COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given Done diff --git a/ext/standard/tests/array/sizeof_variation1.phpt b/ext/standard/tests/array/sizeof_variation1.phpt deleted file mode 100644 index 13196d3170edb..0000000000000 --- a/ext/standard/tests/array/sizeof_variation1.phpt +++ /dev/null @@ -1,322 +0,0 @@ ---TEST-- -Test sizeof() function : usage variations - for all scalar types and resource variable ---FILE-- - ---EXPECTF-- -*** Testing sizeof() : usage variations *** ---- Testing sizeof() for all scalar types in default,COUNT_NORMAL and COUNT_RECURSIVE mode --- --- Iteration 1 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - --- Iteration 2 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d -int(1) - --- Iteration 3 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - --- Iteration 4 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - --- Iteration 5 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - --- Iteration 6 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - --- Iteration 7 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d -int(1) - --- Iteration 8 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 9 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 10 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - --- Iteration 11 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - --- Iteration 12 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - --- Iteration 13 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d -int(1) - --- Iteration 14 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - --- Iteration 15 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - --- Iteration 16 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - --- Iteration 17 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d -int(1) - --- Iteration 18 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 19 -- -Default Mode: -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d -int(1) - -COUNT_NORMAL Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d -int(1) - -COUNT_RECURSIVE Mode: -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d -int(1) - -Done diff --git a/ext/standard/tests/array/sizeof_variation4.phpt b/ext/standard/tests/array/sizeof_variation4.phpt deleted file mode 100644 index c8484d84512ca..0000000000000 --- a/ext/standard/tests/array/sizeof_variation4.phpt +++ /dev/null @@ -1,463 +0,0 @@ ---TEST-- -Test sizeof() function : usage variations - all kinds of unset variables for 'var' argument ---FILE-- - ---EXPECTF-- -*** Testing sizeof() : usage variations *** ---- Testing sizeof() for all kinds of unset variables in default, Normal and Recursive Modes --- --- Iteration 1 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 2 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 3 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 4 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 5 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 6 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 7 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 8 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 9 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 10 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 11 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 12 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 13 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 14 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 15 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 16 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 17 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 18 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 19 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - --- Iteration 20 -- -Default Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_NORMAL Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -COUNT_RECURSIVE Mode: -Warning: Undefined variable $value in %s on line %d - -Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d -int(0) - -Done diff --git a/ext/standard/tests/assert/assert_options_error.phpt b/ext/standard/tests/assert/assert_options_error.phpt index 23ca2e9e03574..f1581fe720ea7 100644 --- a/ext/standard/tests/assert/assert_options_error.phpt +++ b/ext/standard/tests/assert/assert_options_error.phpt @@ -10,4 +10,4 @@ try { } ?> --EXPECT-- -assert_options(): Argument #1 ($what) must be an ASSERT_* constant +assert_options(): Argument #1 ($option) must be an ASSERT_* constant diff --git a/ext/standard/tests/directory/DirectoryClass_basic_001.phpt b/ext/standard/tests/directory/DirectoryClass_basic_001.phpt index 7e3c53b7970e2..9ccceda920437 100644 --- a/ext/standard/tests/directory/DirectoryClass_basic_001.phpt +++ b/ext/standard/tests/directory/DirectoryClass_basic_001.phpt @@ -41,22 +41,19 @@ Class [ class Directory ] { - Methods [3] { Method [ public method close ] { - - Parameters [1] { - Parameter #0 [ $dir_handle = null ] + - Parameters [0] { } } Method [ public method rewind ] { - - Parameters [1] { - Parameter #0 [ $dir_handle = null ] + - Parameters [0] { } } Method [ public method read ] { - - Parameters [1] { - Parameter #0 [ $dir_handle = null ] + - Parameters [0] { } } } diff --git a/ext/standard/tests/file/bug76735.phpt b/ext/standard/tests/file/bug76735.phpt new file mode 100644 index 0000000000000..8469312801e26 --- /dev/null +++ b/ext/standard/tests/file/bug76735.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #76735 (Incorrect message in fopen on invalid mode) +--FILE-- + +--EXPECTF-- +Warning: fopen(%s): Failed to open stream: `Q' is not a valid mode for fopen in %s on line %d diff --git a/ext/standard/tests/file/bug78241.phpt b/ext/standard/tests/file/bug78241.phpt index 99fed8a5a3fd6..e612560ada5c2 100644 --- a/ext/standard/tests/file/bug78241.phpt +++ b/ext/standard/tests/file/bug78241.phpt @@ -19,6 +19,10 @@ for ($i = 2037; $i <= 2040; $i++) { echo 'File: '.date('D, d M Y H:i:s', $file), PHP_EOL, PHP_EOL; } ?> +--CLEAN-- + --EXPECT-- Date: Thu, 01 Jan 2037 01:01:01 File: Thu, 01 Jan 2037 01:01:01 diff --git a/ext/standard/tests/file/copy_variation5.phpt b/ext/standard/tests/file/copy_variation5.phpt index 6da9f1f48c725..0f0d985c3d858 100644 --- a/ext/standard/tests/file/copy_variation5.phpt +++ b/ext/standard/tests/file/copy_variation5.phpt @@ -2,8 +2,7 @@ Test copy() function: usage variations - destination file names(case sensitive) --SKIPIF-- --FILE-- getMessage(), "\n"; + } // check the file pointer position and if eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -83,870 +87,366 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetcsv() : with two chars as enclosure & delimiter *** -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) Done diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt index bf692c7be9a25..653f624f9d5ac 100644 --- a/ext/standard/tests/file/fgetcsv_variation19.phpt +++ b/ext/standard/tests/file/fgetcsv_variation19.phpt @@ -1,5 +1,5 @@ --TEST-- -Test fgetcsv() : usage variations - with default enclosure & delimiter of two chars +Test fgetcsv() : usage variations - with enclosure of two chars --FILE-- getMessage(), "\n"; + } // check the file pointer position and if eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -81,756 +85,381 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetcsv() : with default enclosure & delimiter of two chars *** -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water,fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(11) "water fruit" -} -int(12) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) "water "fruit"" -} -int(16) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(19) "water\"fruit"\"air"" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "water\"fruit"\"""" -} -int(20) +fgetcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) Done diff --git a/ext/standard/tests/file/fgetcsv_variation24.phpt b/ext/standard/tests/file/fgetcsv_variation24.phpt deleted file mode 100644 index 1a6ef177523fa..0000000000000 --- a/ext/standard/tests/file/fgetcsv_variation24.phpt +++ /dev/null @@ -1,666 +0,0 @@ ---TEST-- -Test fgetcsv() : usage variations - two chars as enclosure & delimiter (various write modes) ---FILE-- - ---EXPECTF-- -*** Testing fgetcsv() : with two chars as enclosure & delimiter *** - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(13) ""water",fruit" -} -int(14) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) ""water","fruit"" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "^water^ ^fruit^" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "&water&:&fruit&" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(15) "=water===fruit=" -} -int(16) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(17) "-water--fruit-air" -} -int(18) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(21) "-water---fruit---air-" -} -int(22) -bool(false) - --- Testing fgetcsv() with file opened using w+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) -bool(false) - --- Testing fgetcsv() with file opened using w+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) -bool(false) - --- Testing fgetcsv() with file opened using w+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) -bool(false) - --- Testing fgetcsv() with file opened using x+ mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) -bool(false) - --- Testing fgetcsv() with file opened using x+b mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) -bool(false) - --- Testing fgetcsv() with file opened using x+t mode -- - -Warning: fgetcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fgetcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -array(1) { - [0]=> - string(23) "&""""&:&"&:,:":&,&:,,,," -} -int(24) -bool(false) -Done diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index 66708c4f17a63..8e29847d8cf27 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -47,6 +47,6 @@ if(file_exists($file_path."/file_put_contents1.tmp")) { Warning: file_get_contents(/no/such/file/or/dir): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- -file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 +file_get_contents(): Argument #5 ($max_length) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_error002.phpt b/ext/standard/tests/file/file_get_contents_error002.phpt index 6624279d748ce..a58308d831b0d 100644 --- a/ext/standard/tests/file/file_get_contents_error002.phpt +++ b/ext/standard/tests/file/file_get_contents_error002.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 +file_get_contents(): Argument #5 ($max_length) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt index 5b889a19c32ac..c41a826bf958f 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt @@ -39,6 +39,6 @@ unlink($file_path."/file_put_contents1.tmp"); Warning: file_get_contents(/no/such/file/or/dir): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- -file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0 +file_get_contents(): Argument #5 ($max_length) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index 68e0f3fd309b8..346029c7cab27 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -60,4 +60,4 @@ int(0) bool(true) int(0) bool(true) -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index 52dd5179bede8..add22959816dc 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -56,13 +56,13 @@ unlink($file); --EXPECT-- *** Testing error conditions *** --- Iteration 0 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 1 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 2 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 3 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 4 --- flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 5 --- diff --git a/ext/standard/tests/file/fputcsv_variation13.phpt b/ext/standard/tests/file/fputcsv_variation13.phpt index 7c1d71093ee7e..297819f68165d 100644 --- a/ext/standard/tests/file/fputcsv_variation13.phpt +++ b/ext/standard/tests/file/fputcsv_variation13.phpt @@ -1,5 +1,5 @@ --TEST-- -Test fputcsv() : usage variations - with default enclosure & delimiter of two chars +Test fputcsv() : usage variations - with enclosure of two chars --FILE-- getMessage(), "\n"; + } // check the file pointer position and eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -68,978 +72,654 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with default enclosure & delimiter of two chars *** -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit" -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit" -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit" -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(20) """"water"",""fruit" -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(20) -int(20) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit" -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit""" -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit""" -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit""" -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) """"water"",""fruit""" -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) """"water"",""fruit""" -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""^water^ ^fruit^" -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""^water^ ^fruit^" -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""^water^ ^fruit^" -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) ""^water^ ^fruit^" -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""^water^ ^fruit^" -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(32) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d -int(32) -int(32) +fputcsv(): Argument #4 ($enclosure) must be a single character +int(0) bool(false) -string(%d) ""&""""""""&:&""&:,:"":&,&:,,,," -" +string(0) "" Done diff --git a/ext/standard/tests/file/fputcsv_variation14.phpt b/ext/standard/tests/file/fputcsv_variation14.phpt deleted file mode 100644 index 5c4c669e7f562..0000000000000 --- a/ext/standard/tests/file/fputcsv_variation14.phpt +++ /dev/null @@ -1,405 +0,0 @@ ---TEST-- -Test fputcsv() : usage variations - with enclosure & delimiter of two chars(read only modes) ---FILE-- - ---EXPECTF-- -*** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode *** - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 12 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 15 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 16 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 18 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 22 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in r -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rb -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" - --- file opened in rt -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d - -Notice: fputcsv(): Write of 24 bytes failed with errno=9 Bad file descriptor in %s on line %d -bool(false) -int(0) -bool(false) -string(0) "" -Done diff --git a/ext/standard/tests/file/fputcsv_variation2.phpt b/ext/standard/tests/file/fputcsv_variation2.phpt index 5116940b4d25b..77b075a5f042f 100644 --- a/ext/standard/tests/file/fputcsv_variation2.phpt +++ b/ext/standard/tests/file/fputcsv_variation2.phpt @@ -75,649 +75,649 @@ echo "Done\n"; *** Testing fputcsv() : with delimiter as NULL *** -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation4.phpt b/ext/standard/tests/file/fputcsv_variation4.phpt index a53257535a364..dc78796158095 100644 --- a/ext/standard/tests/file/fputcsv_variation4.phpt +++ b/ext/standard/tests/file/fputcsv_variation4.phpt @@ -75,649 +75,649 @@ echo "Done\n"; *** Testing fputcsv() : with delimiter and enclosure as NULL *** -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($delimiter) must be a single character +fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation9.phpt b/ext/standard/tests/file/fputcsv_variation9.phpt index 957fb9966f38e..b2bc895cd870b 100644 --- a/ext/standard/tests/file/fputcsv_variation9.phpt +++ b/ext/standard/tests/file/fputcsv_variation9.phpt @@ -50,8 +50,11 @@ foreach ($csv_lists as $csv_list) { $csv_field = $csv_list[2]; // write to a file in csv format - var_dump( fputcsv($file_handle, $csv_field, '++', '%%' -) ); + try { + var_dump( fputcsv($file_handle, $csv_field, '++', '%%') ); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } // check the file pointer position and eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -68,1194 +71,654 @@ foreach ($csv_lists as $csv_list) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fputcsv() : with two chars as enclosure & delimiter *** -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(12) "water,fruit -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(12) -int(12) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "water,fruit -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(15) ""water","fruit -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(15) -int(15) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit" -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit" -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit" -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) ""water","fruit" -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) ""water","fruit" -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "%^water^ ^fruit^% -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "%^water^ ^fruit^% -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "%^water^ ^fruit^% -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "%^water^ ^fruit^% -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "%^water^ ^fruit^% -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "&water&:&fruit& -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&water&:&fruit& -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(16) "=water===fruit= -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(16) -int(16) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "=water===fruit= -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(18) "-water--fruit-air -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(18) -int(18) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water--fruit-air -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(22) "-water---fruit---air- -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(22) -int(22) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "-water---fruit---air- -" +string(0) "" -- file opened in r+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in r+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in r+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in a+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in a+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in a+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in w+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in w+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in w+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in x+ -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in x+b -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(24) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" -- file opened in x+t -- - -Warning: fputcsv(): Argument #3 ($delimiter) must be a single character in %s on line %d - -Warning: fputcsv(): Argument #4 ($enclosure) must be a single character in %s on line %d -int(24) -int(24) +fputcsv(): Argument #3 ($separator) must be a single character +int(0) bool(false) -string(%d) "&""""&:&"&:,:":&,&:,,,, -" +string(0) "" Done diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt index a9e386b0b030f..4da0b374ba946 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -60,8 +60,8 @@ Warning: rmdir(%s/mkdir_variation2/): %s on line %d bool(false) *** Testing mkdir() and rmdir() for binary safe functionality *** -mkdir(): Argument #1 ($pathname) must not contain any null bytes -rmdir(): Argument #1 ($dirname) must not contain any null bytes +mkdir(): Argument #1 ($directory) must not contain any null bytes +rmdir(): Argument #1 ($directory) must not contain any null bytes *** Testing mkdir() with miscellaneous input *** bool(true) diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 38644b3c6cc6f..0c951e2657ff4 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -96,9 +96,9 @@ File name is => %s%et%s File permissions are => 100666 File created in => temp dir -- Iteration 6 -- -tempnam(): Argument #1 ($dir) must not contain any null bytes +tempnam(): Argument #1 ($directory) must not contain any null bytes -- Iteration 7 -- -tempnam(): Argument #1 ($dir) must be of type string, array given +tempnam(): Argument #1 ($directory) must be of type string, array given -- Iteration 8 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7-win32.php on line %d diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index dbe80d5ebb67c..9a0b1151c6b47 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -101,9 +101,9 @@ File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir -- Iteration 6 -- -tempnam(): Argument #1 ($dir) must not contain any null bytes +tempnam(): Argument #1 ($directory) must not contain any null bytes -- Iteration 7 -- -tempnam(): Argument #1 ($dir) must be of type string, array given +tempnam(): Argument #1 ($directory) must be of type string, array given -- Iteration 8 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt index 32e49f31497ba..9e3972631aa67 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -57,5 +57,5 @@ int(100) Warning: touch(): Unable to create file /no/such/file/or/directory because %s in %s on line %d bool(false) -touch(): Argument #2 ($time) cannot be null when argument #3 ($atime) is an integer +touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer Done diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index 101604f5abcec..9549e01e2787a 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -318,7 +318,7 @@ echo $data . "\n"; ?> --EXPECT-- -stream_wrapper_register(): Argument #2 ($classname) must be a valid class name, class_not_exist given +stream_wrapper_register(): Argument #2 ($class) must be a valid class name, class_not_exist given Not Registered Registered Registered diff --git a/ext/standard/tests/filters/001.phpt b/ext/standard/tests/filters/001.phpt index 8afe3bbaf3b93..3f0d5f5eb44e4 100644 --- a/ext/standard/tests/filters/001.phpt +++ b/ext/standard/tests/filters/001.phpt @@ -25,8 +25,8 @@ var_dump(stream_filter_register("------", "nonexistentclass")); echo "Done\n"; ?> --EXPECT-- -stream_filter_register(): Argument #1 ($filtername) must be a non-empty string -stream_filter_register(): Argument #2 ($classname) must be a non-empty string -stream_filter_register(): Argument #1 ($filtername) must be a non-empty string +stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string +stream_filter_register(): Argument #2 ($class) must be a non-empty string +stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string bool(true) Done diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt index 31b8bed9050c2..af722ea583c63 100644 --- a/ext/standard/tests/general_functions/010.phpt +++ b/ext/standard/tests/general_functions/010.phpt @@ -20,5 +20,5 @@ try { echo "Done\n"; ?> --EXPECT-- -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "test::__call" not found or invalid function name +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically Done diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt index 09735c9d86c48..2e388d4742060 100644 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ b/ext/standard/tests/general_functions/bug32647.phpt @@ -73,15 +73,15 @@ register_shutdown_function(array($obj,'barfoo')); ?> --EXPECTF-- Warning: Undefined variable $obj in %s on line %d -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "Array" not found or invalid function name +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object Warning: Undefined variable $obj in %s on line %d -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "Array" not found or invalid function name -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "Array" not found or invalid function name -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "bar::foo" not found or invalid function name -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "Array" not found or invalid function name -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "bar" not found or invalid function name -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "bar::barfoo" not found or invalid function name -register_shutdown_function(): Argument #1 ($function) must be a valid callback, function "bar::foobar" not found or invalid function name +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo" +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically +register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar" foo! bar! diff --git a/ext/standard/tests/general_functions/getservbyname_basic.phpt b/ext/standard/tests/general_functions/getservbyname_basic.phpt index edc210fc39576..51086f8026789 100644 --- a/ext/standard/tests/general_functions/getservbyname_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyname_basic.phpt @@ -5,6 +5,12 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- + --FILE-- --FILE-- --FILE-- getMessage() . \PHP_EOL; + } } ?> ---EXPECTF-- +--EXPECT-- bool(true) bool(true) bool(false) int(2) - -Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d +count(): Argument #1 ($var) must be of type Countable|array, null given diff --git a/ext/standard/tests/general_functions/proc_open_array.phpt b/ext/standard/tests/general_functions/proc_open_array.phpt index a37aea891ec69..9f969a1c32f24 100644 --- a/ext/standard/tests/general_functions/proc_open_array.phpt +++ b/ext/standard/tests/general_functions/proc_open_array.phpt @@ -68,7 +68,7 @@ proc_close($proc); ?> --EXPECT-- Empty command array: -proc_open(): Argument #1 ($cmd) must have at least one element +proc_open(): Argument #1 ($command) must have at least one element Nul byte in program name: Command array element 1 contains a null byte diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt index 96ce75bd0ccac..f5801ad63e435 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -32,7 +32,7 @@ echo "END\n"; ?> --EXPECTF-- Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d -proc_open(): Argument #2 ($descriptorspec) must only contain arrays and streams +proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams array(4) { [3]=> resource(%d) of type (Unknown) diff --git a/ext/standard/tests/general_functions/putenv.phpt b/ext/standard/tests/general_functions/putenv.phpt index 163fa7e4a708e..40799b25790f2 100644 --- a/ext/standard/tests/general_functions/putenv.phpt +++ b/ext/standard/tests/general_functions/putenv.phpt @@ -37,6 +37,6 @@ bool(true) string(0) "" bool(true) bool(false) -putenv(): Argument #1 ($setting) must have a valid syntax -putenv(): Argument #1 ($setting) must have a valid syntax +putenv(): Argument #1 ($assignment) must have a valid syntax +putenv(): Argument #1 ($assignment) must have a valid syntax Done diff --git a/ext/standard/tests/general_functions/register_tick_function_error.phpt b/ext/standard/tests/general_functions/register_tick_function_error.phpt index 82564a83b425e..adcc20215ed91 100644 --- a/ext/standard/tests/general_functions/register_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/register_tick_function_error.phpt @@ -11,4 +11,4 @@ try { } ?> --EXPECT-- -register_tick_function(): Argument #1 ($function) must be a valid tick callback, "a" given +register_tick_function(): Argument #1 ($callback) must be a valid tick callback, "a" given diff --git a/ext/standard/tests/image/bug79877.phpt b/ext/standard/tests/image/bug79877.phpt index fa68fc963a75a..53532deb31ba7 100644 --- a/ext/standard/tests/image/bug79877.phpt +++ b/ext/standard/tests/image/bug79877.phpt @@ -5,7 +5,7 @@ Bug #79877 (getimagesize function silently truncates after a null byte) var_dump(getimagesize("/tmp/a.png\0xx")); ?> --EXPECTF-- -Fatal error: Uncaught ValueError: getimagesize(): Argument #1 ($image_path) must not contain any null bytes in %s:%d +Fatal error: Uncaught ValueError: getimagesize(): Argument #1 ($filename) must not contain any null bytes in %s:%d Stack trace: #0 %s(%d): getimagesize('/tmp/a.png\x00xx') #1 {main} diff --git a/ext/standard/tests/mail/mail_null_bytes.phpt b/ext/standard/tests/mail/mail_null_bytes.phpt index d25757cb59fce..2254b7b8fff3a 100644 --- a/ext/standard/tests/mail/mail_null_bytes.phpt +++ b/ext/standard/tests/mail/mail_null_bytes.phpt @@ -35,4 +35,4 @@ mail(): Argument #1 ($to) must not contain any null bytes mail(): Argument #2 ($subject) must not contain any null bytes mail(): Argument #3 ($message) must not contain any null bytes mail(): Argument #4 ($additional_headers) must not contain any null bytes -mail(): Argument #5 ($additional_parameters) must not contain any null bytes +mail(): Argument #5 ($additional_params) must not contain any null bytes diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index 4a40ab4e37cdb..6b7a184cbd93d 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -100,25 +100,25 @@ int(1) int(0) -- Iteration 7 -- -abs(): Argument #1 ($number) must be of type int|float, string given +abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -abs(): Argument #1 ($number) must be of type int|float, string given +abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -abs(): Argument #1 ($number) must be of type int|float, array given +abs(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -abs(): Argument #1 ($number) must be of type int|float, string given +abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -abs(): Argument #1 ($number) must be of type int|float, string given +abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -abs(): Argument #1 ($number) must be of type int|float, string given +abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -abs(): Argument #1 ($number) must be of type int|float, classA given +abs(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- int(0) @@ -127,4 +127,4 @@ int(0) int(0) -- Iteration 16 -- -abs(): Argument #1 ($number) must be of type int|float, resource given +abs(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/base_convert_error.phpt b/ext/standard/tests/math/base_convert_error.phpt index b2cf396ae3047..3d253606e0346 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -29,6 +29,6 @@ try { ?> --EXPECT-- *** Testing base_convert() : error conditions *** -base_convert(): Argument #2 ($frombase) must be between 2 and 36 (inclusive) -base_convert(): Argument #3 ($tobase) must be between 2 and 36 (inclusive) -base_convert(): Argument #1 ($number) must be of type string, classA given +base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive) +base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive) +base_convert(): Argument #1 ($num) must be of type string, classA given diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt index a1365b3e74723..8d8e0ff3a295b 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -145,7 +145,7 @@ string(1) "0" string(1) "0" -- Iteration 19 -- -base_convert(): Argument #1 ($number) must be of type string, array given +base_convert(): Argument #1 ($num) must be of type string, array given -- Iteration 20 -- @@ -169,4 +169,4 @@ string(1) "0" string(1) "0" -- Iteration 25 -- -base_convert(): Argument #1 ($number) must be of type string, resource given +base_convert(): Argument #1 ($num) must be of type string, resource given diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index a21ffe609d17a..ce61442f6554c 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -93,25 +93,25 @@ float(1) float(0) -- Iteration 7 -- -ceil(): Argument #1 ($number) must be of type int|float, string given +ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -ceil(): Argument #1 ($number) must be of type int|float, string given +ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -ceil(): Argument #1 ($number) must be of type int|float, array given +ceil(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -ceil(): Argument #1 ($number) must be of type int|float, string given +ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -ceil(): Argument #1 ($number) must be of type int|float, string given +ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -ceil(): Argument #1 ($number) must be of type int|float, string given +ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -ceil(): Argument #1 ($number) must be of type int|float, classA given +ceil(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- float(0) @@ -120,4 +120,4 @@ float(0) float(0) -- Iteration 16 -- -ceil(): Argument #1 ($number) must be of type int|float, resource given +ceil(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/decbin_basic.phpt b/ext/standard/tests/math/decbin_basic.phpt index 1366997dcf128..54b771ca26c20 100644 --- a/ext/standard/tests/math/decbin_basic.phpt +++ b/ext/standard/tests/math/decbin_basic.phpt @@ -36,7 +36,7 @@ string(4) "1010" string(12) "111101101110" string(12) "111101101110" string(6) "100111" -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" string(1) "0" diff --git a/ext/standard/tests/math/decbin_basiclong_64bit.phpt b/ext/standard/tests/math/decbin_basiclong_64bit.phpt index 6e4dfa826b0e3..16fd6b97b8033 100644 --- a/ext/standard/tests/math/decbin_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decbin_basiclong_64bit.phpt @@ -55,7 +55,7 @@ string(32) "11111111111111111111111111111101" --- testing: 9223372036854775806 --- string(63) "111111111111111111111111111111111111111111111111111111111111110" --- testing: 9.2233720368548E+18 --- -decbin(): Argument #1 ($number) must be of type int, float given +decbin(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(64) "1000000000000000000000000000000000000000000000000000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/decbin_variation1.phpt b/ext/standard/tests/math/decbin_variation1.phpt index 53f4bcaab4687..fd9addc721c7c 100644 --- a/ext/standard/tests/math/decbin_variation1.phpt +++ b/ext/standard/tests/math/decbin_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test decbin() function : usage variations - different data types as $number arg +Test decbin() function : usage variations - different data types as $num arg --INI-- precision=14 --SKIPIF-- @@ -106,10 +106,10 @@ string(14) "11000000111001" string(32) "11111111111111111111011011010111" -- Iteration 5 -- -decbin(): Argument #1 ($number) must be of type int, float given +decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decbin(): Argument #1 ($number) must be of type int, float given +decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(4) "1010" @@ -118,7 +118,7 @@ string(4) "1010" string(32) "11111111111111111111111111110110" -- Iteration 9 -- -decbin(): Argument #1 ($number) must be of type int, float given +decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 10 -- string(1) "0" @@ -145,25 +145,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 19 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 20 -- -decbin(): Argument #1 ($number) must be of type int, array given +decbin(): Argument #1 ($num) must be of type int, array given -- Iteration 21 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 22 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 23 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 24 -- -decbin(): Argument #1 ($number) must be of type int, classA given +decbin(): Argument #1 ($num) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -172,4 +172,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -decbin(): Argument #1 ($number) must be of type int, resource given +decbin(): Argument #1 ($num) must be of type int, resource given diff --git a/ext/standard/tests/math/decbin_variation1_64bit.phpt b/ext/standard/tests/math/decbin_variation1_64bit.phpt index ed278bfed04c4..f9e1b19b29030 100644 --- a/ext/standard/tests/math/decbin_variation1_64bit.phpt +++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt @@ -104,10 +104,10 @@ string(14) "11000000111001" string(64) "1111111111111111111111111111111111111111111111111111011011010111" -- Iteration 5 -- -decbin(): Argument #1 ($number) must be of type int, float given +decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decbin(): Argument #1 ($number) must be of type int, float given +decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(4) "1010" @@ -143,25 +143,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 19 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 20 -- -decbin(): Argument #1 ($number) must be of type int, array given +decbin(): Argument #1 ($num) must be of type int, array given -- Iteration 21 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 22 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 23 -- -decbin(): Argument #1 ($number) must be of type int, string given +decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 24 -- -decbin(): Argument #1 ($number) must be of type int, classA given +decbin(): Argument #1 ($num) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -170,4 +170,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -decbin(): Argument #1 ($number) must be of type int, resource given +decbin(): Argument #1 ($num) must be of type int, resource given diff --git a/ext/standard/tests/math/dechex_basic.phpt b/ext/standard/tests/math/dechex_basic.phpt index 729685c206084..92e9c426b3755 100644 --- a/ext/standard/tests/math/dechex_basic.phpt +++ b/ext/standard/tests/math/dechex_basic.phpt @@ -36,7 +36,7 @@ string(1) "a" string(3) "f6e" string(3) "f6e" string(2) "27" -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" string(1) "0" diff --git a/ext/standard/tests/math/dechex_basiclong_64bit.phpt b/ext/standard/tests/math/dechex_basiclong_64bit.phpt index c7727c5ce8883..85051ea4567ba 100644 --- a/ext/standard/tests/math/dechex_basiclong_64bit.phpt +++ b/ext/standard/tests/math/dechex_basiclong_64bit.phpt @@ -55,7 +55,7 @@ string(8) "fffffffd" --- testing: 9223372036854775806 --- string(16) "7ffffffffffffffe" --- testing: 9.2233720368548E+18 --- -dechex(): Argument #1 ($number) must be of type int, float given +dechex(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(16) "8000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/dechex_variation1.phpt b/ext/standard/tests/math/dechex_variation1.phpt index 5dbe004a07ac5..8add97f7a24d1 100644 --- a/ext/standard/tests/math/dechex_variation1.phpt +++ b/ext/standard/tests/math/dechex_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test dechex() function : usage variations - different data types as $number arg +Test dechex() function : usage variations - different data types as $num arg --INI-- precision=14 --SKIPIF-- @@ -106,10 +106,10 @@ string(4) "3039" string(8) "fffff6d7" -- Iteration 5 -- -dechex(): Argument #1 ($number) must be of type int, float given +dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -dechex(): Argument #1 ($number) must be of type int, float given +dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(1) "a" @@ -118,7 +118,7 @@ string(1) "a" string(8) "fffffff6" -- Iteration 9 -- -dechex(): Argument #1 ($number) must be of type int, float given +dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 10 -- string(1) "0" @@ -145,25 +145,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 19 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 20 -- -dechex(): Argument #1 ($number) must be of type int, array given +dechex(): Argument #1 ($num) must be of type int, array given -- Iteration 21 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 22 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 23 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 24 -- -dechex(): Argument #1 ($number) must be of type int, classA given +dechex(): Argument #1 ($num) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -172,4 +172,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -dechex(): Argument #1 ($number) must be of type int, resource given +dechex(): Argument #1 ($num) must be of type int, resource given diff --git a/ext/standard/tests/math/dechex_variation1_64bit.phpt b/ext/standard/tests/math/dechex_variation1_64bit.phpt index 981ccba493c56..020bbcd22ce73 100644 --- a/ext/standard/tests/math/dechex_variation1_64bit.phpt +++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt @@ -105,10 +105,10 @@ string(4) "3039" string(16) "fffffffffffff6d7" -- Iteration 5 -- -dechex(): Argument #1 ($number) must be of type int, float given +dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -dechex(): Argument #1 ($number) must be of type int, float given +dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(1) "a" @@ -144,25 +144,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 19 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 20 -- -dechex(): Argument #1 ($number) must be of type int, array given +dechex(): Argument #1 ($num) must be of type int, array given -- Iteration 21 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 22 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 23 -- -dechex(): Argument #1 ($number) must be of type int, string given +dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 24 -- -dechex(): Argument #1 ($number) must be of type int, classA given +dechex(): Argument #1 ($num) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -171,4 +171,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -dechex(): Argument #1 ($number) must be of type int, resource given +dechex(): Argument #1 ($num) must be of type int, resource given diff --git a/ext/standard/tests/math/decoct_basic.phpt b/ext/standard/tests/math/decoct_basic.phpt index 4afdeb466e43c..9252789b2464b 100644 --- a/ext/standard/tests/math/decoct_basic.phpt +++ b/ext/standard/tests/math/decoct_basic.phpt @@ -36,7 +36,7 @@ string(2) "12" string(4) "7556" string(4) "7556" string(2) "47" -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" string(1) "0" diff --git a/ext/standard/tests/math/decoct_basiclong_64bit.phpt b/ext/standard/tests/math/decoct_basiclong_64bit.phpt index 0ebc7203f2eff..a4e951176cd0b 100644 --- a/ext/standard/tests/math/decoct_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decoct_basiclong_64bit.phpt @@ -55,7 +55,7 @@ string(11) "37777777775" --- testing: 9223372036854775806 --- string(21) "777777777777777777776" --- testing: 9.2233720368548E+18 --- -decoct(): Argument #1 ($number) must be of type int, float given +decoct(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(22) "1000000000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/decoct_variation1.phpt b/ext/standard/tests/math/decoct_variation1.phpt index 79125661757df..a236ea53678bc 100644 --- a/ext/standard/tests/math/decoct_variation1.phpt +++ b/ext/standard/tests/math/decoct_variation1.phpt @@ -1,5 +1,5 @@ --TEST-- -Test decoct() function : usage variations - different data types as $number arg +Test decoct() function : usage variations - different data types as $num arg --INI-- precision=14 --SKIPIF-- @@ -106,10 +106,10 @@ string(5) "30071" string(11) "37777773327" -- Iteration 5 -- -decoct(): Argument #1 ($number) must be of type int, float given +decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decoct(): Argument #1 ($number) must be of type int, float given +decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(2) "12" @@ -118,7 +118,7 @@ string(2) "12" string(11) "37777777766" -- Iteration 9 -- -decoct(): Argument #1 ($number) must be of type int, float given +decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 10 -- string(1) "0" @@ -145,25 +145,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 19 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 20 -- -decoct(): Argument #1 ($number) must be of type int, array given +decoct(): Argument #1 ($num) must be of type int, array given -- Iteration 21 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 22 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 23 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 24 -- -decoct(): Argument #1 ($number) must be of type int, classA given +decoct(): Argument #1 ($num) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -172,4 +172,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -decoct(): Argument #1 ($number) must be of type int, resource given +decoct(): Argument #1 ($num) must be of type int, resource given diff --git a/ext/standard/tests/math/decoct_variation1_64bit.phpt b/ext/standard/tests/math/decoct_variation1_64bit.phpt index 35a9c892883c9..2ecc212844c0b 100644 --- a/ext/standard/tests/math/decoct_variation1_64bit.phpt +++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt @@ -106,10 +106,10 @@ string(5) "30071" string(22) "1777777777777777773327" -- Iteration 5 -- -decoct(): Argument #1 ($number) must be of type int, float given +decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decoct(): Argument #1 ($number) must be of type int, float given +decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(2) "12" @@ -145,25 +145,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 19 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 20 -- -decoct(): Argument #1 ($number) must be of type int, array given +decoct(): Argument #1 ($num) must be of type int, array given -- Iteration 21 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 22 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 23 -- -decoct(): Argument #1 ($number) must be of type int, string given +decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 24 -- -decoct(): Argument #1 ($number) must be of type int, classA given +decoct(): Argument #1 ($num) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -172,4 +172,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -decoct(): Argument #1 ($number) must be of type int, resource given +decoct(): Argument #1 ($num) must be of type int, resource given diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index 95228b4418aac..0b5f09f27dce5 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -93,25 +93,25 @@ float(1) float(0) -- Iteration 7 -- -floor(): Argument #1 ($number) must be of type int|float, string given +floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -floor(): Argument #1 ($number) must be of type int|float, string given +floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -floor(): Argument #1 ($number) must be of type int|float, array given +floor(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -floor(): Argument #1 ($number) must be of type int|float, string given +floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -floor(): Argument #1 ($number) must be of type int|float, string given +floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -floor(): Argument #1 ($number) must be of type int|float, string given +floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -floor(): Argument #1 ($number) must be of type int|float, classA given +floor(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- float(0) @@ -120,4 +120,4 @@ float(0) float(0) -- Iteration 16 -- -floor(): Argument #1 ($number) must be of type int|float, resource given +floor(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt index ab8eecbe84227..b6ce56dd4acad 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -137,25 +137,25 @@ float(1) float(0) -- Iteration 17 -- -round(): Argument #1 ($number) must be of type int|float, string given +round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 18 -- -round(): Argument #1 ($number) must be of type int|float, string given +round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 19 -- -round(): Argument #1 ($number) must be of type int|float, array given +round(): Argument #1 ($num) must be of type int|float, array given -- Iteration 20 -- -round(): Argument #1 ($number) must be of type int|float, string given +round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 21 -- -round(): Argument #1 ($number) must be of type int|float, string given +round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 22 -- -round(): Argument #1 ($number) must be of type int|float, string given +round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 23 -- -round(): Argument #1 ($number) must be of type int|float, classA given +round(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 24 -- float(0) @@ -164,4 +164,4 @@ float(0) float(0) -- Iteration 26 -- -round(): Argument #1 ($number) must be of type int|float, resource given +round(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/network/bug80067.phpt b/ext/standard/tests/network/bug80067.phpt index 19b2c76bb9458..ed7802cc40d2b 100644 --- a/ext/standard/tests/network/bug80067.phpt +++ b/ext/standard/tests/network/bug80067.phpt @@ -3,6 +3,7 @@ Bug #80067 (Omitting the port in bindto setting errors) --SKIPIF-- --FILE-- +--SKIPIF-- + --FILE-- +--SKIPIF-- + --FILE-- +--FILE-- + +--EXPECTF-- +Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in %s on line %d +bool(false) + +Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in %s on line %d +bool(true) + +Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in %s on line %d +bool(false) + +Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in %s on line %d +bool(true) diff --git a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt index 7bfe8d5724d73..d229c0ef6bfbf 100644 --- a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt +++ b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt @@ -14,6 +14,6 @@ try { } ?> ---EXPECTF-- +--EXPECT-- string(2) "bc" -stream_get_contents(): Argument #2 ($maxlength) must be greater than or equal to -1 +stream_get_contents(): Argument #2 ($max_length) must be greater than or equal to -1 diff --git a/ext/standard/tests/strings/addcslashes_001.phpt b/ext/standard/tests/strings/addcslashes_001.phpt index 50a57129e5b36..be6b18559faa6 100644 Binary files a/ext/standard/tests/strings/addcslashes_001.phpt and b/ext/standard/tests/strings/addcslashes_001.phpt differ diff --git a/ext/standard/tests/strings/bug40754.phpt b/ext/standard/tests/strings/bug40754.phpt index 609e47732a6d6..42eed969abfdf 100644 --- a/ext/standard/tests/strings/bug40754.phpt +++ b/ext/standard/tests/strings/bug40754.phpt @@ -8,8 +8,17 @@ $v = 2147483647; var_dump(substr("abcde", 1, $v)); var_dump(substr_replace("abcde", "x", $v, $v)); -var_dump(strspn("abcde", "abc", $v, $v)); -var_dump(strcspn("abcde", "abc", $v, $v)); +try { + var_dump(strspn("abcde", "abc", $v, $v)); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + var_dump(strcspn("abcde", "abc", $v, $v)); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} try { var_dump(substr_count("abcde", "abc", $v, $v)); @@ -79,8 +88,8 @@ var_dump(substr("abcde", $v, $v)); --EXPECT-- string(4) "bcde" string(6) "abcdex" -bool(false) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($main_str) stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) @@ -93,4 +102,4 @@ strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(2) string(8) "abcdeabc" -bool(false) +string(0) "" diff --git a/ext/standard/tests/strings/bug61116.phpt b/ext/standard/tests/strings/bug61116.phpt index d03489560b231..f8f76cd5047e9 100644 --- a/ext/standard/tests/strings/bug61116.phpt +++ b/ext/standard/tests/strings/bug61116.phpt @@ -10,7 +10,7 @@ Function [ function htmlspecialchars ] { - Parameters [4] { Parameter #0 [ string $string ] - Parameter #1 [ int $quote_style = ENT_COMPAT ] + Parameter #1 [ int $flags = ENT_COMPAT ] Parameter #2 [ ?string $encoding = null ] Parameter #3 [ bool $double_encode = true ] } @@ -21,7 +21,7 @@ Function [ function get_html_translation_table ] { - Parameters [3] { Parameter #0 [ int $table = HTML_SPECIALCHARS ] - Parameter #1 [ int $quote_style = ENT_COMPAT ] + Parameter #1 [ int $flags = ENT_COMPAT ] Parameter #2 [ string $encoding = "UTF-8" ] } - Return [ array ] diff --git a/ext/standard/tests/strings/bug78833.phpt b/ext/standard/tests/strings/bug78833.phpt index 763b6ec4eac32..7712e133facec 100644 --- a/ext/standard/tests/strings/bug78833.phpt +++ b/ext/standard/tests/strings/bug78833.phpt @@ -2,8 +2,11 @@ Bug #78833 (Integer overflow in pack causes out-of-bound access) --FILE-- getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: pack(): Type E: too few arguments in %s on line %d -bool(false) +--EXPECT-- +Type E: too few arguments diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt index 31a7b2c0389a5..9e59d67658776 100644 Binary files a/ext/standard/tests/strings/chunk_split_variation5.phpt and b/ext/standard/tests/strings/chunk_split_variation5.phpt differ diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt index 4a21455ecfd41..b0c889494e404 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -53,14 +53,14 @@ for($count = 0; $count < count($values); $count++) { --EXPECT-- *** Testing chunk_split() : different 'chunklen' with heredoc 'str' *** -- Iteration 1 -- -chunk_split(): Argument #2 ($chunklen) must be greater than 0 +chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- string(504) "T:::h:::i:::s:::':::s::: :::h:::e:::r:::e:::d:::o:::c::: :::s:::t:::r:::i:::n:::g::: :::w:::i:::t:::h::: ::: ::: :::a:::n:::d::: ::: ::: :::w:::h:::i:::t:::e::: :::s:::p:::a:::c:::e::: :::c:::h:::a:::r:::.::: :::I:::t::: :::h:::a:::s::: :::_:::s:::p:::e:::c:::i:::@:::l::: :::c:::h:::@:::r:::$::: :::2:::2:::2:::2::: :::!:::!:::!:::N:::o:::w::: :::\:::k::: :::a:::s::: :::e:::s:::c:::a:::p:::e::: :::c:::h:::a:::r::: :::t:::o::: :::t:::e:::s:::t::: :::c:::h:::u:::n:::k:::_:::s:::p:::l:::i:::t:::(:::):::" -- Iteration 3 -- -chunk_split(): Argument #2 ($chunklen) must be greater than 0 +chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- string(129) "This's heredoc string with and white space char. @@ -77,6 +77,6 @@ string(129) "This's heredoc string with and It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test chunk_split():::" -- Iteration 7 -- -chunk_split(): Argument #2 ($chunklen) must be of type int, float given +chunk_split(): Argument #2 ($length) must be of type int, float given -- Iteration 8 -- -chunk_split(): Argument #2 ($chunklen) must be greater than 0 +chunk_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt index fdc9d329a8fad..c1c1599eb7b56 100644 Binary files a/ext/standard/tests/strings/implode1.phpt and b/ext/standard/tests/strings/implode1.phpt differ diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index a21251aec2a28..7a806349ce9cb 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -119,15 +119,15 @@ string(29) "element11.07654321E-9element2" -- Iteration 9 -- string(19) "element10.5element2" -- Iteration 10 -- -join(): Argument #1 ($glue) must be of type string, array given +join(): Argument #1 ($separator) must be of type string, array given -- Iteration 11 -- -join(): Argument #1 ($glue) must be of type string, array given +join(): Argument #1 ($separator) must be of type string, array given -- Iteration 12 -- -join(): Argument #1 ($glue) must be of type string, array given +join(): Argument #1 ($separator) must be of type string, array given -- Iteration 13 -- -join(): Argument #1 ($glue) must be of type string, array given +join(): Argument #1 ($separator) must be of type string, array given -- Iteration 14 -- -join(): Argument #1 ($glue) must be of type string, array given +join(): Argument #1 ($separator) must be of type string, array given -- Iteration 15 -- string(17) "element11element2" -- Iteration 16 -- @@ -147,7 +147,7 @@ string(16) "element1element2" -- Iteration 23 -- string(16) "element1element2" -- Iteration 24 -- -join(): Argument #1 ($glue) must be of type array|string, resource given +join(): Argument #1 ($separator) must be of type array|string, resource given -- Iteration 25 -- string(16) "element1element2" -- Iteration 26 -- diff --git a/ext/standard/tests/strings/join_variation2.phpt b/ext/standard/tests/strings/join_variation2.phpt index 5fc83dde794db..57f570b258703 100644 --- a/ext/standard/tests/strings/join_variation2.phpt +++ b/ext/standard/tests/strings/join_variation2.phpt @@ -102,47 +102,47 @@ echo "Done\n"; --- Testing join() by supplying different values for 'pieces' argument --- -- Iteration 1 -- -join(): Argument #2 ($pieces) must be of type ?array, int given +join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 2 -- -join(): Argument #2 ($pieces) must be of type ?array, int given +join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 3 -- -join(): Argument #2 ($pieces) must be of type ?array, int given +join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 4 -- -join(): Argument #2 ($pieces) must be of type ?array, int given +join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 5 -- -join(): Argument #2 ($pieces) must be of type ?array, float given +join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 6 -- -join(): Argument #2 ($pieces) must be of type ?array, float given +join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 7 -- -join(): Argument #2 ($pieces) must be of type ?array, float given +join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 8 -- -join(): Argument #2 ($pieces) must be of type ?array, float given +join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 9 -- -join(): Argument #2 ($pieces) must be of type ?array, float given +join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 10 -- -join(): Argument #2 ($pieces) must be of type ?array, bool given +join(): Argument #2 ($array) must be of type ?array, bool given -- Iteration 11 -- -join(): Argument #2 ($pieces) must be of type ?array, bool given +join(): Argument #2 ($array) must be of type ?array, bool given -- Iteration 12 -- -join(): Argument #2 ($pieces) must be of type ?array, bool given +join(): Argument #2 ($array) must be of type ?array, bool given -- Iteration 13 -- -join(): Argument #2 ($pieces) must be of type ?array, bool given +join(): Argument #2 ($array) must be of type ?array, bool given -- Iteration 14 -- -join(): Argument #2 ($pieces) must be of type ?array, string given +join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 15 -- -join(): Argument #2 ($pieces) must be of type ?array, string given +join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 16 -- -join(): Argument #2 ($pieces) must be of type ?array, test given +join(): Argument #2 ($array) must be of type ?array, test given -- Iteration 17 -- -join(): Argument #2 ($pieces) must be of type ?array, string given +join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 18 -- -join(): Argument #2 ($pieces) must be of type ?array, string given +join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 19 -- join(): Argument #1 ($pieces) must be of type array, string given -- Iteration 20 -- join(): Argument #1 ($pieces) must be of type array, string given -- Iteration 21 -- -join(): Argument #2 ($pieces) must be of type ?array, resource given +join(): Argument #2 ($array) must be of type ?array, resource given -- Iteration 22 -- join(): Argument #1 ($pieces) must be of type array, string given -- Iteration 23 -- diff --git a/ext/standard/tests/strings/join_variation4.phpt b/ext/standard/tests/strings/join_variation4.phpt index 6a9ff44297ed5..8c8c8b9092d94 100644 Binary files a/ext/standard/tests/strings/join_variation4.phpt and b/ext/standard/tests/strings/join_variation4.phpt differ diff --git a/ext/standard/tests/strings/join_variation5.phpt b/ext/standard/tests/strings/join_variation5.phpt index 50dd08cbf2af3..9e5898d8c1079 100644 --- a/ext/standard/tests/strings/join_variation5.phpt +++ b/ext/standard/tests/strings/join_variation5.phpt @@ -35,7 +35,7 @@ Warning: Array to string conversion in %s on line %d Warning: Array to string conversion in %s on line %d string(27) "ArrayTESTArrayTESTPHPTEST50" -join(): Argument #1 ($glue) must be of type string, array given +join(): Argument #1 ($separator) must be of type string, array given Warning: Array to string conversion in %s on line %d diff --git a/ext/standard/tests/strings/levenshtein_error_conditions.phpt b/ext/standard/tests/strings/levenshtein_error_conditions.phpt index bd1b80742b19c..71af71297f653 100644 --- a/ext/standard/tests/strings/levenshtein_error_conditions.phpt +++ b/ext/standard/tests/strings/levenshtein_error_conditions.phpt @@ -25,7 +25,7 @@ try { --EXPECT-- --- String 1 --- int(254) -levenshtein(): Argument #1 ($str1) must be less than 256 characters +levenshtein(): Argument #1 ($string1) must be less than 256 characters --- String 2 --- int(254) -levenshtein(): Argument #2 ($str2) must be less than 256 characters +levenshtein(): Argument #2 ($string2) must be less than 256 characters diff --git a/ext/standard/tests/strings/metaphone.phpt b/ext/standard/tests/strings/metaphone.phpt index a6b52e3934a1f..6b8f5c1c89d9d 100644 --- a/ext/standard/tests/strings/metaphone.phpt +++ b/ext/standard/tests/strings/metaphone.phpt @@ -5,9 +5,12 @@ metaphone() tests var_dump(metaphone("")); var_dump(metaphone(-1)); -var_dump(metaphone(-1, -1)); -var_dump(metaphone("valid phrase", -1)); +try { + var_dump(metaphone("valid phrase", -1)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} var_dump(metaphone("valid phrase", 0)); var_dump(metaphone("valid phrase", 10000)); @@ -27,8 +30,7 @@ echo "Done\n"; --EXPECT-- string(0) "" string(0) "" -bool(false) -bool(false) +metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0 string(6) "FLTFRS" string(6) "FLTFRS" string(26) "0FLFRWRTKRFLNKHTLSLN0KLTR0" diff --git a/ext/standard/tests/strings/pack64_32.phpt b/ext/standard/tests/strings/pack64_32.phpt index 978e04449de61..87e945c5fac66 100644 --- a/ext/standard/tests/strings/pack64_32.phpt +++ b/ext/standard/tests/strings/pack64_32.phpt @@ -8,37 +8,55 @@ if (PHP_INT_SIZE > 4) { ?> --FILE-- getMessage(), "\n"; +} +try { + var_dump(pack("J", 0)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(pack("P", 0)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(pack("q", 0)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} + +try { + var_dump(unpack("Q", '')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(unpack("J", '')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(unpack("P", '')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(unpack("q", '')); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} -var_dump(unpack("Q", '')); -var_dump(unpack("J", '')); -var_dump(unpack("P", '')); -var_dump(unpack("q", '')); ?> --EXPECTF-- -Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) - -Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d -bool(false) +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP +64-bit format codes are not available for 32-bit versions of PHP diff --git a/ext/standard/tests/strings/soundex.phpt b/ext/standard/tests/strings/soundex.phpt index c4acc2ff6842d..95d0b76085e79 100644 --- a/ext/standard/tests/strings/soundex.phpt +++ b/ext/standard/tests/strings/soundex.phpt @@ -31,7 +31,7 @@ foreach ($array as $str) { echo "Done\n"; ?> --EXPECT-- -bool(false) +string(4) "0000" string(4) "0000" string(4) "F650" string(4) "T300" diff --git a/ext/standard/tests/strings/sprintf_variation54.phpt b/ext/standard/tests/strings/sprintf_variation54.phpt index 82efde8d7f038..51a4e48827345 100644 Binary files a/ext/standard/tests/strings/sprintf_variation54.phpt and b/ext/standard/tests/strings/sprintf_variation54.phpt differ diff --git a/ext/standard/tests/strings/str_pad_variation1.phpt b/ext/standard/tests/strings/str_pad_variation1.phpt index d0f953a184ae2..cb71e61156fcd 100644 --- a/ext/standard/tests/strings/str_pad_variation1.phpt +++ b/ext/standard/tests/strings/str_pad_variation1.phpt @@ -31,6 +31,6 @@ var_dump( str_pad($input, $php_int_max_pad_length) ); ?> --EXPECTF-- *** Testing str_pad() function: with large value for for 'pad_length' argument *** -str_pad(): Argument #2 ($pad_length) must be of type int, float given +str_pad(): Argument #2 ($length) must be of type int, float given Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt index 7919dfda21989..3069f6bfe97f9 100644 Binary files a/ext/standard/tests/strings/str_repeat.phpt and b/ext/standard/tests/strings/str_repeat.phpt differ diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt index 21843a618a403..a8c1bbf1a927a 100644 --- a/ext/standard/tests/strings/str_split_variation6.phpt +++ b/ext/standard/tests/strings/str_split_variation6.phpt @@ -1,9 +1,5 @@ --TEST-- Test str_split() function : usage variations - different integer values for 'split_length' argument ---SKIPIF-- - --FILE-- @@ -128,7 +124,7 @@ array(42) { string(1) "t" } -- Iteration 3 -- -str_split(): Argument #2 ($split_length) must be greater than 0 +str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- array(1) { [0]=> @@ -147,4 +143,4 @@ array(1) { string(42) "This is a string with 123 & escape char \t" } -- Iteration 7 -- -str_split(): Argument #2 ($split_length) must be greater than 0 +str_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_split_variation6_64bit.phpt b/ext/standard/tests/strings/str_split_variation6_64bit.phpt deleted file mode 100644 index 090459aac9126..0000000000000 --- a/ext/standard/tests/strings/str_split_variation6_64bit.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -Test str_split() function : usage variations - different integer values for 'split_length' argument ---SKIPIF-- - ---FILE-- -getMessage() . "\n"; - } -} -?> ---EXPECT-- -*** Testing str_split() : different integer values for 'split_length' *** --- Iteration 1 -- -str_split(): Argument #2 ($split_length) must be greater than 0 --- Iteration 2 -- -array(42) { - [0]=> - string(1) "T" - [1]=> - string(1) "h" - [2]=> - string(1) "i" - [3]=> - string(1) "s" - [4]=> - string(1) " " - [5]=> - string(1) "i" - [6]=> - string(1) "s" - [7]=> - string(1) " " - [8]=> - string(1) "a" - [9]=> - string(1) " " - [10]=> - string(1) "s" - [11]=> - string(1) "t" - [12]=> - string(1) "r" - [13]=> - string(1) "i" - [14]=> - string(1) "n" - [15]=> - string(1) "g" - [16]=> - string(1) " " - [17]=> - string(1) "w" - [18]=> - string(1) "i" - [19]=> - string(1) "t" - [20]=> - string(1) "h" - [21]=> - string(1) " " - [22]=> - string(1) "1" - [23]=> - string(1) "2" - [24]=> - string(1) "3" - [25]=> - string(1) " " - [26]=> - string(1) "&" - [27]=> - string(1) " " - [28]=> - string(1) "e" - [29]=> - string(1) "s" - [30]=> - string(1) "c" - [31]=> - string(1) "a" - [32]=> - string(1) "p" - [33]=> - string(1) "e" - [34]=> - string(1) " " - [35]=> - string(1) "c" - [36]=> - string(1) "h" - [37]=> - string(1) "a" - [38]=> - string(1) "r" - [39]=> - string(1) " " - [40]=> - string(1) "\" - [41]=> - string(1) "t" -} --- Iteration 3 -- -str_split(): Argument #2 ($split_length) must be greater than 0 --- Iteration 4 -- -array(1) { - [0]=> - string(42) "This is a string with 123 & escape char \t" -} --- Iteration 5 -- -array(2) { - [0]=> - string(26) "This is a string with 123 " - [1]=> - string(16) "& escape char \t" -} --- Iteration 6 -- -array(1) { - [0]=> - string(42) "This is a string with 123 & escape char \t" -} --- Iteration 7 -- -array(1) { - [0]=> - string(42) "This is a string with 123 & escape char \t" -} --- Iteration 8 -- -str_split(): Argument #2 ($split_length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt index f38ad89c6033c..17e802b2406e7 100644 --- a/ext/standard/tests/strings/str_split_variation7.phpt +++ b/ext/standard/tests/strings/str_split_variation7.phpt @@ -1,9 +1,5 @@ --TEST-- Test str_split() function : usage variations - different integer values for 'split_length' with heredoc 'str' ---SKIPIF-- - --FILE-- @@ -106,7 +102,7 @@ array(30) { string(1) "." } -- Iteration 3 -- -str_split(): Argument #2 ($split_length) must be greater than 0 +str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- array(1) { [0]=> @@ -125,4 +121,4 @@ array(1) { string(30) "string with 123,escape char ." } -- Iteration 7 -- -str_split(): Argument #2 ($split_length) must be greater than 0 +str_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_split_variation7_64bit.phpt b/ext/standard/tests/strings/str_split_variation7_64bit.phpt deleted file mode 100644 index aa888ec846c96..0000000000000 --- a/ext/standard/tests/strings/str_split_variation7_64bit.phpt +++ /dev/null @@ -1,133 +0,0 @@ ---TEST-- -Test str_split() function : usage variations - different integer values for 'split_length' with heredoc 'str' ---SKIPIF-- - ---FILE-- -getMessage() . "\n"; - } -} -?> ---EXPECT-- -*** Testing str_split() : different integer values for 'split_length' with heredoc 'str' *** --- Iteration 1 -- -str_split(): Argument #2 ($split_length) must be greater than 0 --- Iteration 2 -- -array(30) { - [0]=> - string(1) "s" - [1]=> - string(1) "t" - [2]=> - string(1) "r" - [3]=> - string(1) "i" - [4]=> - string(1) "n" - [5]=> - string(1) "g" - [6]=> - string(1) " " - [7]=> - string(1) "w" - [8]=> - string(1) "i" - [9]=> - string(1) "t" - [10]=> - string(1) "h" - [11]=> - string(1) " " - [12]=> - string(1) "1" - [13]=> - string(1) "2" - [14]=> - string(1) "3" - [15]=> - string(1) "," - [16]=> - string(1) "e" - [17]=> - string(1) "s" - [18]=> - string(1) "c" - [19]=> - string(1) "a" - [20]=> - string(1) "p" - [21]=> - string(1) "e" - [22]=> - string(1) " " - [23]=> - string(1) "c" - [24]=> - string(1) "h" - [25]=> - string(1) "a" - [26]=> - string(1) "r" - [27]=> - string(1) " " - [28]=> - string(1) " " - [29]=> - string(1) "." -} --- Iteration 3 -- -str_split(): Argument #2 ($split_length) must be greater than 0 --- Iteration 4 -- -array(1) { - [0]=> - string(30) "string with 123,escape char ." -} --- Iteration 5 -- -array(2) { - [0]=> - string(26) "string with 123,escape cha" - [1]=> - string(4) "r ." -} --- Iteration 6 -- -array(1) { - [0]=> - string(30) "string with 123,escape char ." -} --- Iteration 7 -- -array(1) { - [0]=> - string(30) "string with 123,escape char ." -} --- Iteration 8 -- -str_split(): Argument #2 ($split_length) must be greater than 0 diff --git a/ext/standard/tests/strings/strcspn.phpt b/ext/standard/tests/strings/strcspn.phpt index d948655ef031e..7fc2ca3f4007a 100644 --- a/ext/standard/tests/strings/strcspn.phpt +++ b/ext/standard/tests/strings/strcspn.phpt @@ -9,7 +9,11 @@ var_dump($b); var_dump(strcspn($a,$b)); var_dump(strcspn($a,$b,9)); var_dump(strcspn($a,$b,9,6)); -var_dump(strcspn('a', 'B', 1, 2147483647)); +try { + var_dump(strcspn('a', 'B', 1, 2147483647)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECT-- string(25) "22222222aaaa bbb1111 cccc" @@ -17,4 +21,4 @@ string(4) "1234" int(0) int(7) int(6) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) diff --git a/ext/standard/tests/strings/strcspn_basic.phpt b/ext/standard/tests/strings/strcspn_basic.phpt index 88ef76619b7b2..5eac4c677df42 100644 --- a/ext/standard/tests/strings/strcspn_basic.phpt +++ b/ext/standard/tests/strings/strcspn_basic.phpt @@ -13,7 +13,7 @@ echo "*** Testing strcspn() : basic functionality ***\n"; $str = "this is the test string"; $mask = "es"; $start = 15; -$len = 30; +$len = 3; // Calling strcspn() with all possible arguments var_dump( strcspn($str, $mask, $start, $len) ); diff --git a/ext/standard/tests/strings/strcspn_variation11.phpt b/ext/standard/tests/strings/strcspn_variation11.phpt index f491177f6b9bc..0ff3c614c3718 100644 --- a/ext/standard/tests/strings/strcspn_variation11.phpt +++ b/ext/standard/tests/strings/strcspn_variation11.phpt @@ -62,7 +62,11 @@ foreach($strings as $str) { echo "\n-- Iteration $count --\n"; foreach($mask_array as $mask) { foreach($start_array as $start) { - var_dump( strcspn($str,$mask,$start) ); + try { + var_dump( strcspn($str,$mask,$start) ); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } } } $count++; @@ -75,219 +79,219 @@ echo "Done" -- Iteration 1 -- int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 2 -- int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 3 -- int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) -bool(false) -int(1) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) -int(1) -bool(false) -int(1) -int(0) -int(0) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 4 -- int(2) @@ -295,71 +299,71 @@ int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(0) int(1) int(0) -bool(false) -int(0) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(0) int(1) int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(0) int(1) int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(0) int(1) int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(0) int(1) int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 5 -- int(24) @@ -367,71 +371,71 @@ int(23) int(22) int(1) int(2) -bool(false) -int(24) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(24) int(23) int(22) int(1) int(2) -bool(false) -int(24) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(0) int(1) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(24) int(23) int(22) int(1) int(2) -bool(false) -int(24) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(24) int(23) int(22) int(1) int(2) -bool(false) -int(24) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(0) int(1) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 6 -- int(28) @@ -439,71 +443,71 @@ int(27) int(26) int(1) int(2) -bool(false) -int(28) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(28) int(27) int(26) int(1) int(2) -bool(false) -int(28) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(0) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(28) int(27) int(26) int(1) int(2) -bool(false) -int(28) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(0) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(0) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(0) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(28) int(27) int(26) int(1) int(2) -bool(false) -int(28) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(0) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 7 -- int(20) @@ -511,71 +515,71 @@ int(19) int(18) int(1) int(2) -bool(false) -int(20) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(20) int(19) int(18) int(1) int(2) -bool(false) -int(20) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(20) int(19) int(18) int(1) int(2) -bool(false) -int(20) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(20) int(19) int(18) int(1) int(2) -bool(false) -int(20) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 8 -- int(21) @@ -583,71 +587,71 @@ int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(21) int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(21) int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(21) int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 9 -- int(5) @@ -655,71 +659,71 @@ int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(0) int(1) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(12) int(11) int(10) int(1) int(2) -bool(false) -int(12) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(12) int(11) int(10) int(1) int(2) -bool(false) -int(12) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(12) int(11) int(10) int(1) int(2) -bool(false) -int(12) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(12) int(11) int(10) int(1) int(2) -bool(false) -int(12) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(12) int(11) int(10) int(1) int(2) -bool(false) -int(12) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(0) int(1) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 10 -- int(16) @@ -727,71 +731,71 @@ int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(16) int(15) int(14) int(1) int(2) -bool(false) -int(16) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 11 -- int(0) @@ -799,71 +803,71 @@ int(0) int(0) int(0) int(0) -bool(false) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -int(0) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 12 -- int(0) @@ -871,71 +875,71 @@ int(5) int(4) int(0) int(1) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(5) int(4) int(0) int(1) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(3) int(2) int(1) int(1) int(2) -bool(false) -int(3) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(3) int(2) int(1) int(1) int(2) -bool(false) -int(3) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(13) int(12) int(11) int(1) int(2) -bool(false) -int(13) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(13) int(12) int(11) int(1) int(2) -bool(false) -int(13) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(13) int(12) int(11) int(1) int(2) -bool(false) -int(13) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(13) int(12) int(11) int(1) int(2) -bool(false) -int(13) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(13) int(12) int(11) int(1) int(2) -bool(false) -int(13) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(13) int(12) int(11) int(1) int(2) -bool(false) -int(13) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 13 -- int(0) @@ -943,71 +947,71 @@ int(12) int(11) int(0) int(1) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(12) int(11) int(0) int(1) -bool(false) -int(0) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(3) int(2) int(1) int(1) int(2) -bool(false) -int(3) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(3) int(2) int(1) int(1) int(2) -bool(false) -int(3) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 14 -- int(5) @@ -1015,71 +1019,71 @@ int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 15 -- int(5) @@ -1087,71 +1091,71 @@ int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(11) int(10) int(9) int(1) int(2) -bool(false) -int(11) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 16 -- int(5) @@ -1159,71 +1163,71 @@ int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(14) int(13) int(12) int(1) int(2) -bool(false) -int(14) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(6) int(5) int(4) int(1) int(2) -bool(false) -int(6) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 17 -- int(21) @@ -1231,69 +1235,69 @@ int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(21) int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(0) -bool(false) -int(2) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(21) int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(21) int(20) int(19) int(1) int(2) -bool(false) -int(21) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(5) int(4) int(3) int(1) int(2) -bool(false) -int(5) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) Done diff --git a/ext/standard/tests/strings/strcspn_variation12.phpt b/ext/standard/tests/strings/strcspn_variation12.phpt index c4103e8a99ff3..d43ff90599bf8 100644 --- a/ext/standard/tests/strings/strcspn_variation12.phpt +++ b/ext/standard/tests/strings/strcspn_variation12.phpt @@ -63,7 +63,11 @@ foreach($strings as $str) { foreach($mask_array as $mask) { foreach($start_array as $start) { foreach($len_array as $len) { - var_dump( strcspn($str,$mask,$start,$len) ); + try { + var_dump( strcspn($str,$mask,$start,$len) ); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } } } } @@ -77,2399 +81,2399 @@ echo "Done" -- Iteration 1 -- int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 2 -- int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 3 -- -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 4 -- -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 5 -- -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(2) -int(21) -int(22) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(2) -int(21) -int(22) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(2) -int(21) -int(22) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) - --- Iteration 6 -- -int(0) -int(1) -int(2) -int(19) -int(20) -int(0) -int(0) -int(1) -int(2) -int(18) -int(19) -int(0) -int(0) -int(1) -int(2) -int(17) -int(18) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(19) -int(20) -int(0) -int(0) -int(1) -int(2) -int(19) -int(20) -int(0) -int(0) -int(1) -int(2) -int(18) -int(19) -int(0) -int(0) -int(1) -int(2) -int(17) -int(18) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(19) -int(20) -int(0) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) -int(0) -int(1) -int(2) -int(16) -int(16) -int(0) -int(0) -int(1) -int(2) -int(15) -int(15) -int(0) -int(0) -int(1) -int(2) -int(14) -int(14) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(16) -int(16) -int(0) -int(0) -int(1) -int(2) -int(19) -int(20) -int(0) -int(0) -int(1) -int(2) -int(18) -int(19) -int(0) -int(0) -int(1) -int(2) -int(17) -int(18) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(19) -int(20) -int(0) -int(0) -int(1) -int(2) -int(16) -int(16) -int(0) -int(0) -int(1) -int(2) -int(15) -int(15) -int(0) -int(0) -int(1) -int(2) -int(14) -int(14) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(16) -int(16) -int(0) - --- Iteration 7 -- -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(11) -int(12) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 3 -- int(0) int(1) -int(2) -int(10) -int(11) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 4 -- int(0) int(1) int(2) -int(9) -int(10) -int(0) -int(0) -int(1) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(11) -int(12) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(11) -int(12) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) -int(10) -int(11) -int(0) -int(0) int(1) -int(2) -int(9) -int(10) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(0) -int(1) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(11) -int(12) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -int(1) -int(2) -int(11) -int(11) int(0) int(0) -int(1) -int(2) -int(10) -int(10) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(9) -int(9) -int(0) -int(0) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) -int(11) -int(11) -int(0) - --- Iteration 8 -- +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 5 -- int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(1) +int(2) +int(23) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(22) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(21) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(23) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(22) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(21) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(1) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(23) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(22) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(21) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(1) +int(2) +int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 6 -- int(0) +int(1) +int(2) +int(19) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(18) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(17) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(19) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) int(2) -int(0) +int(18) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(1) +int(2) +int(17) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(6) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(16) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +int(2) +int(15) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) +int(2) +int(14) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(19) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) int(2) -int(0) +int(18) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(17) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) -int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) -int(1) +int(2) +int(16) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +int(2) +int(15) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(14) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 7 -- int(0) +int(1) +int(2) +int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -int(0) -int(1) int(1) +int(2) +int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(2) +int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(3) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) -int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) -int(1) int(2) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(1) -int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(0) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(11) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +int(2) +int(10) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) +int(2) +int(9) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(11) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) int(2) -int(0) +int(10) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(9) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) -int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) +int(2) +int(11) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) +int(2) +int(10) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +int(2) +int(9) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 8 -- int(0) int(0) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(1) -int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(1) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -int(1) -int(2) -int(1) -int(2) int(0) - --- Iteration 9 -- int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) -int(5) -int(5) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) -int(4) -int(4) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 9 -- int(0) int(0) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(5) -int(5) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(1) -int(0) int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(3) -int(3) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(11) -int(12) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) -int(0) -int(1) -int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(12) -int(13) -int(0) -int(0) -int(1) -int(2) -int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(11) -int(12) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(12) -int(13) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(11) -int(12) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 10 -- int(0) int(1) int(2) int(5) -int(5) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(5) -int(5) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(5) -int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(2) -int(2) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(1) int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) -int(1) -int(1) -int(0) -int(1) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(2) -int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(9) -int(10) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(8) -int(9) -int(0) -int(0) -int(1) -int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) -int(0) -int(1) -int(2) -int(10) -int(11) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(9) -int(10) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(8) -int(9) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(10) -int(11) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(9) -int(10) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(8) -int(9) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(10) -int(11) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 11 -- int(0) int(1) int(2) int(5) -int(5) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) -int(0) -int(1) -int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(5) -int(5) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(2) -int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(0) -int(1) int(1) int(1) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(2) -int(2) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(11) -int(12) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) -int(0) -int(1) -int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(12) -int(13) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(11) -int(12) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(10) -int(11) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(2) -int(12) -int(13) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(6) -int(6) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(5) -int(5) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(1) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strcspn(): Argument #3 ($offset) must be contained in argument #1 ($str) Done diff --git a/ext/standard/tests/strings/strcspn_variation7.phpt b/ext/standard/tests/strings/strcspn_variation7.phpt deleted file mode 100644 index 2b89e1efa328e..0000000000000 --- a/ext/standard/tests/strings/strcspn_variation7.phpt +++ /dev/null @@ -1,605 +0,0 @@ ---TEST-- -Test strcspn() function : usage variations - with heredoc strings, varying start and default len args ---FILE-- - ---EXPECT-- -*** Testing strcspn() : with different start values *** - --- Iteration 1 -- -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 2 -- -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) - --- Iteration 3 -- -int(86) -int(85) -int(84) -int(1) -int(2) -bool(false) -int(86) -int(86) -int(85) -int(84) -int(1) -int(2) -bool(false) -int(86) -int(1) -int(0) -int(0) -int(1) -int(2) -bool(false) -int(1) -int(1) -int(0) -int(0) -int(1) -int(0) -bool(false) -int(1) -int(86) -int(85) -int(84) -int(1) -int(2) -bool(false) -int(86) -int(4) -int(3) -int(2) -int(1) -int(2) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(1) -int(2) -bool(false) -int(4) -int(5) -int(4) -int(3) -int(1) -int(2) -bool(false) -int(5) -int(5) -int(4) -int(3) -int(1) -int(2) -bool(false) -int(5) -int(1) -int(0) -int(5) -int(1) -int(2) -bool(false) -int(1) - --- Iteration 4 -- -int(24) -int(23) -int(22) -int(1) -int(2) -bool(false) -int(24) -int(24) -int(23) -int(22) -int(1) -int(2) -bool(false) -int(24) -int(2) -int(1) -int(0) -int(0) -int(1) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(5) -int(4) -int(3) -int(1) -int(2) -bool(false) -int(5) -int(24) -int(23) -int(22) -int(1) -int(2) -bool(false) -int(24) -int(24) -int(23) -int(22) -int(1) -int(2) -bool(false) -int(24) -int(5) -int(4) -int(3) -int(1) -int(2) -bool(false) -int(5) -int(5) -int(4) -int(3) -int(1) -int(2) -bool(false) -int(5) -int(5) -int(4) -int(3) -int(1) -int(2) -bool(false) -int(5) - --- Iteration 5 -- -int(31) -int(30) -int(29) -int(1) -int(2) -bool(false) -int(31) -int(31) -int(30) -int(29) -int(1) -int(2) -bool(false) -int(31) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(26) -int(25) -int(24) -int(1) -int(2) -bool(false) -int(26) -int(31) -int(30) -int(29) -int(1) -int(2) -bool(false) -int(31) -int(31) -int(30) -int(29) -int(1) -int(2) -bool(false) -int(31) -int(26) -int(25) -int(24) -int(1) -int(2) -bool(false) -int(26) -int(26) -int(25) -int(24) -int(1) -int(2) -bool(false) -int(26) -int(26) -int(25) -int(24) -int(1) -int(2) -bool(false) -int(26) - --- Iteration 6 -- -int(5) -int(4) -int(3) -int(0) -int(1) -bool(false) -int(5) -int(5) -int(4) -int(3) -int(0) -int(1) -bool(false) -int(5) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(25) -int(24) -int(23) -int(1) -int(2) -bool(false) -int(25) -int(25) -int(24) -int(23) -int(1) -int(2) -bool(false) -int(25) -int(25) -int(24) -int(23) -int(1) -int(2) -bool(false) -int(25) -int(25) -int(24) -int(23) -int(1) -int(2) -bool(false) -int(25) -int(25) -int(24) -int(23) -int(1) -int(2) -bool(false) -int(25) -int(25) -int(24) -int(23) -int(1) -int(2) -bool(false) -int(25) - --- Iteration 7 -- -int(5) -int(4) -int(3) -int(0) -int(1) -bool(false) -int(5) -int(5) -int(4) -int(3) -int(0) -int(1) -bool(false) -int(5) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(27) -int(26) -int(25) -int(1) -int(2) -bool(false) -int(27) -int(27) -int(26) -int(25) -int(1) -int(2) -bool(false) -int(27) -int(27) -int(26) -int(25) -int(1) -int(2) -bool(false) -int(27) -int(27) -int(26) -int(25) -int(1) -int(2) -bool(false) -int(27) -int(27) -int(26) -int(25) -int(1) -int(2) -bool(false) -int(27) -int(6) -int(5) -int(4) -int(1) -int(2) -bool(false) -int(6) -Done diff --git a/ext/standard/tests/strings/strcspn_variation8.phpt b/ext/standard/tests/strings/strcspn_variation8.phpt deleted file mode 100644 index 6689d2b52fdc2..0000000000000 --- a/ext/standard/tests/strings/strcspn_variation8.phpt +++ /dev/null @@ -1,1885 +0,0 @@ ---TEST-- -Test strcspn() function : usage variations - with heredoc strings, varying start and len args ---FILE-- - ---EXPECT-- -*** Testing strcspn() : with different start and len values *** - --- Iteration 1 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) - --- Iteration 3 -- -int(0) -int(1) -int(2) -int(85) -int(86) -int(0) -int(0) -int(1) -int(2) -int(84) -int(85) -int(0) -int(0) -int(1) -int(2) -int(83) -int(84) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(85) -int(86) -int(0) -int(0) -int(1) -int(2) -int(85) -int(86) -int(0) -int(0) -int(1) -int(2) -int(84) -int(85) -int(0) -int(0) -int(1) -int(2) -int(83) -int(84) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(85) -int(86) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(2) -int(85) -int(86) -int(0) -int(0) -int(1) -int(2) -int(84) -int(85) -int(0) -int(0) -int(1) -int(2) -int(83) -int(84) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(85) -int(86) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) - --- Iteration 4 -- -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(2) -int(21) -int(22) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(2) -int(21) -int(22) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(2) -int(21) -int(22) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) - --- Iteration 5 -- -int(0) -int(1) -int(2) -int(30) -int(31) -int(0) -int(0) -int(1) -int(2) -int(29) -int(30) -int(0) -int(0) -int(1) -int(2) -int(28) -int(29) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(30) -int(31) -int(0) -int(0) -int(1) -int(2) -int(30) -int(31) -int(0) -int(0) -int(1) -int(2) -int(29) -int(30) -int(0) -int(0) -int(1) -int(2) -int(28) -int(29) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(30) -int(31) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(26) -int(26) -int(0) -int(0) -int(1) -int(2) -int(25) -int(25) -int(0) -int(0) -int(1) -int(2) -int(24) -int(24) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(26) -int(26) -int(0) -int(0) -int(1) -int(2) -int(30) -int(31) -int(0) -int(0) -int(1) -int(2) -int(29) -int(30) -int(0) -int(0) -int(1) -int(2) -int(28) -int(29) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(30) -int(31) -int(0) -int(0) -int(1) -int(2) -int(26) -int(26) -int(0) -int(0) -int(1) -int(2) -int(25) -int(25) -int(0) -int(0) -int(1) -int(2) -int(24) -int(24) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(26) -int(26) -int(0) -int(0) -int(1) -int(2) -int(26) -int(26) -int(0) -int(0) -int(1) -int(2) -int(25) -int(25) -int(0) -int(0) -int(1) -int(2) -int(24) -int(24) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(26) -int(26) -int(0) - --- Iteration 6 -- -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(2) -int(23) -int(24) -int(0) -int(0) -int(1) -int(2) -int(22) -int(23) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) - --- Iteration 7 -- -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(26) -int(27) -int(0) -int(0) -int(1) -int(2) -int(25) -int(26) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(26) -int(27) -int(0) -int(0) -int(1) -int(2) -int(26) -int(27) -int(0) -int(0) -int(1) -int(2) -int(25) -int(26) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(26) -int(27) -int(0) -int(0) -int(1) -int(2) -int(26) -int(27) -int(0) -int(0) -int(1) -int(2) -int(25) -int(26) -int(0) -int(0) -int(1) -int(2) -int(24) -int(25) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(26) -int(27) -int(0) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) -int(0) -int(1) -int(2) -int(5) -int(5) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) -Done diff --git a/ext/standard/tests/strings/strip_tags_variation2.phpt b/ext/standard/tests/strings/strip_tags_variation2.phpt index 640e353ab2b81..421f8a62ae4ea 100644 --- a/ext/standard/tests/strings/strip_tags_variation2.phpt +++ b/ext/standard/tests/strings/strip_tags_variation2.phpt @@ -125,5 +125,5 @@ string(10) "helloworld" -- Iteration 20 -- string(10) "helloworld" -- Iteration 21 -- -strip_tags(): Argument #2 ($allowable_tags) must be of type array|string|null, resource given +strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given Done diff --git a/ext/standard/tests/strings/strpbrk_error.phpt b/ext/standard/tests/strings/strpbrk_error.phpt index 78550ab009b9a..3d7f84e948bfb 100644 --- a/ext/standard/tests/strings/strpbrk_error.phpt +++ b/ext/standard/tests/strings/strpbrk_error.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- -- Testing strpbrk() function with empty second argument -- -strpbrk(): Argument #2 ($char_list) must be a non-empty string +strpbrk(): Argument #2 ($characters) must be a non-empty string diff --git a/ext/standard/tests/strings/strspn_basic.phpt b/ext/standard/tests/strings/strspn_basic.phpt index 068610a89bab4..4712eeb87ee85 100644 --- a/ext/standard/tests/strings/strspn_basic.phpt +++ b/ext/standard/tests/strings/strspn_basic.phpt @@ -13,7 +13,7 @@ echo "*** Testing strspn() : basic functionality ***\n"; $str = "this is the test string"; $mask = "htes "; $start = 8; -$len = 30; +$len = 12; // Calling strspn() with all possible arguments var_dump( strspn($str, $mask, $start, $len) ); diff --git a/ext/standard/tests/strings/strspn_variation11.phpt b/ext/standard/tests/strings/strspn_variation11.phpt index 6692ce641b8c7..c66e86b7f570c 100644 --- a/ext/standard/tests/strings/strspn_variation11.phpt +++ b/ext/standard/tests/strings/strspn_variation11.phpt @@ -62,7 +62,11 @@ foreach($strings as $str) { echo "\n-- Iteration $count --\n"; foreach($mask_array as $mask) { foreach($start_array as $start) { - var_dump( strspn($str,$mask,$start) ); + try { + var_dump( strspn($str,$mask,$start) ); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } } } $count++; @@ -75,219 +79,219 @@ echo "Done" -- Iteration 1 -- int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 2 -- int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 3 -- int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) -bool(false) -int(1) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) -bool(false) -int(1) -int(1) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 4 -- int(0) @@ -295,71 +299,71 @@ int(0) int(0) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) int(0) int(0) int(1) -bool(false) -int(1) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(2) int(1) int(0) int(1) int(2) -bool(false) -int(2) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) int(0) int(0) int(1) -bool(false) -int(1) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) int(0) int(0) int(1) -bool(false) -int(1) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) int(0) int(0) int(1) -bool(false) -int(1) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(1) int(0) int(0) int(0) int(1) -bool(false) -int(1) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 5 -- int(0) @@ -367,71 +371,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(1) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(1) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 6 -- int(0) @@ -439,71 +443,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(1) int(2) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(1) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 7 -- int(0) @@ -511,71 +515,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) int(0) int(0) int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 8 -- int(0) @@ -583,71 +587,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 9 -- int(0) @@ -655,71 +659,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(1) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(1) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 10 -- int(0) @@ -727,71 +731,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(0) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 11 -- int(0) @@ -799,71 +803,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) int(0) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) int(0) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) int(0) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 12 -- int(0) @@ -871,71 +875,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 13 -- int(0) @@ -943,71 +947,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(4) int(3) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 14 -- int(0) @@ -1015,71 +1019,71 @@ int(0) int(0) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 15 -- int(0) @@ -1087,71 +1091,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 16 -- int(0) @@ -1159,71 +1163,71 @@ int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) -- Iteration 17 -- int(0) @@ -1231,69 +1235,69 @@ int(0) int(0) int(0) int(0) -bool(false) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) int(0) -bool(false) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) -int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) int(0) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(4) int(3) int(2) int(0) int(1) -bool(false) -int(4) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) Done diff --git a/ext/standard/tests/strings/strspn_variation12.phpt b/ext/standard/tests/strings/strspn_variation12.phpt index 6f5fddb527004..a43b85a696760 100644 --- a/ext/standard/tests/strings/strspn_variation12.phpt +++ b/ext/standard/tests/strings/strspn_variation12.phpt @@ -63,7 +63,11 @@ foreach($strings as $str) { foreach($mask_array as $mask) { foreach($start_array as $start) { foreach($len_array as $len) { - var_dump( strspn($str,$mask,$start,$len) ); + try { + var_dump( strspn($str,$mask,$start,$len) ); + } catch (ValueError $e) { + echo $e->getMessage(), "\n"; + } } } } @@ -77,2795 +81,2795 @@ echo "Done" -- Iteration 1 -- int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 2 -- int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 3 -- int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 4 -- int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(1) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(1) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(1) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 5 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) --- Iteration 2 -- +-- Iteration 6 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 7 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) - --- Iteration 3 -- int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 8 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -int(1) -int(1) int(0) -int(1) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) -int(1) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) -int(1) -int(1) int(0) -int(1) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 9 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) -int(1) -int(1) int(0) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -int(1) -int(1) int(0) -int(1) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) -int(1) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) - --- Iteration 4 -- -int(0) -int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 10 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -int(1) -int(1) -int(1) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) -int(1) -int(1) -int(1) -int(0) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +int(0) int(1) int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) -int(1) -int(1) -int(0) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) -int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) -int(1) int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) + +-- Iteration 11 -- int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) int(0) int(0) -int(1) -int(1) -int(1) -int(1) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(4) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(3) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) +int(1) +int(2) +int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 8 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 9 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 10 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 11 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(2) -int(2) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(2) -int(2) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) int(0) int(1) int(2) int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(3) -int(3) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(1) int(2) int(2) -int(2) -int(0) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #4 ($length) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) +strspn(): Argument #3 ($offset) must be contained in argument #1 ($str) Done diff --git a/ext/standard/tests/strings/strspn_variation7.phpt b/ext/standard/tests/strings/strspn_variation7.phpt deleted file mode 100644 index 02b1286dca6fd..0000000000000 --- a/ext/standard/tests/strings/strspn_variation7.phpt +++ /dev/null @@ -1,605 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with heredoc strings, varying start and default len args ---FILE-- - ---EXPECT-- -*** Testing strspn() : with different start values *** - --- Iteration 1 -- -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) -int(0) -bool(false) -bool(false) -int(0) -int(0) -bool(false) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(2) -bool(false) -int(2) - --- Iteration 3 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(8) -int(7) -int(6) -int(0) -int(0) -bool(false) -int(8) -int(11) -int(10) -int(9) -int(0) -int(1) -bool(false) -int(11) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) - --- Iteration 4 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(1) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(1) -int(0) -bool(false) -int(2) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(4) -int(3) -int(2) -int(0) -int(0) -bool(false) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -int(0) -int(2) -int(1) -int(0) -int(0) -int(0) -bool(false) -int(2) -Done diff --git a/ext/standard/tests/strings/strspn_variation8.phpt b/ext/standard/tests/strings/strspn_variation8.phpt deleted file mode 100644 index 58013a6dbafae..0000000000000 --- a/ext/standard/tests/strings/strspn_variation8.phpt +++ /dev/null @@ -1,1887 +0,0 @@ ---TEST-- -Test strspn() function : usage variations - with heredoc strings, varying start and len args ---FILE-- - ---EXPECT-- -*** Testing strspn() : with different start and len values *** - --- Iteration 1 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 2 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(1) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) - --- Iteration 3 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(8) -int(8) -int(0) -int(0) -int(1) -int(2) -int(7) -int(7) -int(0) -int(0) -int(1) -int(2) -int(6) -int(6) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(8) -int(8) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) - --- Iteration 4 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(0) -int(1) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 5 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 6 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) - --- Iteration 7 -- -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(1) -int(1) -int(1) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -int(0) -int(1) -int(2) -int(3) -int(3) -int(0) -int(0) -int(1) -int(2) -int(2) -int(2) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -int(0) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) -int(0) -int(1) -int(2) -int(4) -int(4) -int(0) -Done diff --git a/ext/standard/tests/strings/substr.phpt b/ext/standard/tests/strings/substr.phpt index 5addfdf2421c1..99dcd2bf2f0c0 100644 Binary files a/ext/standard/tests/strings/substr.phpt and b/ext/standard/tests/strings/substr.phpt differ diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt index d52983646acc5..165cc1e6913d1 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -10,34 +10,22 @@ echo "*** Testing substr_replace() : error conditions ***\n"; $s1 = "Good morning"; -echo "\n-- Testing substr_replace() function with start and length different types --\n"; -var_dump(substr_replace($s1, "evening", array(5))); -var_dump(substr_replace($s1, "evening", 5, array(8))); - -echo "\n-- Testing substr_replace() function with start and length with a different number of elements --\n"; -var_dump(substr_replace($s1, "evening", array(5, 1), array(8))); - echo "\n-- Testing substr_replace() function with start and length as arrays but string not--\n"; -var_dump(substr_replace($s1, "evening", array(5), array(8))); +try { + var_dump(substr_replace($s1, "evening", array(5))); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(substr_replace($s1, "evening", 5, array(1))); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- *** Testing substr_replace() : error conditions *** --- Testing substr_replace() function with start and length different types -- - -Warning: substr_replace(): 'start' and 'length' should be of same type - numerical or array in %s on line %d -string(12) "Good morning" - -Warning: substr_replace(): 'start' and 'length' should be of same type - numerical or array in %s on line %d -string(12) "Good morning" - --- Testing substr_replace() function with start and length with a different number of elements -- - -Warning: substr_replace(): 'start' and 'length' should have the same number of elements in %s on line %d -string(12) "Good morning" - -- Testing substr_replace() function with start and length as arrays but string not-- - -Warning: substr_replace(): Functionality of 'start' and 'length' as arrays is not implemented in %s on line %d -string(12) "Good morning" +substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string +substr_replace(): Argument #4 ($length) cannot be an array when working on a single string diff --git a/ext/standard/tests/strings/unpack.phpt b/ext/standard/tests/strings/unpack.phpt deleted file mode 100644 index 435361cca54a6..0000000000000 --- a/ext/standard/tests/strings/unpack.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Invalid format type validation ---FILE-- - ---EXPECTF-- -Warning: unpack(): Invalid format type - in %sunpack.php on line %d -bool(false) -Done diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt index 5da3cee273372..c41185b23acef 100644 --- a/ext/standard/tests/strings/unpack_error.phpt +++ b/ext/standard/tests/strings/unpack_error.phpt @@ -3,16 +3,12 @@ Test unpack() function : error conditions --FILE-- getMessage(), "\n"; +} -echo "\n-- Testing unpack() function with invalid format character --\n"; -$extra_arg = 10; -var_dump(unpack("B", pack("I", 65534))); ?> ---EXPECTF-- -*** Testing unpack() : error conditions *** - --- Testing unpack() function with invalid format character -- - -Warning: unpack(): Invalid format type B in %s on line %d -bool(false) +--EXPECT-- +Invalid format type B diff --git a/ext/standard/tests/strings/unpack_offset.phpt b/ext/standard/tests/strings/unpack_offset.phpt index 451dd367246b0..bd787859c11af 100644 --- a/ext/standard/tests/strings/unpack_offset.phpt +++ b/ext/standard/tests/strings/unpack_offset.phpt @@ -10,7 +10,20 @@ printf("0x%08x 0x%08x\n", $a[1], $a[2]); printf("0x%08x 0x%08x\n", unpack("l", $data, 3)[1], unpack("@4/l", $data, 3)[1]); + +try { + unpack("l", "foo", 10); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} +try { + unpack("l", "foo", -1); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECT-- 0x01020304 0x05060708 0x01020304 0x05060708 +unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) +unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) diff --git a/ext/standard/tests/strings/uuencode.phpt b/ext/standard/tests/strings/uuencode.phpt index b0a2a2321d025..d03c2b1bf0f37 100644 --- a/ext/standard/tests/strings/uuencode.phpt +++ b/ext/standard/tests/strings/uuencode.phpt @@ -3,20 +3,22 @@ uuencode family tests --FILE-- --EXPECTF-- -bool(false) -bool(false) +string(2) "` +" +string(0) "" string(60) "J?B%`(R0E7B8J*"E??7M03TE5651215=145-$1D=(2DM,.CQ-3D)60UA: ` " @@ -27,6 +29,9 @@ string(36) "6;F]T('9E --EXPECT-- -- Testing vfprintf() function with other strangeties -- -vfprintf(): Argument #1 ($handle) must be of type resource, string given +vfprintf(): Argument #1 ($stream) must be of type resource, string given Error found: Argument number must be greater than zero. diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt index c9274d383bec4..36d983817024f 100644 --- a/ext/standard/tests/strings/vfprintf_variation1.phpt +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -60,7 +60,7 @@ unlink( $file ); ?> --EXPECT-- *** Testing vfprintf() : variation functionality *** -vfprintf(): Argument #3 ($args) must be of type array, null given +vfprintf(): Argument #3 ($values) must be of type array, null given string(17) "Foo is 30 and bar" int(17) string(14) "Foobar testing" diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt index 1f04a6395dd35..22f2f152d85a2 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -99,70 +99,70 @@ fclose($file_handle); *** Testing vprintf() : with unexpected values for args argument *** -- Iteration 1 -- -vprintf(): Argument #2 ($args) must be of type array, int given +vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 2 -- -vprintf(): Argument #2 ($args) must be of type array, int given +vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 3 -- -vprintf(): Argument #2 ($args) must be of type array, int given +vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 4 -- -vprintf(): Argument #2 ($args) must be of type array, int given +vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 5 -- -vprintf(): Argument #2 ($args) must be of type array, float given +vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 6 -- -vprintf(): Argument #2 ($args) must be of type array, float given +vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 7 -- -vprintf(): Argument #2 ($args) must be of type array, float given +vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 8 -- -vprintf(): Argument #2 ($args) must be of type array, float given +vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 9 -- -vprintf(): Argument #2 ($args) must be of type array, float given +vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 10 -- -vprintf(): Argument #2 ($args) must be of type array, null given +vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 11 -- -vprintf(): Argument #2 ($args) must be of type array, null given +vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 12 -- -vprintf(): Argument #2 ($args) must be of type array, bool given +vprintf(): Argument #2 ($values) must be of type array, bool given -- Iteration 13 -- -vprintf(): Argument #2 ($args) must be of type array, bool given +vprintf(): Argument #2 ($values) must be of type array, bool given -- Iteration 14 -- -vprintf(): Argument #2 ($args) must be of type array, bool given +vprintf(): Argument #2 ($values) must be of type array, bool given -- Iteration 15 -- -vprintf(): Argument #2 ($args) must be of type array, bool given +vprintf(): Argument #2 ($values) must be of type array, bool given -- Iteration 16 -- -vprintf(): Argument #2 ($args) must be of type array, string given +vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 17 -- -vprintf(): Argument #2 ($args) must be of type array, string given +vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 18 -- -vprintf(): Argument #2 ($args) must be of type array, string given +vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 19 -- -vprintf(): Argument #2 ($args) must be of type array, string given +vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 20 -- -vprintf(): Argument #2 ($args) must be of type array, sample given +vprintf(): Argument #2 ($values) must be of type array, sample given -- Iteration 21 -- -vprintf(): Argument #2 ($args) must be of type array, null given +vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 22 -- -vprintf(): Argument #2 ($args) must be of type array, null given +vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 23 -- -vprintf(): Argument #2 ($args) must be of type array, resource given +vprintf(): Argument #2 ($values) must be of type array, resource given diff --git a/ext/standard/tests/strings/wordwrap_error.phpt b/ext/standard/tests/strings/wordwrap_error.phpt index 26020f1e17da8..b93bb80565b89 100644 --- a/ext/standard/tests/strings/wordwrap_error.phpt +++ b/ext/standard/tests/strings/wordwrap_error.phpt @@ -47,7 +47,7 @@ var_dump( wordwrap($str, $width, $break, $cut) ); -- width = 0 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" -- width = 0 & cut = true -- -wordwrap(): Argument #4 ($cut) cannot be true when argument #2 ($width) is 0 +wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0 -- width = -10 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" -- width = -10 & cut = true -- diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 990a8e6420608..b62e8a2d7cde9 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -500,10 +500,6 @@ PHP_FUNCTION(stream_bucket_new) bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream)); - if (bucket == NULL) { - RETURN_FALSE; - } - ZVAL_RES(&zbucket, zend_register_resource(bucket, le_bucket)); object_init(return_value); add_property_zval(return_value, "bucket", &zbucket); diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index c11668b3a778b..7543521839116 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -133,6 +133,10 @@ PHPAPI zend_string *php_uudecode(const char *src, size_t src_len) /* {{{ */ const char *s, *e, *ee; zend_string *dest; + if (src_len == 0) { + return NULL; + } + dest = zend_string_alloc((size_t) ceil(src_len * 0.75), 0); p = ZSTR_VAL(dest); s = src; @@ -204,7 +208,6 @@ PHP_FUNCTION(convert_uuencode) ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(src) ZEND_PARSE_PARAMETERS_END(); - if (ZSTR_LEN(src) < 1) { RETURN_FALSE; } RETURN_STR(php_uuencode(ZSTR_VAL(src), ZSTR_LEN(src))); } @@ -219,7 +222,6 @@ PHP_FUNCTION(convert_uudecode) ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(src) ZEND_PARSE_PARAMETERS_END(); - if (ZSTR_LEN(src) < 1) { RETURN_FALSE; } if ((dest = php_uudecode(ZSTR_VAL(src), ZSTR_LEN(src))) == NULL) { php_error_docref(NULL, E_WARNING, "Argument #1 ($data) is not a valid uuencoded string"); diff --git a/ext/sysvshm/tests/001.phpt b/ext/sysvshm/tests/001.phpt index e9d00bc6dc24c..487d862e8f55e 100644 --- a/ext/sysvshm/tests/001.phpt +++ b/ext/sysvshm/tests/001.phpt @@ -33,9 +33,9 @@ var_dump(ftok(__FILE__,"q")); echo "Done\n"; ?> --EXPECTF-- -ftok(): Argument #1 ($pathname) cannot be empty -ftok(): Argument #2 ($proj) must be a single character -ftok(): Argument #2 ($proj) must be a single character +ftok(): Argument #1 ($filename) cannot be empty +ftok(): Argument #2 ($project_id) must be a single character +ftok(): Argument #2 ($project_id) must be a single character Warning: ftok(): ftok() failed - No such file or directory in %s on line %d int(-1) diff --git a/ext/tokenizer/tokenizer.stub.php b/ext/tokenizer/tokenizer.stub.php index 72d61ad8560a2..a3a4246a1af6a 100644 --- a/ext/tokenizer/tokenizer.stub.php +++ b/ext/tokenizer/tokenizer.stub.php @@ -2,9 +2,9 @@ /** @generate-function-entries */ -function token_get_all(string $source, int $flags = 0): array {} +function token_get_all(string $code, int $flags = 0): array {} -function token_name(int $token): string {} +function token_name(int $id): string {} class PhpToken implements Stringable { diff --git a/ext/tokenizer/tokenizer_arginfo.h b/ext/tokenizer/tokenizer_arginfo.h index 6e313cd0de384..8bf694074e2e1 100644 --- a/ext/tokenizer/tokenizer_arginfo.h +++ b/ext/tokenizer/tokenizer_arginfo.h @@ -1,19 +1,16 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d8e8b4d749c2960b33fd20b27a1abf033604d4e2 */ + * Stub hash: ef39f4efec05a3ebc5cf56a6b26e01369f00d129 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_get_all, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_token_name, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, token, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PhpToken_getAll, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") -ZEND_END_ARG_INFO() +#define arginfo_class_PhpToken_getAll arginfo_token_get_all ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PhpToken___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0) diff --git a/ext/xml/tests/xml_parser_set_option_variation3.phpt b/ext/xml/tests/xml_parser_set_option_variation3.phpt index d1163de356e0b..a6b3a9b6ecab4 100644 --- a/ext/xml/tests/xml_parser_set_option_variation3.phpt +++ b/ext/xml/tests/xml_parser_set_option_variation3.phpt @@ -162,7 +162,7 @@ bool(true) Arg value Some Ascii Data -Notice: Object of class aClass could not be converted to int in %s on line %d +Warning: Object of class aClass could not be converted to int in %s on line %d bool(true) Arg value Resource id %s diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 6ccd23b37ea66..61e4a3a7d9579 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -88,10 +88,10 @@ static zend_object *xmlwriter_object_new(zend_class_entry *class_type) } /* }}} */ -#define XMLW_NAME_CHK(__err) \ +#define XMLW_NAME_CHK(__arg_no, __subject) \ if (xmlValidateName((xmlChar *) name, 0) != 0) { \ - php_error_docref(NULL, E_WARNING, "%s", __err); \ - RETURN_FALSE; \ + zend_argument_value_error(__arg_no, "must be a valid %s, \"%s\" given", __subject, name); \ + RETURN_THROWS(); \ } \ /* {{{ function prototypes */ @@ -199,7 +199,7 @@ static void xmlwriter_objects_clone(void *object, void **object_clone) } }}} */ -static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_one_char_t internal_function, char *err_string) +static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_one_char_t internal_function, char *subject_name) { xmlTextWriterPtr ptr; char *name; @@ -212,8 +212,8 @@ static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_rea } XMLWRITER_FROM_OBJECT(ptr, self); - if (err_string != NULL) { - XMLW_NAME_CHK(err_string); + if (subject_name != NULL) { + XMLW_NAME_CHK(2, subject_name); } if (ptr) { @@ -281,7 +281,7 @@ PHP_FUNCTION(xmlwriter_set_indent_string) /* {{{ Create start attribute - returns FALSE on error */ PHP_FUNCTION(xmlwriter_start_attribute) { - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartAttribute, "Invalid Attribute Name"); + php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartAttribute, "attribute name"); } /* }}} */ @@ -307,7 +307,7 @@ PHP_FUNCTION(xmlwriter_start_attribute_ns) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Attribute Name"); + XMLW_NAME_CHK(3, "attribute name"); if (ptr) { retval = xmlTextWriterStartAttributeNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri); @@ -335,7 +335,7 @@ PHP_FUNCTION(xmlwriter_write_attribute) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Attribute Name"); + XMLW_NAME_CHK(2, "attribute name"); if (ptr) { retval = xmlTextWriterWriteAttribute(ptr, (xmlChar *)name, (xmlChar *)content); @@ -363,7 +363,7 @@ PHP_FUNCTION(xmlwriter_write_attribute_ns) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Attribute Name"); + XMLW_NAME_CHK(3, "attribute name"); if (ptr) { retval = xmlTextWriterWriteAttributeNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri, (xmlChar *)content); @@ -379,7 +379,7 @@ PHP_FUNCTION(xmlwriter_write_attribute_ns) /* {{{ Create start element tag - returns FALSE on error */ PHP_FUNCTION(xmlwriter_start_element) { - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartElement, "Invalid Element Name"); + php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartElement, "element name"); } /* }}} */ @@ -398,7 +398,7 @@ PHP_FUNCTION(xmlwriter_start_element_ns) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Element Name"); + XMLW_NAME_CHK(3, "element name"); if (ptr) { retval = xmlTextWriterStartElementNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri); @@ -441,7 +441,7 @@ PHP_FUNCTION(xmlwriter_write_element) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Element Name"); + XMLW_NAME_CHK(2, "element name"); if (ptr) { if (!content) { @@ -480,7 +480,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Element Name"); + XMLW_NAME_CHK(3, "element name"); if (ptr) { if (!content) { @@ -507,7 +507,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns) /* {{{ Create start PI tag - returns FALSE on error */ PHP_FUNCTION(xmlwriter_start_pi) { - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartPI, "Invalid PI Target"); + php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartPI, "PI target"); } /* }}} */ @@ -533,7 +533,7 @@ PHP_FUNCTION(xmlwriter_write_pi) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid PI Target"); + XMLW_NAME_CHK(2, "PI target"); if (ptr) { retval = xmlTextWriterWritePI(ptr, (xmlChar *)name, (xmlChar *)content); @@ -726,7 +726,7 @@ PHP_FUNCTION(xmlwriter_write_dtd) /* {{{ Create start DTD element - returns FALSE on error */ PHP_FUNCTION(xmlwriter_start_dtd_element) { - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDElement, "Invalid Element Name"); + php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDElement, "element name"); } /* }}} */ @@ -752,7 +752,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_element) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Element Name"); + XMLW_NAME_CHK(2, "element name"); if (ptr) { retval = xmlTextWriterWriteDTDElement(ptr, (xmlChar *)name, (xmlChar *)content); @@ -768,7 +768,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_element) /* {{{ Create start DTD AttList - returns FALSE on error */ PHP_FUNCTION(xmlwriter_start_dtd_attlist) { - php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDAttlist, "Invalid Element Name"); + php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDAttlist, "element name"); } /* }}} */ @@ -794,7 +794,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_attlist) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Element Name"); + XMLW_NAME_CHK(2, "element name"); if (ptr) { retval = xmlTextWriterWriteDTDAttlist(ptr, (xmlChar *)name, (xmlChar *)content); @@ -822,7 +822,7 @@ PHP_FUNCTION(xmlwriter_start_dtd_entity) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Attribute Name"); + XMLW_NAME_CHK(2, "attribute name"); if (ptr) { retval = xmlTextWriterStartDTDEntity(ptr, isparm, (xmlChar *)name); @@ -862,7 +862,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_entity) } XMLWRITER_FROM_OBJECT(ptr, self); - XMLW_NAME_CHK("Invalid Element Name"); + XMLW_NAME_CHK(2, "element name"); if (ptr) { retval = xmlTextWriterWriteDTDEntity(ptr, pe, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid, (xmlChar *)ndataid, (xmlChar *)content); diff --git a/ext/xmlwriter/tests/010.phpt b/ext/xmlwriter/tests/010.phpt index 2ae160fad83d1..4c9b099a6801a 100644 --- a/ext/xmlwriter/tests/010.phpt +++ b/ext/xmlwriter/tests/010.phpt @@ -14,12 +14,27 @@ $xw = xmlwriter_open_uri($file); var_dump(xmlwriter_start_element($xw, "tag")); var_dump(xmlwriter_start_attribute($xw, "attr")); var_dump(xmlwriter_end_attribute($xw)); -var_dump(xmlwriter_start_attribute($xw, "-1")); + +try { + xmlwriter_start_attribute($xw, "-1"); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} + var_dump(xmlwriter_end_attribute($xw)); -var_dump(xmlwriter_start_attribute($xw, "\"")); + +try { + xmlwriter_start_attribute($xw, "\""); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} + var_dump(xmlwriter_end_attribute($xw)); var_dump(xmlwriter_end_element($xw)); +// Force to write and empty the buffer +xmlwriter_flush($xw, empty: true); + unset($xw); var_dump(file_get_contents($file)); @@ -32,13 +47,9 @@ echo "Done\n"; bool(true) bool(true) bool(true) - -Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d -bool(false) -bool(false) - -Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d +xmlwriter_start_attribute(): Argument #2 ($name) must be a valid attribute name, "-1" given bool(false) +xmlwriter_start_attribute(): Argument #2 ($name) must be a valid attribute name, """ given bool(false) bool(true) string(14) "" diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 44debcaca744e..300b196d03c69 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -111,7 +111,6 @@ zend_object *xsl_objects_new(zend_class_entry *class_type) /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(xsl) { - zend_class_entry ce; memcpy(&xsl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -119,7 +118,10 @@ PHP_MINIT_FUNCTION(xsl) xsl_object_handlers.clone_obj = NULL; xsl_object_handlers.free_obj = xsl_objects_free_storage; - REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, class_XSLTProcessor_methods, xsl_xsltprocessor_class_entry); + INIT_CLASS_ENTRY(ce, "XSLTProcessor", class_XSLTProcessor_methods); + ce.create_object = xsl_objects_new; + xsl_xsltprocessor_class_entry = zend_register_internal_class(&ce); + #ifdef HAVE_XSL_EXSLT exsltRegisterAll(); #endif diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index 6085925024396..41e2c0b4e6169 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -80,19 +80,6 @@ void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs); void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs); -#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \ -INIT_CLASS_ENTRY(ce, name, funcs); \ -ce.create_object = xsl_objects_new; \ -entry = zend_register_internal_class_ex(&ce, parent_ce); - -#define XSL_DOMOBJ_NEW(zval, obj, ret) \ - zval = php_xsl_create_object(obj, ret, zval, return_value); \ - if (ZVAL_IS_NULL(zval)) { \ - php_error_docref(NULL, E_WARNING, "Cannot create required DOM object"); \ - RETURN_FALSE; \ - } - - PHP_MINIT_FUNCTION(xsl); PHP_MSHUTDOWN_FUNCTION(xsl); PHP_RINIT_FUNCTION(xsl); diff --git a/ext/xsl/tests/xsltprocessor_importStylesheet-invalidparam.phpt b/ext/xsl/tests/xsltprocessor_importStylesheet-invalidparam.phpt index 91bd07cf8a121..3849f69428aff 100644 --- a/ext/xsl/tests/xsltprocessor_importStylesheet-invalidparam.phpt +++ b/ext/xsl/tests/xsltprocessor_importStylesheet-invalidparam.phpt @@ -11,9 +11,12 @@ if (!extension_loaded('xsl')) { $xslt = new XSLTProcessor(); $dummy = new stdClass(); -var_dump($xslt->importStylesheet($dummy)); +try { + var_dump($xslt->importStylesheet($dummy)); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: Invalid Document in %s on line %d -bool(false) +--EXPECT-- +XSLTProcessor::importStylesheet(): Argument #1 ($stylesheet) must be a valid XML node diff --git a/ext/xsl/tests/xsltprocessor_transformToDoc_no_stylesheet.phpt b/ext/xsl/tests/xsltprocessor_transformToDoc_no_stylesheet.phpt new file mode 100644 index 0000000000000..c590b694fa005 --- /dev/null +++ b/ext/xsl/tests/xsltprocessor_transformToDoc_no_stylesheet.phpt @@ -0,0 +1,17 @@ +--TEST-- +Calling XSLTProcessor::transformToDoc() without stylesheet +--FILE-- +transformToDoc($doc); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +XSLTProcessor::transformToDoc() can only be called after a stylesheet has been imported diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index deac062bfab09..9498ba576c6e2 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -66,27 +66,22 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params) memset((char *)params, 0, parsize); ZEND_HASH_FOREACH_STR_KEY_VAL(parht, string_key, value) { - if (string_key == NULL) { - php_error_docref(NULL, E_WARNING, "Invalid argument or parameter array"); - efree(params); - return NULL; - } else { - if (Z_TYPE_P(value) != IS_STRING) { - if (!try_convert_to_string(value)) { - efree(params); - return NULL; - } + ZEND_ASSERT(string_key != NULL); + if (Z_TYPE_P(value) != IS_STRING) { + if (!try_convert_to_string(value)) { + efree(params); + return NULL; } + } - if (!xpath_params) { - xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value)); - } else { - xpath_expr = estrndup(Z_STRVAL_P(value), Z_STRLEN_P(value)); - } - if (xpath_expr) { - params[i++] = estrndup(ZSTR_VAL(string_key), ZSTR_LEN(string_key)); - params[i++] = xpath_expr; - } + if (!xpath_params) { + xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value)); + } else { + xpath_expr = estrndup(Z_STRVAL_P(value), Z_STRLEN_P(value)); + } + if (xpath_expr) { + params[i++] = estrndup(ZSTR_VAL(string_key), ZSTR_LEN(string_key)); + params[i++] = xpath_expr; } } ZEND_HASH_FOREACH_END(); @@ -336,8 +331,8 @@ PHP_METHOD(XSLTProcessor, importStylesheet) doc = nodep->doc; } if (doc == NULL) { - php_error(E_WARNING, "Invalid Document"); - RETURN_FALSE; + zend_argument_value_error(1, "must be a valid XML node"); + RETURN_THROWS(); } /* libxslt uses _private, so we must copy the imported @@ -417,13 +412,17 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl if (node) { doc = node->doc; } + if (doc == NULL) { - php_error_docref(NULL, E_WARNING, "Invalid Document"); + zend_argument_value_error(1, "must be a valid XML node"); return NULL; } if (style == NULL) { - php_error_docref(NULL, E_WARNING, "No stylesheet associated to this object"); + zend_string *name = get_active_function_or_method_name(); + zend_throw_error(NULL, "%s() can only be called after a stylesheet has been imported", + ZSTR_VAL(name)); + zend_string_release(name); return NULL; } @@ -573,9 +572,10 @@ PHP_METHOD(XSLTProcessor, transformToDoc) ce = zend_lookup_class(ret_class); if (ce == NULL || !instanceof_function(ce, curce)) { xmlFreeDoc(newdocp); - php_error_docref(NULL, E_WARNING, - "Expecting class compatible with %s, '%s' given", ZSTR_VAL(curclass_name), ZSTR_VAL(ret_class)); - RETURN_FALSE; + zend_argument_type_error(2, "must be a class name compatible with %s, \"%s\" given", + ZSTR_VAL(curclass_name), ZSTR_VAL(ret_class) + ); + RETURN_THROWS(); } object_init_ex(return_value, ce); diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 4ca98a3c0831b..92b8e4cf6a815 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -36,6 +36,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zend_test) int observer_observe_functions; int observer_show_return_type; int observer_show_return_value; + int observer_show_init_backtrace; int observer_nesting_depth; ZEND_END_MODULE_GLOBALS(zend_test) @@ -315,9 +316,10 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("zend_test.observer.observe_functions", "0", PHP_INI_SYSTEM, OnUpdateBool, observer_observe_functions, zend_zend_test_globals, zend_test_globals) STD_PHP_INI_BOOLEAN("zend_test.observer.show_return_type", "0", PHP_INI_SYSTEM, OnUpdateBool, observer_show_return_type, zend_zend_test_globals, zend_test_globals) STD_PHP_INI_BOOLEAN("zend_test.observer.show_return_value", "0", PHP_INI_SYSTEM, OnUpdateBool, observer_show_return_value, zend_zend_test_globals, zend_test_globals) + STD_PHP_INI_BOOLEAN("zend_test.observer.show_init_backtrace", "0", PHP_INI_SYSTEM, OnUpdateBool, observer_show_init_backtrace, zend_zend_test_globals, zend_test_globals) PHP_INI_END() -static zend_observer_fcall_handlers observer_fcall_init(zend_function *fbc); +static zend_observer_fcall_handlers observer_fcall_init(zend_execute_data *execute_data); PHP_MINIT_FUNCTION(zend_test) { @@ -498,10 +500,34 @@ static void observer_show_init(zend_function *fbc) } } -static zend_observer_fcall_handlers observer_fcall_init(zend_function *fbc) +static void observer_show_init_backtrace(zend_execute_data *execute_data) { + zend_execute_data *ex = execute_data; + php_printf("%*s\n", 2 * ZT_G(observer_nesting_depth), ""); +} + +static zend_observer_fcall_handlers observer_fcall_init(zend_execute_data *execute_data) +{ + zend_function *fbc = execute_data->func; if (ZT_G(observer_show_output)) { observer_show_init(fbc); + if (ZT_G(observer_show_init_backtrace)) { + observer_show_init_backtrace(execute_data); + } } if (ZT_G(observer_observe_all)) { diff --git a/ext/zend_test/tests/observer_backtrace_01.phpt b/ext/zend_test/tests/observer_backtrace_01.phpt new file mode 100644 index 0000000000000..7aa47c2ef2812 --- /dev/null +++ b/ext/zend_test/tests/observer_backtrace_01.phpt @@ -0,0 +1,106 @@ +--TEST-- +Observer: Show backtrace on init +--SKIPIF-- + +--INI-- +zend_test.observer.enabled=1 +zend_test.observer.observe_all=1 +zend_test.observer.show_init_backtrace=1 +--FILE-- +bar($value); + }, [40, 1335]); + } +} + +function gen() +{ + $test = new TestClass(); + yield $test->foo(); +} + +function foo() +{ + return gen()->current(); +} + +var_dump(foo()); +?> +--EXPECTF-- + + + + + + + + + + + + + + + + + + + + + + + + + + + +array(2) { + [0]=> + int(42) + [1]=> + int(1337) +} + diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 92df580874db1..67fd87d6dae0b 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -31,7 +31,7 @@ extern zend_module_entry zip_module_entry; #define ZIP_OVERWRITE ZIP_TRUNCATE #endif -#define PHP_ZIP_VERSION "1.19.1-dev" +#define PHP_ZIP_VERSION "1.19.1" #define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename) diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php index 7da7bfea39221..9a276a05df10e 100644 --- a/ext/zip/php_zip.stub.php +++ b/ext/zip/php_zip.stub.php @@ -138,13 +138,13 @@ public function deleteIndex(int $index) {} public function deleteName(string $name) {} /** @return array|false */ - public function statName(string $filename, int $flags = 0) {} + public function statName(string $name, int $flags = 0) {} /** @return array|false */ public function statIndex(int $index, int $flags = 0) {} /** @return int|false */ - public function locateName(string $filename, int $flags = 0) {} + public function locateName(string $name, int $flags = 0) {} /** @return string|false */ public function getNameIndex(int $index, int $flags = 0) {} @@ -165,13 +165,13 @@ public function unchangeName(string $name) {} public function extractTo(string $pathto, array|string|null $files = null) {} /** @return string|false */ - public function getFromName(string $entryname, int $len = 0, int $flags = 0) {} + public function getFromName(string $name, int $len = 0, int $flags = 0) {} /** @return string|false */ public function getFromIndex(int $index, int $len = 0, int $flags = 0) {} /** @return resource|false */ - public function getStream(string $entryname) {} + public function getStream(string $name) {} #ifdef ZIP_OPSYS_DEFAULT /** @return bool */ diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index 6274f6afefadf..a4167fa8ca4bf 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 58d4035ad8d21582e93091d5c14f78640c1a17c3 */ + * Stub hash: 4ca2b108e71924309abcdc1a0f86f5963a8516f3 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -157,11 +157,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_deleteName, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ZipArchive_statName arginfo_class_ZipArchive_open +#define arginfo_class_ZipArchive_statName arginfo_class_ZipArchive_getCommentName #define arginfo_class_ZipArchive_statIndex arginfo_class_ZipArchive_getCommentIndex -#define arginfo_class_ZipArchive_locateName arginfo_class_ZipArchive_open +#define arginfo_class_ZipArchive_locateName arginfo_class_ZipArchive_getCommentName #define arginfo_class_ZipArchive_getNameIndex arginfo_class_ZipArchive_getCommentIndex @@ -179,7 +179,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_extractTo, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getFromName, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, entryname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, len, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() @@ -190,9 +190,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getFromIndex, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_getStream, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, entryname, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_ZipArchive_getStream arginfo_class_ZipArchive_deleteName #if defined(ZIP_OPSYS_DEFAULT) ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ZipArchive_setExternalAttributesName, 0, 0, 3) diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt index b9255557ff08e..6783b44f4d922 100644 --- a/ext/zlib/tests/007.phpt +++ b/ext/zlib/tests/007.phpt @@ -42,9 +42,9 @@ var_dump(gzencode($string, 9, ZLIB_ENCODING_DEFLATE)); --EXPECTF-- gzencode(): Argument #2 ($level) must be between -1 and 9 gzencode(): Argument #2 ($level) must be between -1 and 9 -gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE string(%d) "%a" string(%d) "%a" -gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE string(%d) "%a" string(%d) "%a" diff --git a/ext/zlib/tests/deflate_init_error.phpt b/ext/zlib/tests/deflate_init_error.phpt index b31a16be9accf..104d8552e3cfb 100644 --- a/ext/zlib/tests/deflate_init_error.phpt +++ b/ext/zlib/tests/deflate_init_error.phpt @@ -41,7 +41,7 @@ try { ?> --EXPECT-- -deflate_init(): Argument #1 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE deflate_init(): "level" option must be between -1 and 9 deflate_init(): "level" option must be between -1 and 9 deflate_init(): "memory" option must be between 1 and 9 diff --git a/ext/zlib/tests/gzcompress_error1.phpt b/ext/zlib/tests/gzcompress_error1.phpt index ff09d6568affc..e740de6d0c870 100644 --- a/ext/zlib/tests/gzcompress_error1.phpt +++ b/ext/zlib/tests/gzcompress_error1.phpt @@ -41,4 +41,4 @@ try { gzcompress(): Argument #2 ($level) must be between -1 and 9 -- Testing with invalid encoding -- -gzcompress(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzcompress(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzdeflate_error1.phpt b/ext/zlib/tests/gzdeflate_error1.phpt index fea4dfec002a7..5081f66dc4d17 100644 --- a/ext/zlib/tests/gzdeflate_error1.phpt +++ b/ext/zlib/tests/gzdeflate_error1.phpt @@ -41,4 +41,4 @@ try { gzdeflate(): Argument #2 ($level) must be between -1 and 9 -- Testing with incorrect encoding -- -gzdeflate(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzdeflate(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzencode_error1.phpt b/ext/zlib/tests/gzencode_error1.phpt index 951437b98a085..00d70f93982b8 100644 --- a/ext/zlib/tests/gzencode_error1.phpt +++ b/ext/zlib/tests/gzencode_error1.phpt @@ -42,4 +42,4 @@ try { gzencode(): Argument #2 ($level) must be between -1 and 9 -- Testing with incorrect encoding_mode -- -gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 6ddda3d7a2649..eab3b02ca575b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -725,7 +725,7 @@ PHP_FUNCTION(name) \ case PHP_ZLIB_ENCODING_DEFLATE: \ break; \ default: \ - zend_argument_value_error(default_encoding ? 3 : 2, "must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); \ + zend_argument_value_error(default_encoding ? 3 : 2, "must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); \ RETURN_THROWS(); \ } \ if ((out = php_zlib_encode(ZSTR_VAL(in), ZSTR_LEN(in), encoding, level)) == NULL) { \ @@ -1129,7 +1129,7 @@ PHP_FUNCTION(deflate_init) case Z_DEFAULT_STRATEGY: break; default: - zend_value_error("deflate_init(): \"strategy\" option must be one of ZLIB_FILTERED, ZLIB_HUFFMAN_ONLY, ZLIB_RLE, ZLIB_FIXED or ZLIB_DEFAULT_STRATEGY"); + zend_value_error("deflate_init(): \"strategy\" option must be one of ZLIB_FILTERED, ZLIB_HUFFMAN_ONLY, ZLIB_RLE, ZLIB_FIXED, or ZLIB_DEFAULT_STRATEGY"); RETURN_THROWS(); } @@ -1143,7 +1143,7 @@ PHP_FUNCTION(deflate_init) case PHP_ZLIB_ENCODING_DEFLATE: break; default: - zend_argument_value_error(1, "must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); + zend_argument_value_error(1, "must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); RETURN_THROWS(); } diff --git a/main/SAPI.c b/main/SAPI.c index 01ec31f72218f..0a7f219e847e5 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -762,13 +762,6 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg) len--; } - /* Disable possible output compression for images */ - if (!strncmp(ptr, "image/", sizeof("image/")-1)) { - zend_string *key = zend_string_init("zlib.output_compression", sizeof("zlib.output_compression")-1, 0); - zend_alter_ini_entry_chars(key, "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); - zend_string_release_ex(key, 0); - } - mimetype = estrdup(ptr); newlen = sapi_apply_default_charset(&mimetype, len); if (!SG(sapi_headers).mimetype){ diff --git a/main/main.c b/main/main.c index 3667432f94a5f..da510f55518dc 100644 --- a/main/main.c +++ b/main/main.c @@ -2055,21 +2055,12 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod #endif #ifdef PHP_WIN32 -# if PHP_LINKER_MAJOR == 14 - /* Extend for other CRT if needed. */ -# if PHP_DEBUG -# define PHP_VCRUNTIME "vcruntime140d.dll" -# else -# define PHP_VCRUNTIME "vcruntime140.dll" -# endif char *img_err; - if (!php_win32_crt_compatible(PHP_VCRUNTIME, &img_err)) { + if (!php_win32_crt_compatible(&img_err)) { php_error(E_CORE_WARNING, img_err); efree(img_err); return FAILURE; } -# undef PHP_VCRUNTIME -# endif /* start up winsock services */ if (WSAStartup(wVersionRequested, &wsaData) != 0) { diff --git a/main/php.h b/main/php.h index 497b906fc64ba..a747a99499ab4 100644 --- a/main/php.h +++ b/main/php.h @@ -22,7 +22,7 @@ #include #endif -#define PHP_API_VERSION 20200804 +#define PHP_API_VERSION 20200930 #define PHP_HAVE_STREAMS #define YYDEBUG 0 #define PHP_DEFAULT_CHARSET "UTF-8" diff --git a/main/php_ini.c b/main/php_ini.c index 57573f4d309dc..53c08ae3c4c45 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -331,13 +331,6 @@ static void php_load_zend_extension_cb(void *arg) #endif if (IS_ABSOLUTE_PATH(filename, length)) { -#ifdef PHP_WIN32 - char *err; - if (!php_win32_image_compatible(filename, &err)) { - php_error(E_CORE_WARNING, err); - return; - } -#endif zend_load_extension(filename); } else { DL_HANDLE handle; @@ -381,13 +374,13 @@ static void php_load_zend_extension_cb(void *arg) efree(orig_libpath); efree(err1); + efree(libpath); } #ifdef PHP_WIN32 - if (!php_win32_image_compatible(libpath, &err1)) { + if (!php_win32_image_compatible(handle, &err1)) { php_error(E_CORE_WARNING, err1); efree(err1); - efree(libpath); DL_UNLOAD(handle); return; } diff --git a/main/php_variables.c b/main/php_variables.c index 7b753f0cdf8e4..312c22ef07db7 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -509,7 +509,9 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data) } val = estrndup(val, val_len); - php_url_decode(var, strlen(var)); + if (arg != PARSE_COOKIE) { + php_url_decode(var, strlen(var)); + } if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len)) { php_register_variable_safe(var, val, new_val_len, &array); } diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index aae9097b41e06..3fda788f199e3 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -56,6 +56,8 @@ typedef struct { #define PHP_STREAM_MMAP_ALL 0 +#define PHP_STREAM_MMAP_MAX (512 * 1024 * 1024) + #define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL) == 0 ? 1 : 0) /* Returns 1 if the stream in its current state can be memory mapped, diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 350dc2ec403fd..8a891ddf720ad 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -774,6 +774,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void php_stream_mmap_range *range = (php_stream_mmap_range*)ptrparam; HANDLE hfile = (HANDLE)_get_osfhandle(fd); DWORD prot, acc, loffs = 0, delta = 0; + LARGE_INTEGER file_size; switch (value) { case PHP_STREAM_MMAP_SUPPORTED: @@ -810,7 +811,22 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void return PHP_STREAM_OPTION_RETURN_ERR; } - size = GetFileSize(hfile, NULL); + if (!GetFileSizeEx(hfile, &file_size)) { + CloseHandle(data->file_mapping); + data->file_mapping = NULL; + return PHP_STREAM_OPTION_RETURN_ERR; + } +# if defined(_WIN64) + size = file_size.QuadPart; +# else + if (file_size.HighPart) { + CloseHandle(data->file_mapping); + data->file_mapping = NULL; + return PHP_STREAM_OPTION_RETURN_ERR; + } else { + size = file_size.LowPart; + } +# endif if (range->offset > size) { range->offset = size; } @@ -829,6 +845,11 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void delta = (DWORD)range->offset - loffs; } + /* MapViewOfFile()ing zero bytes would map to the end of the file; match *nix behavior instead */ + if (range->length + delta == 0) { + return PHP_STREAM_OPTION_RETURN_ERR; + } + data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length + delta); if (data->last_mapped_addr) { @@ -1030,9 +1051,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zen char *persistent_id = NULL; if (FAILURE == php_stream_parse_fopen_modes(mode, &open_flags)) { - if (options & REPORT_ERRORS) { - zend_value_error("\"%s\" is not a valid mode for fopen", mode); - } + php_stream_wrapper_log_error(&php_plain_files_wrapper, options, "`%s' is not a valid mode for fopen", mode); return NULL; } diff --git a/main/streams/streams.c b/main/streams/streams.c index 686427bc96643..1262c874f7e88 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1566,29 +1566,48 @@ PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size if (php_stream_mmap_possible(src)) { char *p; - size_t mapped; - p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); + do { + size_t chunk_size = (maxlen == 0 || maxlen > PHP_STREAM_MMAP_MAX) ? PHP_STREAM_MMAP_MAX : maxlen; + size_t mapped; - if (p) { - ssize_t didwrite = php_stream_write(dest, p, mapped); - if (didwrite < 0) { - *len = 0; - return FAILURE; - } + p = php_stream_mmap_range(src, php_stream_tell(src), chunk_size, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); + + if (p) { + ssize_t didwrite; + + if (php_stream_seek(src, mapped, SEEK_CUR) != 0) { + php_stream_mmap_unmap(src); + break; + } + + didwrite = php_stream_write(dest, p, mapped); + if (didwrite < 0) { + *len = haveread; + return FAILURE; + } - php_stream_mmap_unmap_ex(src, mapped); + php_stream_mmap_unmap(src); - *len = didwrite; + *len = haveread += didwrite; - /* we've got at least 1 byte to read - * less than 1 is an error - * AND read bytes match written */ - if (mapped > 0 && mapped == didwrite) { - return SUCCESS; + /* we've got at least 1 byte to read + * less than 1 is an error + * AND read bytes match written */ + if (mapped == 0 || mapped != didwrite) { + return FAILURE; + } + if (mapped < chunk_size) { + return SUCCESS; + } + if (maxlen != 0) { + maxlen -= mapped; + if (maxlen == 0) { + return SUCCESS; + } + } } - return FAILURE; - } + } while (p); } while(1) { @@ -2019,7 +2038,7 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, if (wrapper && wrapper->wops->dir_opener) { stream = wrapper->wops->dir_opener(wrapper, - path_to_open, "r", options ^ REPORT_ERRORS, NULL, + path_to_open, "r", options & ~REPORT_ERRORS, NULL, context STREAMS_REL_CC); if (stream) { @@ -2027,7 +2046,7 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, stream->flags |= PHP_STREAM_FLAG_NO_BUFFER | PHP_STREAM_FLAG_IS_DIR; } } else if (wrapper) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, "not implemented"); + php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "not implemented"); } if (stream == NULL && (options & REPORT_ERRORS)) { php_stream_display_wrapper_errors(wrapper, path, "Failed to open directory"); @@ -2096,18 +2115,18 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod if (wrapper) { if (!wrapper->wops->stream_opener) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, + php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "wrapper does not support stream open"); } else { stream = wrapper->wops->stream_opener(wrapper, - path_to_open, mode, options ^ REPORT_ERRORS, + path_to_open, mode, options & ~REPORT_ERRORS, opened_path, context STREAMS_REL_CC); } /* if the caller asked for a persistent stream but the wrapper did not * return one, force an error here */ if (stream && (options & STREAM_OPEN_PERSISTENT) && !stream->is_persistent) { - php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS, + php_stream_wrapper_log_error(wrapper, options & ~REPORT_ERRORS, "wrapper does not support persistent streams"); php_stream_close(stream); stream = NULL; @@ -2164,7 +2183,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod tmp); efree(tmp); - options ^= REPORT_ERRORS; + options &= ~REPORT_ERRORS; } } } diff --git a/main/streams/userspace.c b/main/streams/userspace.c index f6381a0014c49..0e9059a99e523 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -526,23 +526,24 @@ PHP_FUNCTION(stream_wrapper_restore) { zend_string *protocol; php_stream_wrapper *wrapper; - HashTable *global_wrapper_hash; + HashTable *global_wrapper_hash, *wrapper_hash; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &protocol) == FAILURE) { RETURN_THROWS(); } global_wrapper_hash = php_stream_get_url_stream_wrappers_hash_global(); - if (php_stream_get_url_stream_wrappers_hash() == global_wrapper_hash) { - php_error_docref(NULL, E_NOTICE, "%s:// was never changed, nothing to restore", ZSTR_VAL(protocol)); - RETURN_TRUE; - } - if ((wrapper = zend_hash_find_ptr(global_wrapper_hash, protocol)) == NULL) { php_error_docref(NULL, E_WARNING, "%s:// never existed, nothing to restore", ZSTR_VAL(protocol)); RETURN_FALSE; } + wrapper_hash = php_stream_get_url_stream_wrappers_hash(); + if (wrapper_hash == global_wrapper_hash || zend_hash_find_ptr(wrapper_hash, protocol) == wrapper) { + php_error_docref(NULL, E_NOTICE, "%s:// was never changed, nothing to restore", ZSTR_VAL(protocol)); + RETURN_TRUE; + } + /* A failure here could be okay given that the protocol might have been merely unregistered */ php_unregister_url_stream_wrapper_volatile(protocol); diff --git a/php.ini-development b/php.ini-development index 54006830a2c06..65532be9e230e 100644 --- a/php.ini-development +++ b/php.ini-development @@ -371,6 +371,8 @@ zend.enable_gc = On ;zend.script_encoding = ; Allows to include or exclude arguments from stack traces generated for exceptions. +; In production, it is recommended to turn this setting on to prohibit the output +; of sensitive information in stack traces ; Default Value: Off ; Development Value: Off ; Production Value: On diff --git a/php.ini-production b/php.ini-production index 47a5c5e13b20b..472a87eab0c5f 100644 --- a/php.ini-production +++ b/php.ini-production @@ -370,7 +370,7 @@ zend.enable_gc = On ; Only affects if zend.multibyte is set. ;zend.script_encoding = -; Allows to include or exclude arguments from stack traces generated for exceptions +; Allows to include or exclude arguments from stack traces generated for exceptions. ; In production, it is recommended to turn this setting on to prohibit the output ; of sensitive information in stack traces ; Default Value: Off diff --git a/run-tests.php b/run-tests.php index 8d62c8337599c..761ef949fe931 100755 --- a/run-tests.php +++ b/run-tests.php @@ -145,7 +145,7 @@ function main(): void $optionals, $output_file, $pass_option_n, $pass_options, $pattern_match, $php, $php_cgi, $phpdbg, $preload, $redir_tests, $repeat, $result_tests_file, $slow_min_ms, $start_time, $switch, - $temp_source, $temp_target, $temp_urlbase, $test_cnt, $test_dirs, + $temp_source, $temp_target, $test_cnt, $test_dirs, $test_files, $test_idx, $test_list, $test_results, $testfile, $user_tests, $valgrind, $sum_results, $shuffle, $file_cache; // Parallel testing @@ -389,7 +389,6 @@ function main(): void $valgrind = null; $temp_source = null; $temp_target = null; - $temp_urlbase = null; $conf_passed = null; $no_clean = false; $colorize = true; @@ -594,12 +593,6 @@ function main(): void break; case '--temp-target': $temp_target = $argv[++$i]; - if ($temp_urlbase) { - $temp_urlbase = $temp_target; - } - break; - case '--temp-urlbase': - $temp_urlbase = $argv[++$i]; break; case 'v': case '--verbose': diff --git a/sapi/cli/tests/004.phpt b/sapi/cli/tests/004.phpt index fb0ae99ddcdb9..094161a8fafcf 100644 --- a/sapi/cli/tests/004.phpt +++ b/sapi/cli/tests/004.phpt @@ -20,10 +20,10 @@ string(45) "Exception: Function unknown() does not exist " string(42) "Exception: Function echo() does not exist " -string(154) "Function [ function phpinfo ] { +string(155) "Function [ function phpinfo ] { - Parameters [1] { - Parameter #0 [ int $what = INFO_ALL ] + Parameter #0 [ int $flags = INFO_ALL ] } - Return [ bool ] } diff --git a/sapi/cli/tests/005.phpt b/sapi/cli/tests/005.phpt index a1d51088aba47..ca3dfd97302d3 100644 --- a/sapi/cli/tests/005.phpt +++ b/sapi/cli/tests/005.phpt @@ -37,7 +37,7 @@ string(183) "Class [ class stdClass ] { } " -string(2177) "Class [ class Exception implements Throwable, Stringable ] { +string(2170) "Class [ class Exception implements Throwable, Stringable ] { - Constants [0] { } @@ -68,7 +68,7 @@ string(2177) "Class [ class Exception implements Throwable, Stri Method [ public method __construct ] { - Parameters [3] { - Parameter #0 [ string $message = ] + Parameter #0 [ string $message = "" ] Parameter #1 [ int $code = 0 ] Parameter #2 [ ?Throwable $previous = null ] } diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 54d06a84c7703..efd2270601ef8 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -438,7 +438,7 @@ PHP_FUNCTION(phpdbg_color) break; default: - zend_argument_value_error(1, "must be either PHPDBG_COLOR_PROMPT, PHPDBG_COLOR_NOTICE, or PHPDBG_COLOR_ERROR"); + zend_argument_value_error(1, "must be one of PHPDBG_COLOR_PROMPT, PHPDBG_COLOR_NOTICE, or PHPDBG_COLOR_ERROR"); } } /* }}} */ diff --git a/tests/basic/022.phpt b/tests/basic/022.phpt index 0ab70d4be7643..bd1db13701822 100644 --- a/tests/basic/022.phpt +++ b/tests/basic/022.phpt @@ -10,7 +10,7 @@ cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1= var_dump($_COOKIE); ?> --EXPECT-- -array(10) { +array(12) { ["cookie1"]=> string(6) "val1 " ["cookie2"]=> @@ -19,11 +19,15 @@ array(10) { string(6) "val 3." ["cookie_4"]=> string(10) " value 4 ;" + ["%20cookie1"]=> + string(6) "ignore" + ["+cookie1"]=> + string(6) "ignore" ["cookie__5"]=> string(7) " value" - ["cookie_6"]=> + ["cookie%206"]=> string(3) "þæö" - ["cookie_7"]=> + ["cookie+7"]=> string(0) "" ["$cookie_8"]=> string(0) "" diff --git a/tests/basic/023.phpt b/tests/basic/023.phpt index ca5f1dcfbb1a2..0e2e0ac669453 100644 --- a/tests/basic/023.phpt +++ b/tests/basic/023.phpt @@ -10,9 +10,11 @@ c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","valu var_dump($_COOKIE); ?> --EXPECT-- -array(3) { +array(4) { ["c_o_o_k_i_e"]=> string(5) "value" + ["c%20o+o_k+i%20e"]=> + string(1) "v" ["name"]=> string(24) ""value","value",UEhQIQ==" ["UEhQIQ"]=> diff --git a/tests/basic/bug79699.phpt b/tests/basic/bug79699.phpt new file mode 100644 index 0000000000000..fc3d3fedb08fd --- /dev/null +++ b/tests/basic/bug79699.phpt @@ -0,0 +1,22 @@ +--TEST-- +Cookies Security Bug +--INI-- +max_input_vars=1000 +filter.default=unsafe_raw +--COOKIE-- +__%48ost-evil=evil; __Host-evil=good; %66oo=baz;foo=bar +--FILE-- + +--EXPECT-- +array(4) { + ["__%48ost-evil"]=> + string(4) "evil" + ["__Host-evil"]=> + string(4) "good" + ["%66oo"]=> + string(3) "baz" + ["foo"]=> + string(3) "bar" +} diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 7eb6593acafad..a7d60812bd6f8 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -293,7 +293,6 @@ if (main_network_has_ipv6) { AC_DEFINE('HAVE_GAI_STRERROR', 1); AC_DEFINE('HAVE_IPV6', 1); } -AC_DEFINE('HAVE_GETADDRINFO', main_network_has_ipv6); /* this allows up to 256 sockets to be select()ed in a single * call to select(), instead of the usual 64 */ diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index 2167b1297b4be..ce4b71282e7a0 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -135,3 +135,5 @@ #ifdef __clang__ #define HAVE_FUNC_ATTRIBUTE_TARGET 1 #endif + +#define HAVE_GETADDRINFO 1 diff --git a/win32/build/confutils.js b/win32/build/confutils.js index e71757748fdaa..857e50acbe82a 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3401,7 +3401,7 @@ function toolset_setup_common_ldlags() function toolset_setup_common_libs() { // urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib - DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib imagehlp.lib"); + DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib"); } function toolset_setup_build_mode() diff --git a/win32/grp.h b/win32/grp.h deleted file mode 100644 index f8cc8fe206c99..0000000000000 --- a/win32/grp.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_WIN32_GRP_H -#define PHP_WIN32_GRP_H - -struct group { - char *gr_name; - char *gr_passwd; - int gr_gid; - char **gr_mem; -}; - -#endif diff --git a/win32/winutil.c b/win32/winutil.c index 40664a9e038cd..530dc4f0f6c23 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -20,7 +20,6 @@ #include "codepage.h" #include #include -#include PHP_WINUTIL_API char *php_win32_error_to_msg(HRESULT error) @@ -436,26 +435,13 @@ PHP_WINUTIL_API char *php_win32_get_username(void) return uname; }/*}}}*/ -static zend_always_inline BOOL is_compatible(const char *name, BOOL is_smaller, char *format, char **err) +static zend_always_inline BOOL is_compatible(HMODULE handle, BOOL is_smaller, char *format, char **err) {/*{{{*/ - /* work around ImageLoad() issue */ - const char *name_stripped = name; - if (name[0] == '.' && IS_SLASH(name[1])) { - name_stripped += 2; - } - - PLOADED_IMAGE img = ImageLoad(name_stripped, NULL); + PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER) handle; + PIMAGE_NT_HEADERS pNTHeader = (PIMAGE_NT_HEADERS)((char *) dosHeader + dosHeader->e_lfanew); - if (!img) { - DWORD _err = GetLastError(); - char *err_txt = php_win32_error_to_msg(_err); - spprintf(err, 0, "Failed to load %s, %s", name, err_txt); - free(err_txt); - return FALSE; - } - - DWORD major = img->FileHeader->OptionalHeader.MajorLinkerVersion; - DWORD minor = img->FileHeader->OptionalHeader.MinorLinkerVersion; + DWORD major = pNTHeader->OptionalHeader.MajorLinkerVersion; + DWORD minor = pNTHeader->OptionalHeader.MinorLinkerVersion; #if PHP_LINKER_MAJOR == 14 /* VS 2015, 2017 and 2019 are binary compatible, but only forward compatible. @@ -474,23 +460,39 @@ static zend_always_inline BOOL is_compatible(const char *name, BOOL is_smaller, if (PHP_LINKER_MAJOR != major) #endif { - spprintf(err, 0, format, name, major, minor, PHP_LINKER_MAJOR, PHP_LINKER_MINOR); - ImageUnload(img); + char buf[MAX_PATH]; + if (GetModuleFileName(handle, buf, sizeof(buf)) != 0) { + spprintf(err, 0, format, buf, major, minor, PHP_LINKER_MAJOR, PHP_LINKER_MINOR); + } else { + spprintf(err, 0, "Can't retrieve the module name (error %u)", GetLastError()); + } return FALSE; } - ImageUnload(img); return TRUE; }/*}}}*/ -PHP_WINUTIL_API BOOL php_win32_image_compatible(const char *name, char **err) +PHP_WINUTIL_API BOOL php_win32_image_compatible(HMODULE handle, char **err) {/*{{{*/ - return is_compatible(name, TRUE, "Can't load module '%s' as it's linked with %u.%u, but the core is linked with %d.%d", err); + return is_compatible(handle, TRUE, "Can't load module '%s' as it's linked with %u.%u, but the core is linked with %d.%d", err); }/*}}}*/ -/* Expect a CRT name DLL. */ -PHP_WINUTIL_API BOOL php_win32_crt_compatible(const char *name, char **err) +/* Expect a CRT module handle */ +PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err) {/*{{{*/ - return is_compatible(name, FALSE, "'%s' %u.%u is not compatible with this PHP build linked with %d.%d", err); +#if PHP_LINKER_MAJOR == 14 + /* Extend for other CRT if needed. */ +# if PHP_DEBUG + const char *crt_name = "vcruntime140d.dll"; +# else + const char *crt_name = "vcruntime140.dll"; +# endif + HMODULE handle = GetModuleHandle(crt_name); + if (handle == NULL) { + spprintf(err, 0, "Can't get handle of module %s (error %u)", crt_name, GetLastError()); + return FALSE; + } + return is_compatible(handle, FALSE, "'%s' %u.%u is not compatible with this PHP build linked with %d.%d", err); +#endif + return TRUE; }/*}}}*/ - diff --git a/win32/winutil.h b/win32/winutil.h index 8acf87e67152e..cc3f115280a70 100644 --- a/win32/winutil.h +++ b/win32/winutil.h @@ -53,7 +53,7 @@ PHP_WINUTIL_API int php_win32_code_to_errno(unsigned long w32Err); PHP_WINUTIL_API char *php_win32_get_username(void); -PHP_WINUTIL_API BOOL php_win32_image_compatible(const char *img, char **err); -PHP_WINUTIL_API BOOL php_win32_crt_compatible(const char *img, char **err); +PHP_WINUTIL_API BOOL php_win32_image_compatible(HMODULE handle, char **err); +PHP_WINUTIL_API BOOL php_win32_crt_compatible(char **err); #endif