diff --git a/Zend/tests/004.phpt b/Zend/tests/004.phpt index 179684d076737..2f733f1bd886b 100644 --- a/Zend/tests/004.phpt +++ b/Zend/tests/004.phpt @@ -3,7 +3,6 @@ strncmp() tests --FILE-- --EXPECTF-- -Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d -NULL int(0) Warning: Length must be greater than or equal to 0 in %s on line %d diff --git a/Zend/tests/005.phpt b/Zend/tests/005.phpt index 6ad1b0f63d250..f4abfb6c51ef8 100644 --- a/Zend/tests/005.phpt +++ b/Zend/tests/005.phpt @@ -3,7 +3,6 @@ strcasecmp() tests --FILE-- --EXPECTF-- -Warning: strcasecmp() expects exactly 2 parameters, 1 given in %s on line %d -NULL int(0) int(-3) int(-1) diff --git a/Zend/tests/006.phpt b/Zend/tests/006.phpt index 64c74ff134442..12907fd36eea8 100644 --- a/Zend/tests/006.phpt +++ b/Zend/tests/006.phpt @@ -3,7 +3,6 @@ strncasecmp() tests --FILE-- --EXPECTF-- -Warning: strncasecmp() expects exactly 3 parameters, 1 given in %s on line %d -NULL - Warning: Length must be greater than or equal to 0 in %s on line %d bool(false) int(0) diff --git a/Zend/tests/008.phpt b/Zend/tests/008.phpt index cacba06370e9d..6f885c0dc58d5 100644 --- a/Zend/tests/008.phpt +++ b/Zend/tests/008.phpt @@ -3,12 +3,13 @@ define() tests --FILE-- getMessage(), "\n"; +} -var_dump(define(array(1,2,3,4,5), 1)); +var_dump(define("TRUE", 1)); var_dump(define(" ", 1)); var_dump(define("[[[", 2)); var_dump(define("test const", 3)); @@ -24,20 +25,10 @@ var_dump(constant("test const")); echo "Done\n"; ?> --EXPECTF-- -Warning: define() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: define() expects at least 2 parameters, 1 given in %s on line %d -NULL +TypeError: define() expects parameter 1 to be string, array given Notice: Constant TRUE already defined in %s on line %d bool(false) - -Warning: define() expects parameter 3 to be bool, array given in %s on line %d -NULL - -Warning: define() expects parameter 1 to be string, array given in %s on line %d -NULL bool(true) bool(true) bool(true) diff --git a/Zend/tests/011.phpt b/Zend/tests/011.phpt index 7bcab0798fc6c..d36ae80ae8976 100644 --- a/Zend/tests/011.phpt +++ b/Zend/tests/011.phpt @@ -23,8 +23,6 @@ class bar extends foo { } } -var_dump(property_exists()); -var_dump(property_exists("")); var_dump(property_exists("foo","pp1")); var_dump(property_exists("foo","pp2")); var_dump(property_exists("foo","pp3")); @@ -53,11 +51,6 @@ $bar->test(); echo "Done\n"; ?> --EXPECTF-- -Warning: property_exists() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: property_exists() expects exactly 2 parameters, 1 given in %s on line %d -NULL bool(true) bool(true) bool(true) diff --git a/Zend/tests/012.phpt b/Zend/tests/012.phpt index 40f68e9794002..c238229066f4e 100644 --- a/Zend/tests/012.phpt +++ b/Zend/tests/012.phpt @@ -6,10 +6,8 @@ class_exists() tests class foo { } -var_dump(class_exists()); var_dump(class_exists("qwerty")); var_dump(class_exists("")); -var_dump(class_exists(array())); var_dump(class_exists("test", false)); var_dump(class_exists("foo", false)); var_dump(class_exists("foo")); @@ -18,14 +16,9 @@ var_dump(class_exists("stdClass")); echo "Done\n"; ?> ---EXPECTF-- -Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d -NULL +--EXPECT-- bool(false) bool(false) - -Warning: class_exists() expects parameter 1 to be string, array given in %s on line %d -NULL bool(false) bool(true) bool(true) diff --git a/Zend/tests/013.phpt b/Zend/tests/013.phpt index aec10e53f1b60..fd8320b5368c9 100644 --- a/Zend/tests/013.phpt +++ b/Zend/tests/013.phpt @@ -6,10 +6,8 @@ interface_exists() tests interface foo { } -var_dump(interface_exists()); var_dump(interface_exists("qwerty")); var_dump(interface_exists("")); -var_dump(interface_exists(array())); var_dump(interface_exists("test", false)); var_dump(interface_exists("foo", false)); var_dump(interface_exists("foo")); @@ -18,14 +16,9 @@ var_dump(interface_exists("stdClass")); echo "Done\n"; ?> ---EXPECTF-- -Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d -NULL +--EXPECT-- bool(false) bool(false) - -Warning: interface_exists() expects parameter 1 to be string, array given in %s on line %d -NULL bool(false) bool(true) bool(true) diff --git a/Zend/tests/014.phpt b/Zend/tests/014.phpt index 18037a99e34ee..2a5cca7c4df02 100644 --- a/Zend/tests/014.phpt +++ b/Zend/tests/014.phpt @@ -8,13 +8,9 @@ var_dump(get_included_files()); include(dirname(__FILE__)."/014.inc"); var_dump(get_included_files()); -var_dump(get_included_files(1,1)); - include_once(dirname(__FILE__)."/014.inc"); var_dump(get_included_files()); -var_dump(get_included_files(1)); - include(dirname(__FILE__)."/014.inc"); var_dump(get_included_files()); @@ -31,18 +27,12 @@ array(2) { [1]=> string(%d) "%s" } - -Warning: get_included_files() expects exactly 0 parameters, 2 given in %s on line %d -NULL array(2) { [0]=> string(%d) "%s" [1]=> string(%d) "%s" } - -Warning: get_included_files() expects exactly 0 parameters, 1 given in %s on line %d -NULL array(2) { [0]=> string(%d) "%s" diff --git a/Zend/tests/015.phpt b/Zend/tests/015.phpt index ccf5e4ddb09eb..deea89d14d87a 100644 --- a/Zend/tests/015.phpt +++ b/Zend/tests/015.phpt @@ -3,9 +3,7 @@ trigger_error() tests --FILE-- --EXPECTF-- -Warning: trigger_error() expects at least 1 parameter, 0 given in %s on line %d -NULL - Notice: error in %s on line %d bool(true) -Warning: trigger_error() expects parameter 1 to be string, array given in %s on line %d -NULL - Warning: Invalid error type specified in %s on line %d bool(false) diff --git a/Zend/tests/017.phpt b/Zend/tests/017.phpt index ed1b2a38a5a63..619365cbce17f 100644 --- a/Zend/tests/017.phpt +++ b/Zend/tests/017.phpt @@ -3,8 +3,6 @@ builtin functions tests --FILE-- --EXPECTF-- -Warning: get_resource_type() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: get_resource_type() expects parameter 1 to be resource, string given in %s on line %d -NULL string(6) "stream" string(7) "Unknown" string(5) "array" int(%d) string(5) "array" int(%d) - -Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in %s on line %d -NULL - -Warning: get_defined_constants() expects at most 1 parameter, 2 given in %s on line %d -NULL string(5) "array" string(5) "array" int(%d) string(5) "array" int(%d) - -Warning: get_declared_interfaces() expects exactly 0 parameters, 1 given in %s on line %d -NULL string(5) "array" int(%d) - -Warning: get_extension_funcs() expects exactly 1 parameter, 0 given in %s on line %d -NULL bool(false) string(5) "array" int(%d) diff --git a/Zend/tests/018.phpt b/Zend/tests/018.phpt index 5ced729fce1eb..97e53b105008f 100644 --- a/Zend/tests/018.phpt +++ b/Zend/tests/018.phpt @@ -3,12 +3,8 @@ constant() tests --FILE-- --EXPECTF-- -Warning: constant() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: constant() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: constant(): Couldn't find constant in %s on line %d NULL - -Warning: constant() expects parameter 1 to be string, array given in %s on line %d -NULL int(1) string(4) "test" Done diff --git a/Zend/tests/020.phpt b/Zend/tests/020.phpt index 1e2bcff387fb8..efc221cb4fb65 100644 --- a/Zend/tests/020.phpt +++ b/Zend/tests/020.phpt @@ -3,9 +3,7 @@ func_get_arg() invalid usage --FILE-- --EXPECTF-- -Warning: func_get_arg() expects exactly 1 parameter, 3 given in %s on line %d -NULL - Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d bool(false) -Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d bool(false) Done diff --git a/Zend/tests/bug31720.phpt b/Zend/tests/bug31720.phpt index c4680a4789e11..9031dec030006 100644 --- a/Zend/tests/bug31720.phpt +++ b/Zend/tests/bug31720.phpt @@ -4,11 +4,14 @@ Bug #31720 (Invalid object callbacks not caught in array_walk()) getMessage(), "\n"; +} ?> ===DONE=== --EXPECTF-- Notice: Undefined variable: nonesuchvar in %s on line %d - -Warning: array_walk() expects parameter 2 to be a valid callback, first array member is not a valid class name or object in %s on line %d +array_walk() expects parameter 2 to be a valid callback, first array member is not a valid class name or object ===DONE=== diff --git a/Zend/tests/bug45186.phpt b/Zend/tests/bug45186.phpt index 411c2ea072bcb..1c25a86921fdb 100644 --- a/Zend/tests/bug45186.phpt +++ b/Zend/tests/bug45186.phpt @@ -31,10 +31,14 @@ $x->test(); call_user_func(array('BAR','x')); call_user_func('BAR::www'); -call_user_func('self::y'); +try { + call_user_func('self::y'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- __call: string(3) "ABC" __call: @@ -50,5 +54,4 @@ string(1) "y" ok __callstatic: string(3) "www" - -Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active in %sbug45186.php on line 31 +call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active diff --git a/Zend/tests/bug45186_2.phpt b/Zend/tests/bug45186_2.phpt index 7c813a909c617..cb098136a0183 100644 --- a/Zend/tests/bug45186_2.phpt +++ b/Zend/tests/bug45186_2.phpt @@ -26,11 +26,19 @@ $x = new bar; $x->test(); call_user_func(array('BAR','x')); -call_user_func('BAR::www'); -call_user_func('self::y'); +try { + call_user_func('BAR::www'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func('self::y'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- __call: string(3) "ABC" __call: @@ -44,7 +52,5 @@ string(1) "y" __call: string(1) "y" ok - -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'bar' does not have a method 'www' in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active in %sbug45186_2.php on line 27 +call_user_func() expects parameter 1 to be a valid callback, class 'bar' does not have a method 'www' +call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt index f18c25a6c204a..b0e769e05a01b 100644 --- a/Zend/tests/bug46106.phpt +++ b/Zend/tests/bug46106.phpt @@ -15,8 +15,13 @@ function test($x) { } $x = new ReflectionFunction('str_pad'); -test($x); +try { + test($x); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> DONE --EXPECT-- +str_pad() expects at least 2 parameters, 1 given DONE diff --git a/Zend/tests/bug51827.phpt b/Zend/tests/bug51827.phpt index 0834749454db7..77bdc069c3067 100644 --- a/Zend/tests/bug51827.phpt +++ b/Zend/tests/bug51827.phpt @@ -16,4 +16,8 @@ register_shutdown_function('exploDe'); --EXPECTF-- int(1) -Warning: explode() expects at least 2 parameters, 0 given in Unknown on line %d +Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 parameters, 0 given in [no active file]:0 +Stack trace: +#0 [internal function]: explode() +#1 {main} + thrown in [no active file] on line 0 diff --git a/Zend/tests/bug70895.phpt b/Zend/tests/bug70895.phpt index 896bf00a7b29c..71ff19a0b54fb 100644 --- a/Zend/tests/bug70895.phpt +++ b/Zend/tests/bug70895.phpt @@ -3,13 +3,23 @@ Bug #70895 null ptr deref and segfault with crafted callable --FILE-- getMessage(), "\n"; +} +try { + array_map("%n %i", 0); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + array_map("%n %i aoeu %f aoeu %p", 0); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTREGEX-- -Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n' not found or invalid function name in .+ - -Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name in .+ - -Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name in .+bug70895.php on line \d+ +--EXPECT-- +array_map() expects parameter 1 to be a valid callback, function '%n' not found or invalid function name +array_map() expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name +array_map() expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name diff --git a/Zend/tests/bug70898.phpt b/Zend/tests/bug70898.phpt index e31ee894bf989..fa6e96d83f362 100644 --- a/Zend/tests/bug70898.phpt +++ b/Zend/tests/bug70898.phpt @@ -2,21 +2,15 @@ Bug #70895 null ptr deref and segfault with crafted callable --FILE-- getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name in %sbug70898.php on line %d - -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d - -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d - -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d - -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d - -Warning: implode(): Argument must be an array in %sbug70898.php on line %d +--EXPECT-- +array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name diff --git a/Zend/tests/bug73338.phpt b/Zend/tests/bug73338.phpt index df4c3b66e4392..816a526445360 100644 --- a/Zend/tests/bug73338.phpt +++ b/Zend/tests/bug73338.phpt @@ -14,5 +14,6 @@ try { (function() { call_user_func("fail"); })(); } catch (Error $e) {} try { [new class { static function foo() {} function __destruct () { throw new Error; } }, "foo"](); } catch (Error $e) {} ?> ---EXPECTF-- -Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in %s on line %d +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/tests/call_user_func_001.phpt b/Zend/tests/call_user_func_001.phpt index 15d0aec2637ca..a6e43f30605a8 100644 --- a/Zend/tests/call_user_func_001.phpt +++ b/Zend/tests/call_user_func_001.phpt @@ -22,14 +22,20 @@ namespace testing { call_user_func(__NAMESPACE__ .'\foobar', 'foobar'); $class = __NAMESPACE__ .'\foo'; - call_user_func(array(new $class, 'priv'), 'foobar'); - call_user_func(array(new $class, 'prot'), 'foobar'); + try { + call_user_func(array(new $class, 'priv'), 'foobar'); + } catch (\TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + call_user_func(array(new $class, 'prot'), 'foobar'); + } catch (\TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> ---EXPECTF-- +--EXPECT-- string(6) "foobar" - -Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() +call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() diff --git a/Zend/tests/call_user_func_002.phpt b/Zend/tests/call_user_func_002.phpt index 454c6fda9661b..9d007a8af35a8 100644 --- a/Zend/tests/call_user_func_002.phpt +++ b/Zend/tests/call_user_func_002.phpt @@ -4,26 +4,38 @@ Testing call_user_func() with autoload and passing invalid params getMessage(), "\n"; +} +try { + call_user_func(array('', 'bar')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func(array($foo, 'bar')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func(array($foo, '')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- string(3) "foo" - -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found +call_user_func() expects parameter 1 to be a valid callback, class '' not found Notice: Undefined variable: foo in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object Notice: Undefined variable: foo in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/class_exists_002.phpt b/Zend/tests/class_exists_002.phpt index ebe04575afbef..5e5df1d37188f 100644 --- a/Zend/tests/class_exists_002.phpt +++ b/Zend/tests/class_exists_002.phpt @@ -12,15 +12,11 @@ var_dump(class_exists(NULL)); var_dump(class_exists('FOO')); var_dump(class_exists('bar')); var_dump(class_exists(1)); -var_dump(class_exists(new stdClass)); ?> ---EXPECTF-- +--EXPECT-- bool(false) bool(false) bool(true) bool(false) bool(false) - -Warning: class_exists() expects parameter 1 to be string, object given in %s on line %d -NULL diff --git a/Zend/tests/closure_040.phpt b/Zend/tests/closure_040.phpt index 231ab4081cbd7..531ecb271a7df 100644 --- a/Zend/tests/closure_040.phpt +++ b/Zend/tests/closure_040.phpt @@ -25,9 +25,6 @@ $ca = $a->getIncrementor(); $cas = $a->getStaticIncrementor(); $ca->bindTo($a, array()); -$ca->bindTo(array(), 'A'); -$ca->bindTo($a, array(), ""); -$ca->bindTo(); $cas->bindTo($a, 'A'); ?> @@ -36,10 +33,4 @@ Notice: Array to string conversion in %s on line %d Warning: Class 'Array' not found in %s on line %d -Warning: Closure::bindTo() expects parameter 1 to be object, array given in %s on line 25 - -Warning: Closure::bindTo() expects at most 2 parameters, 3 given in %s on line %d - -Warning: Closure::bindTo() expects at least 1 parameter, 0 given in %s on line %d - Warning: Cannot bind an instance to a static closure in %s on line %d diff --git a/Zend/tests/error_reporting10.phpt b/Zend/tests/error_reporting10.phpt index 8b0c7b99233a1..c18c04d8f0059 100644 --- a/Zend/tests/error_reporting10.phpt +++ b/Zend/tests/error_reporting10.phpt @@ -8,7 +8,6 @@ error_reporting(E_ALL); function make_exception() { @$blah; - str_replace(); error_reporting(0); throw new Exception(); } diff --git a/Zend/tests/exception_handler_004.phpt b/Zend/tests/exception_handler_004.phpt index 69a4136b0881c..6552141b73c55 100644 --- a/Zend/tests/exception_handler_004.phpt +++ b/Zend/tests/exception_handler_004.phpt @@ -5,8 +5,6 @@ exception handler tests - 4 set_exception_handler("fo"); set_exception_handler(array("", "")); -set_exception_handler(); -set_exception_handler("foo", "bar"); echo "Done\n"; ?> @@ -14,8 +12,4 @@ echo "Done\n"; Warning: set_exception_handler() expects the argument (fo) to be a valid callback in %s on line %d Warning: set_exception_handler() expects the argument (::) to be a valid callback in %s on line %d - -Warning: set_exception_handler() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: set_exception_handler() expects exactly 1 parameter, 2 given in %s on line %d Done diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt index a8ba71c0bfb16..5c0770ff65e92 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt @@ -2,9 +2,10 @@ Call internal function with incorrect number of arguments --FILE-- getMessage(), "\n"; +} +--EXPECT-- +substr() expects at least 2 parameters, 1 given diff --git a/Zend/tests/interface_exists_001.phpt b/Zend/tests/interface_exists_001.phpt index ab20dd20ea173..84e9c6df1e42e 100644 --- a/Zend/tests/interface_exists_001.phpt +++ b/Zend/tests/interface_exists_001.phpt @@ -9,13 +9,9 @@ interface foo { var_dump(interface_exists('foo')); var_dump(interface_exists(1)); var_dump(interface_exists(NULL)); -var_dump(interface_exists(new stdClass)); ?> ---EXPECTF-- +--EXPECT-- bool(true) bool(false) bool(false) - -Warning: interface_exists() expects parameter 1 to be string, object given in %s on line %d -NULL diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt index 027aa64c2036c..63884abc79222 100644 --- a/Zend/tests/methods-on-non-objects-call-user-func.phpt +++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt @@ -2,11 +2,12 @@ call_user_func() in combination with "Call to a member function method() on a non-object" --FILE-- getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d -NULL -Alive +--EXPECT-- +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/trait_exists_001.phpt b/Zend/tests/trait_exists_001.phpt index 10ce3fa0cba11..8a7c55d58608d 100644 --- a/Zend/tests/trait_exists_001.phpt +++ b/Zend/tests/trait_exists_001.phpt @@ -9,13 +9,9 @@ trait foo { var_dump(trait_exists('foo')); var_dump(trait_exists(1)); var_dump(trait_exists(NULL)); -var_dump(trait_exists(new stdClass)); ?> ---EXPECTF-- +--EXPECT-- bool(true) bool(false) bool(false) - -Warning: trait_exists() expects parameter 1 to be string, object given in %s on line %d -NULL diff --git a/Zend/tests/unexpected_ref_bug.phpt b/Zend/tests/unexpected_ref_bug.phpt index ba61ee582addf..c7f66f05a00f2 100644 --- a/Zend/tests/unexpected_ref_bug.phpt +++ b/Zend/tests/unexpected_ref_bug.phpt @@ -2,16 +2,17 @@ Crash when function parameter modified via unexpected reference --FILE-- --EXPECT-- diff --git a/Zend/zend.c b/Zend/zend.c index 915845a03a3e1..582a7bc4fcdec 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1528,35 +1528,14 @@ ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) /* {{{ */ va_end(va); } /* }}} */ -ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */ +ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) /* {{{ */ { va_list va; char *message = NULL; va_start(va, format); zend_vspprintf(&message, 0, format, va); - if (throw_exception) { - zend_throw_exception(zend_ce_type_error, message, 0); - } else { - zend_error(E_WARNING, "%s", message); - } - efree(message); - - va_end(va); -} /* }}} */ - -ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) /* {{{ */ -{ - va_list va; - char *message = NULL; - - va_start(va, format); - zend_vspprintf(&message, 0, format, va); - if (throw_exception) { - zend_throw_exception(zend_ce_argument_count_error, message, 0); - } else { - zend_error(E_WARNING, "%s", message); - } + zend_throw_exception(zend_ce_argument_count_error, message, 0); efree(message); va_end(va); diff --git a/Zend/zend.h b/Zend/zend.h index cf64b77458477..f05352bd410c5 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -303,8 +303,7 @@ extern ZEND_API void (*zend_post_shutdown_cb)(void); ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); -ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); -ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); +ZEND_API ZEND_COLD void zend_argument_count_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); ZEND_COLD void zenderror(const char *error); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 68863889535cb..4a31914e1a552 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -90,7 +90,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */ const char *space; const char *class_name = get_active_class_name(&space); - zend_internal_argument_count_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name()); + zend_argument_count_error("Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name()); } /* }}} */ @@ -173,28 +173,7 @@ ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_error(void) /* { zend_function *active_function = EG(current_execute_data)->func; const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; - zend_internal_argument_count_error( - ZEND_ARG_USES_STRICT_TYPES(), - "%s%s%s() expects %s %d parameter%s, %d given", - class_name, \ - class_name[0] ? "::" : "", \ - ZSTR_VAL(active_function->common.function_name), - "exactly", - 0, - "s", - num_args); - return FAILURE; -} -/* }}} */ - -ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_exception(void) /* {{{ */ -{ - int num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - zend_function *active_function = EG(current_execute_data)->func; - const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; - - zend_internal_argument_count_error( - 1, + zend_argument_count_error( "%s%s%s() expects %s %d parameter%s, %d given", class_name, \ class_name[0] ? "::" : "", \ @@ -213,27 +192,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_ zend_function *active_function = EG(current_execute_data)->func; const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; - zend_internal_argument_count_error( - ZEND_ARG_USES_STRICT_TYPES(), - "%s%s%s() expects %s %d parameter%s, %d given", - class_name, \ - class_name[0] ? "::" : "", \ - ZSTR_VAL(active_function->common.function_name), - min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most", - num_args < min_num_args ? min_num_args : max_num_args, - (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", - num_args); -} -/* }}} */ - -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_exception(int min_num_args, int max_num_args) /* {{{ */ -{ - int num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - zend_function *active_function = EG(current_execute_data)->func; - const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; - - zend_internal_argument_count_error( - 1, + zend_argument_count_error( "%s%s%s() expects %s %d parameter%s, %d given", class_name, \ class_name[0] ? "::" : "", \ @@ -254,21 +213,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z NULL }; - zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be %s, %s given", - class_name, space, get_active_function_name(), num, expected_error[expected_type], zend_zval_type_name(arg)); -} -/* }}} */ - -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception(int num, zend_expected_type expected_type, zval *arg) /* {{{ */ -{ - const char *space; - const char *class_name = get_active_class_name(&space); - static const char * const expected_error[] = { - Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_STR) - NULL - }; - - zend_internal_type_error(1, "%s%s%s() expects parameter %d to be %s, %s given", + zend_type_error("%s%s%s() expects parameter %d to be %s, %s given", class_name, space, get_active_function_name(), num, expected_error[expected_type], zend_zval_type_name(arg)); } /* }}} */ @@ -278,17 +223,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, const char *space; const char *class_name = get_active_class_name(&space); - zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be %s, %s given", - class_name, space, get_active_function_name(), num, name, zend_zval_type_name(arg)); -} -/* }}} */ - -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception(int num, char *name, zval *arg) /* {{{ */ -{ - const char *space; - const char *class_name = get_active_class_name(&space); - - zend_internal_type_error(1, "%s%s%s() expects parameter %d to be %s, %s given", + zend_type_error("%s%s%s() expects parameter %d to be %s, %s given", class_name, space, get_active_function_name(), num, name, zend_zval_type_name(arg)); } /* }}} */ @@ -298,18 +233,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e const char *space; const char *class_name = get_active_class_name(&space); - zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a valid callback, %s", - class_name, space, get_active_function_name(), num, error); - efree(error); -} -/* }}} */ - -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, char *error) /* {{{ */ -{ - const char *space; - const char *class_name = get_active_class_name(&space); - - zend_internal_type_error(1, "%s%s%s() expects parameter %d to be a valid callback, %s", + zend_type_error("%s%s%s() expects parameter %d to be a valid callback, %s", class_name, space, get_active_function_name(), num, error); efree(error); } @@ -330,7 +254,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc const char *space; const char *class_name = get_active_class_name(&space); - zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given", + zend_type_error("%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given", class_name, space, get_active_function_name(), num, ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg)); *pce = NULL; @@ -341,7 +265,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc const char *space; const char *class_name = get_active_class_name(&space); - zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects parameter %d to be a valid class name, '%s' given", + zend_type_error("%s%s%s() expects parameter %d to be a valid class name, '%s' given", class_name, space, get_active_function_name(), num, Z_STRVAL_P(arg)); return 0; @@ -803,16 +727,13 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) { const char *space; const char *class_name = get_active_class_name(&space); - zend_bool throw_exception = - ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW); if (error) { - zend_internal_type_error(throw_exception, "%s%s%s() expects parameter %d %s", + zend_type_error("%s%s%s() expects parameter %d %s", class_name, space, get_active_function_name(), arg_num, error); efree(error); } else { - zend_internal_type_error(throw_exception, - "%s%s%s() expects parameter %d to be %s, %s given", + zend_type_error("%s%s%s() expects parameter %d to be %s, %s given", class_name, space, get_active_function_name(), arg_num, expected_type, zend_zval_type_name(arg)); } @@ -919,8 +840,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va, if (!(flags & ZEND_PARSE_PARAMS_QUIET)) { zend_function *active_function = EG(current_execute_data)->func; const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; - zend_bool throw_exception = ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW); - zend_internal_argument_count_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given", + zend_argument_count_error("%s%s%s() expects %s %d parameter%s, %d given", class_name, class_name[0] ? "::" : "", ZSTR_VAL(active_function->common.function_name), @@ -1013,7 +933,7 @@ ZEND_API int zend_parse_parameters_throw(int num_args, const char *type_spec, .. { va_list va; int retval; - int flags = ZEND_PARSE_PARAMS_THROW; + int flags = 0; va_start(va, type_spec); retval = zend_parse_va_args(num_args, type_spec, &va, flags); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index dc8b2dc956968..04cd0fbf3c536 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -248,12 +248,12 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array); #define zend_parse_parameters_none() \ (EXPECTED(ZEND_NUM_ARGS() == 0) ? SUCCESS : zend_wrong_parameters_none_error()) #define zend_parse_parameters_none_throw() \ - (EXPECTED(ZEND_NUM_ARGS() == 0) ? SUCCESS : zend_wrong_parameters_none_exception()) + zend_parse_parameters_none() /* Parameter parsing API -- andrei */ +#define ZEND_PARSE_PARAMS_THROW 0 /* No longer used, zpp always uses exceptions */ #define ZEND_PARSE_PARAMS_QUIET (1<<1) -#define ZEND_PARSE_PARAMS_THROW (1<<2) ZEND_API int zend_parse_parameters(int num_args, const char *type_spec, ...); ZEND_API int zend_parse_parameters_ex(int flags, int num_args, const char *type_spec, ...); ZEND_API int zend_parse_parameters_throw(int num_args, const char *type_spec, ...); @@ -957,15 +957,10 @@ typedef enum _zend_expected_type { } zend_expected_type; ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_error(void); -ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_exception(void); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_num_args, int max_num_args); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_exception(int min_num_args, int max_num_args); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, zend_expected_type expected_type, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception(int num, zend_expected_type expected_type, zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, char *name, zval *arg); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception(int num, char *name, zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error); -ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, char *error); #define ZPP_ERROR_OK 0 #define ZPP_ERROR_FAILURE 1 @@ -999,11 +994,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, cha (UNEXPECTED(_num_args > _max_num_args) && \ EXPECTED(_max_num_args >= 0))) { \ if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_parameters_count_exception(_min_num_args, _max_num_args); \ - } else { \ - zend_wrong_parameters_count_error(_min_num_args, _max_num_args); \ - } \ + zend_wrong_parameters_count_error(_min_num_args, _max_num_args); \ } \ _error_code = ZPP_ERROR_FAILURE; \ break; \ @@ -1026,23 +1017,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception(int num, cha if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \ if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \ if (_error_code == ZPP_ERROR_WRONG_CALLBACK) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_callback_exception(_i, _error); \ - } else { \ - zend_wrong_callback_error(_i, _error); \ - } \ + zend_wrong_callback_error(_i, _error); \ } else if (_error_code == ZPP_ERROR_WRONG_CLASS) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_parameter_class_exception(_i, _error, _arg); \ - } else { \ - zend_wrong_parameter_class_error(_i, _error, _arg); \ - } \ + zend_wrong_parameter_class_error(_i, _error, _arg); \ } else if (_error_code == ZPP_ERROR_WRONG_ARG) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_parameter_type_exception(_i, _expected_type, _arg); \ - } else { \ - zend_wrong_parameter_type_error(_i, _expected_type, _arg); \ - } \ + zend_wrong_parameter_type_error(_i, _expected_type, _arg); \ } \ } \ failure; \ diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 1dc9fe97fbe63..fb19a1ac9134c 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2535,7 +2535,7 @@ static zend_never_inline uint32_t ZEND_FASTCALL zend_array_key_exists_slow(zval if (UNEXPECTED(Z_TYPE_INFO_P(subject) == IS_UNDEF)) { ZVAL_UNDEFINED_OP2(); } - zend_internal_type_error(EX_USES_STRICT_TYPES(), "array_key_exists() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(subject))); + zend_type_error("array_key_exists() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(subject))); return IS_NULL; } } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 59bf5c1e2e33c..6cf53691863ac 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3744,15 +3744,10 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM) init_func_run_time_cache(&func->op_array); } } else { - zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); FREE_OP2(); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } - func = (zend_function*)&zend_pass_function; - called_scope = NULL; - object = NULL; + HANDLE_EXCEPTION(); } call = zend_vm_stack_push_call_frame(call_info, @@ -4919,17 +4914,16 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY, NUM) ZEND_VM_C_GOTO(send_array); } } - zend_internal_type_error(EX_USES_STRICT_TYPES(), "call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); + zend_type_error("call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) { OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(call)->func)); } if (Z_TYPE(EX(call)->This) == IS_OBJECT) { OBJ_RELEASE(Z_OBJ(EX(call)->This)); } - EX(call)->func = (zend_function*)&zend_pass_function; - Z_OBJ(EX(call)->This) = NULL; - ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS); FREE_UNFETCHED_OP2(); + FREE_OP1(); + HANDLE_EXCEPTION(); } else { uint32_t arg_num; HashTable *ht; @@ -7797,8 +7791,8 @@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY) } zval_ptr_dtor(&tmp); } - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); - ZVAL_NULL(EX_VAR(opline->result.var)); + zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } FREE_OP1(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 576872d18b924..9306a1b58f8e6 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1673,17 +1673,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O goto send_array; } } - zend_internal_type_error(EX_USES_STRICT_TYPES(), "call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); + zend_type_error("call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) { OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(call)->func)); } if (Z_TYPE(EX(call)->This) == IS_OBJECT) { OBJ_RELEASE(Z_OBJ(EX(call)->This)); } - EX(call)->func = (zend_function*)&zend_pass_function; - Z_OBJ(EX(call)->This) = NULL; - ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS); FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var); + FREE_OP(free_op1); + HANDLE_EXCEPTION(); } else { uint32_t arg_num; HashTable *ht; @@ -3971,8 +3970,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST } zval_ptr_dtor(&tmp); } - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); - ZVAL_NULL(EX_VAR(opline->result.var)); + zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } @@ -5597,15 +5596,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS init_func_run_time_cache(&func->op_array); } } else { - zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } - func = (zend_function*)&zend_pass_function; - called_scope = NULL; - object = NULL; + HANDLE_EXCEPTION(); } call = zend_vm_stack_push_call_frame(call_info, @@ -7827,15 +7821,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV init_func_run_time_cache(&func->op_array); } } else { - zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); zval_ptr_dtor_nogc(free_op2); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } - func = (zend_function*)&zend_pass_function; - called_scope = NULL; - object = NULL; + HANDLE_EXCEPTION(); } call = zend_vm_stack_push_call_frame(call_info, @@ -10750,15 +10739,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H init_func_run_time_cache(&func->op_array); } } else { - zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); - if (UNEXPECTED(EG(exception))) { - HANDLE_EXCEPTION(); - } - func = (zend_function*)&zend_pass_function; - called_scope = NULL; - object = NULL; + HANDLE_EXCEPTION(); } call = zend_vm_stack_push_call_frame(call_info, @@ -12998,8 +12982,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_TMPVAR_HANDLER(ZEN } zval_ptr_dtor(&tmp); } - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); - ZVAL_NULL(EX_VAR(opline->result.var)); + zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } zval_ptr_dtor_nogc(free_op1); @@ -40871,8 +40855,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OP } zval_ptr_dtor(&tmp); } - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); - ZVAL_NULL(EX_VAR(opline->result.var)); + zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt index 5a6b2878b8087..ee1872f0efb97 100644 --- a/ext/bz2/tests/001.phpt +++ b/ext/bz2/tests/001.phpt @@ -5,7 +5,6 @@ bzopen() and invalid parameters --FILE-- --EXPECTF-- -Warning: bzopen() expects exactly 2 parameters, 0 given in %s on line %d -NULL - Warning: bzopen(): '' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d bool(false) diff --git a/ext/bz2/tests/003-mb.phpt b/ext/bz2/tests/003-mb.phpt index 6454d0d1823a7..13bc85d5e7190 100644 --- a/ext/bz2/tests/003-mb.phpt +++ b/ext/bz2/tests/003-mb.phpt @@ -6,8 +6,6 @@ bzread() tests --EXPECTF-- -Warning: bzread() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: bzread() expects at most 2 parameters, 3 given in %s on line %d -bool(false) string(0) "" Warning: bzread(): length may not be negative in %s on line %d diff --git a/ext/bz2/tests/003.phpt b/ext/bz2/tests/003.phpt index 23b005ac119b6..af1a65e5b2620 100644 --- a/ext/bz2/tests/003.phpt +++ b/ext/bz2/tests/003.phpt @@ -6,8 +6,6 @@ bzread() tests --EXPECTF-- -Warning: bzread() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: bzread() expects at most 2 parameters, 3 given in %s on line %d -bool(false) string(0) "" Warning: bzread(): length may not be negative in %s on line %d diff --git a/ext/bz2/tests/005.phpt b/ext/bz2/tests/005.phpt index da29a6d0b4079..4241513526a89 100644 --- a/ext/bz2/tests/005.phpt +++ b/ext/bz2/tests/005.phpt @@ -10,7 +10,6 @@ Drifting further everyday Getting lost within myself Nothing matters no one else"; -var_dump(bzcompress()); var_dump(bzcompress(1,1,1)); var_dump(bzcompress($string, 100)); var_dump(bzcompress($string, 100, -1)); @@ -23,8 +22,6 @@ $data2 = bzcompress($string, 1, 10); $data3 = $data2; $data3{3} = 0; -var_dump(bzdecompress()); -var_dump(bzdecompress(1,1,1)); var_dump(bzdecompress(1,1)); var_dump(bzdecompress($data3)); var_dump(bzdecompress($data3,1)); @@ -38,19 +35,11 @@ var_dump(bzdecompress($data2)); echo "Done\n"; ?> --EXPECTF-- -Warning: bzcompress() expects at least 1 parameter, 0 given in %s on line %d -NULL string(%d) "BZ%a" int(-2) int(-2) int(-2) int(-2) - -Warning: bzdecompress() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: bzdecompress() expects at most 2 parameters, 3 given in %s on line %d -bool(false) int(-5) int(-5) int(-5) diff --git a/ext/calendar/tests/jdtomonthname.phpt b/ext/calendar/tests/jdtomonthname.phpt index 2ad50a450e24f..c7fa6cc774038 100644 --- a/ext/calendar/tests/jdtomonthname.phpt +++ b/ext/calendar/tests/jdtomonthname.phpt @@ -9,7 +9,6 @@ $jd_days = Array( 2453396, 2440588, -1, - array(), 10000000 ); @@ -52,28 +51,6 @@ string(0) "" string(0) "" string(0) "" -=== -Notice: Array to string conversion in %sjdtomonthname.php on line %d -Array - -Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d -bool(false) - -Warning: jdmonthname() expects parameter 1 to be int, array given in %s on line %d -bool(false) - === 10000000 string(3) "Dec" string(8) "December" diff --git a/ext/curl/tests/curl_setopt_error.phpt b/ext/curl/tests/curl_setopt_error.phpt index ab864d4b2da63..0a7db7265fc37 100644 --- a/ext/curl/tests/curl_setopt_error.phpt +++ b/ext/curl/tests/curl_setopt_error.phpt @@ -9,37 +9,17 @@ Paul Sohier getMessage(), "\n"; +} -curl_setopt(false, false, false); -curl_setopt($ch, '', false); -curl_setopt($ch, 1, ''); curl_setopt($ch, -10, 0); ?> --EXPECTF-- *** curl_setopt() call with incorrect parameters - -Warning: curl_setopt() expects exactly 3 parameters, 0 given in %s on line %d - -Warning: curl_setopt() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: curl_setopt() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: curl_setopt() expects exactly 3 parameters, 2 given in %s on line %d - -Warning: curl_setopt() expects exactly 3 parameters, 2 given in %s on line %d - -Warning: curl_setopt() expects exactly 3 parameters, 2 given in %s on line %d - -Warning: curl_setopt() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: curl_setopt() expects parameter 2 to be int, string given in %s on line %d +curl_setopt() expects parameter 2 to be int, string given Warning: curl_setopt(): Invalid curl configuration option in %scurl_setopt_error.php on line %d diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 0a8ccb574be71..d0267695f2f66 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2802,7 +2802,7 @@ PHP_METHOD(DateTime, __construct) size_t time_str_len = 0; zend_error_handling error_handling; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 2) + ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_STRING(time_str, time_str_len) Z_PARAM_OBJECT_OF_CLASS_EX(timezone_object, date_ce_timezone, 1, 0) @@ -2824,7 +2824,7 @@ PHP_METHOD(DateTimeImmutable, __construct) size_t time_str_len = 0; zend_error_handling error_handling; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 0, 2) + ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_STRING(time_str, time_str_len) Z_PARAM_OBJECT_OF_CLASS_EX(timezone_object, date_ce_timezone, 1, 0) @@ -3829,7 +3829,7 @@ PHP_METHOD(DateTimeZone, __construct) php_timezone_obj *tzobj; zend_error_handling error_handling; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1) + ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(tz) ZEND_PARSE_PARAMETERS_END(); @@ -4245,7 +4245,7 @@ PHP_METHOD(DateInterval, __construct) timelib_rel_time *reltime; zend_error_handling error_handling; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1) + ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(interval_string) ZEND_PARSE_PARAMETERS_END(); diff --git a/ext/date/tests/005.phpt b/ext/date/tests/005.phpt index e1075ef248c63..23fff3b731ad2 100644 --- a/ext/date/tests/005.phpt +++ b/ext/date/tests/005.phpt @@ -6,9 +6,6 @@ date_default_timezone_set('UTC'); $t = mktime(0,0,0, 6, 27, 2006); -var_dump(idate()); -var_dump(idate(1,1,1)); - var_dump(idate(1,1)); var_dump(idate("")); var_dump(idate(0)); @@ -20,12 +17,6 @@ var_dump(idate("'")); echo "Done\n"; ?> --EXPECTF-- -Warning: idate() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: idate() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - Warning: idate(): Unrecognized date format token. in %s on line %d bool(false) diff --git a/ext/date/tests/006.phpt b/ext/date/tests/006.phpt index 425430a470fb0..5171c430e2760 100644 --- a/ext/date/tests/006.phpt +++ b/ext/date/tests/006.phpt @@ -4,7 +4,6 @@ checkdate() tests ---EXPECTF-- -Warning: checkdate() expects exactly 3 parameters, 0 given in %s on line %d -bool(false) +--EXPECT-- bool(true) bool(false) bool(false) diff --git a/ext/date/tests/007.phpt b/ext/date/tests/007.phpt index 141e2517533b6..4e0b24ce7505f 100644 --- a/ext/date/tests/007.phpt +++ b/ext/date/tests/007.phpt @@ -5,7 +5,6 @@ localtime() tests date_default_timezone_set('UTC'); $t = mktime(0,0,0, 6, 27, 2006); -var_dump(localtime(1,1,1)); var_dump(localtime()); var_dump(localtime($t)); @@ -15,8 +14,6 @@ var_dump(localtime($t, false)); echo "Done\n"; ?> --EXPECTF-- -Warning: localtime() expects at most 2 parameters, 3 given in %s on line %d -bool(false) array(9) { [0]=> int(%d) diff --git a/ext/date/tests/008.phpt b/ext/date/tests/008.phpt index e67b4bd0a4f19..701403d1f8771 100644 --- a/ext/date/tests/008.phpt +++ b/ext/date/tests/008.phpt @@ -5,7 +5,6 @@ getdate() tests date_default_timezone_set('UTC'); $t = mktime(0,0,0, 6, 27, 2006); -var_dump(getdate(1,1)); var_dump(getdate($t)); var_dump(getdate()); @@ -13,8 +12,6 @@ var_dump(getdate()); echo "Done\n"; ?> --EXPECTF-- -Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d -bool(false) array(11) { ["seconds"]=> int(0) diff --git a/ext/date/tests/009.phpt b/ext/date/tests/009.phpt index ae8011eebd244..40d5c5f72b9d7 100644 --- a/ext/date/tests/009.phpt +++ b/ext/date/tests/009.phpt @@ -11,16 +11,12 @@ date_default_timezone_set('Asia/Jerusalem'); $t = mktime(0,0,0, 6, 27, 2006); -var_dump(strftime()); - var_dump(strftime("")); var_dump(strftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t)); var_dump(strftime("%%q %%a", $t)); var_dump(strftime("%q", $t)); var_dump(strftime("blah", $t)); -var_dump(gmstrftime()); - var_dump(gmstrftime("")); var_dump(gmstrftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t)); var_dump(gmstrftime("%%q %%a", $t)); @@ -30,17 +26,12 @@ var_dump(gmstrftime("blah", $t)); echo "Done\n"; ?> --EXPECTF-- -Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) bool(false) string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s %s %" string(5) "%q %a" string(%d) "%s" string(4) "blah" - -Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) bool(false) string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s %s %" diff --git a/ext/date/tests/009_win32.phpt b/ext/date/tests/009_win32.phpt index 3da5b35c81cab..63ad623b18334 100644 --- a/ext/date/tests/009_win32.phpt +++ b/ext/date/tests/009_win32.phpt @@ -15,8 +15,6 @@ setlocale(LC_TIME, "en-us"); $t = mktime(0,0,0, 6, 27, 2006); -var_dump(strftime()); - var_dump(strftime("")); var_dump(strftime("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t)); @@ -25,8 +23,6 @@ var_dump(strftime("%%q %%a", $t)); var_dump(strftime("blah", $t)); -var_dump(gmstrftime()); - var_dump(gmstrftime("")); var_dump(gmstrftime("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t)); @@ -40,15 +36,10 @@ echo "Done\n"; setlocale(LC_TIME, $loc); ?> --EXPECTF-- -Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) bool(false) string(%d) "Tue Tuesday Jun June 6/27/2006 12:00:00 AM 27 00 12 178 06 00 AM 00 26 26 2 6/27/2006 12:00:00 AM 06 2006 %s" string(5) "%q %a" string(4) "blah" - -Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) bool(false) string(%d) "Mon Monday Jun June 6/26/2006 9:00:00 PM 26 21 09 177 06 00 PM 00 26 26 1 6/26/2006 9:00:00 PM 06 2006 %s" string(5) "%q %a" diff --git a/ext/date/tests/011.phpt b/ext/date/tests/011.phpt index 092a4b7758ffa..ca9820c4ef567 100644 --- a/ext/date/tests/011.phpt +++ b/ext/date/tests/011.phpt @@ -4,7 +4,6 @@ timezone_name_from_abbr() tests ---EXPECTF-- -Warning: timezone_name_from_abbr() expects at least 1 parameter, 0 given in %s on line %d -bool(false) +--EXPECT-- string(13) "Europe/Berlin" bool(false) bool(false) diff --git a/ext/date/tests/012.phpt b/ext/date/tests/012.phpt index be7e4e32afaad..ee8faf1c002ec 100644 --- a/ext/date/tests/012.phpt +++ b/ext/date/tests/012.phpt @@ -7,15 +7,10 @@ date_default_timezone_set('UTC'); $dto = date_create("2006-12-12"); var_dump(date_isodate_set($dto, 2006, 2, 15)); var_dump($dto->format("Y/m/d H:i:s")); -var_dump(date_isodate_set($dto, 2006)); -var_dump($dto->format("Y/m/d H:i:s")); var_dump(date_isodate_set($dto, 2006, 5)); var_dump($dto->format("Y/m/d H:i:s")); var_dump(date_isodate_set($dto, 2006, 100, 15)); var_dump($dto->format("Y/m/d H:i:s")); -var_dump(date_isodate_set($dto, 2006, 100, 15, 10)); -var_dump($dto->format("Y/m/d H:i:s")); - echo "Done\n"; ?> --EXPECTF-- @@ -28,10 +23,6 @@ object(DateTime)#1 (3) { string(3) "UTC" } string(19) "2006/01/23 00:00:00" - -Warning: date_isodate_set() expects at least 3 parameters, 2 given in %s on line %d -bool(false) -string(19) "2006/01/23 00:00:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2006-01-30 00:00:00.000000" @@ -50,8 +41,4 @@ object(DateTime)#1 (3) { string(3) "UTC" } string(19) "2007/12/10 00:00:00" - -Warning: date_isodate_set() expects at most 4 parameters, 5 given in %s on line %d -bool(false) -string(19) "2007/12/10 00:00:00" Done diff --git a/ext/date/tests/013.phpt b/ext/date/tests/013.phpt index 266dafe06a5be..6010071be6b5d 100644 --- a/ext/date/tests/013.phpt +++ b/ext/date/tests/013.phpt @@ -7,10 +7,6 @@ date_default_timezone_set('UTC'); $dto = date_create("2006-12-12"); var_dump($dto); var_dump($dto->format("Y.m.d H:i:s")); -var_dump(date_date_set()); -var_dump($dto->format("Y.m.d H:i:s")); -var_dump(date_date_set($dto, 2006, 5)); -var_dump($dto->format("Y.m.d H:i:s")); var_dump(date_date_set($dto, 2006, 2, 15)); var_dump($dto->format("Y.m.d H:i:s")); var_dump(date_date_set($dto, 2006, 24, 60)); @@ -28,14 +24,6 @@ object(DateTime)#%d (3) { string(3) "UTC" } string(19) "2006.12.12 00:00:00" - -Warning: date_date_set() expects exactly 4 parameters, 0 given in %s on line %d -bool(false) -string(19) "2006.12.12 00:00:00" - -Warning: date_date_set() expects exactly 4 parameters, 3 given in %s on line %d -bool(false) -string(19) "2006.12.12 00:00:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2006-02-15 00:00:00.000000" diff --git a/ext/date/tests/014.phpt b/ext/date/tests/014.phpt index 2e72bdabe073e..5c1c061e756e6 100644 --- a/ext/date/tests/014.phpt +++ b/ext/date/tests/014.phpt @@ -10,7 +10,6 @@ var_dump($dto); $dtz = date_timezone_get($dto); var_dump($dtz); -var_dump(timezone_offset_get()); var_dump(timezone_offset_get($dtz, $dto)); var_dump(timezone_offset_get($dto, $dtz)); @@ -32,9 +31,6 @@ object(DateTimeZone)#%d (2) { ["timezone"]=> string(3) "UTC" } - -Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) int(0) Fatal error: Uncaught TypeError: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTime given in %s:%d diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt index 6b1e16ae6713d..1270382158a8a 100644 --- a/ext/date/tests/68062.phpt +++ b/ext/date/tests/68062.phpt @@ -6,8 +6,12 @@ DateTimeZone::getOffset() accepts a DateTimeInterface object $tz = new DateTimeZone('Europe/London'); $dt = new DateTimeImmutable('2014-09-20', $tz); -echo $tz->getOffset($dt); -echo $tz->getOffset(1); ---EXPECTF-- +echo $tz->getOffset($dt), "\n"; +try { + echo $tz->getOffset(1); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +--EXPECT-- 3600 -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, int given in %s +DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, int given diff --git a/ext/date/tests/DateTimeImmutable_createFromMutable.phpt b/ext/date/tests/DateTimeImmutable_createFromMutable.phpt index ac92fb4bb4780..671afc12296e6 100644 --- a/ext/date/tests/DateTimeImmutable_createFromMutable.phpt +++ b/ext/date/tests/DateTimeImmutable_createFromMutable.phpt @@ -1,5 +1,5 @@ --TEST-- -Tests for DateTimeImmutable::createFromMutable. +Tests for DateTimeImmutable::createFromMutable --INI-- date.timezone=Europe/London --FILE-- @@ -9,8 +9,11 @@ $current = "2014-03-02 16:24:08"; $i = DateTimeImmutable::createFromMutable( date_create( $current ) ); var_dump( $i ); -$i = DateTimeImmutable::createFromMutable( date_create_immutable( $current ) ); -var_dump( $i ); +try { + DateTimeImmutable::createFromMutable( date_create_immutable( $current ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- object(DateTimeImmutable)#%d (3) { @@ -21,6 +24,4 @@ object(DateTimeImmutable)#%d (3) { ["timezone"]=> string(13) "Europe/London" } - -Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in %stests%eDateTimeImmutable_createFromMutable.php on line %d -NULL +DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given diff --git a/ext/date/tests/DateTime_createFromImmutable.phpt b/ext/date/tests/DateTime_createFromImmutable.phpt index ee7731855a630..841a3d4d33be0 100644 --- a/ext/date/tests/DateTime_createFromImmutable.phpt +++ b/ext/date/tests/DateTime_createFromImmutable.phpt @@ -14,8 +14,11 @@ $m->modify('+ 1 hour'); var_dump( $i->format('Y-m-d H:i:s') === $current ); -$m = DateTime::createFromImmutable( date_create( $current ) ); -var_dump( $m ); +try { + DateTime::createFromImmutable( date_create( $current ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- object(DateTime)#%d (3) { @@ -27,6 +30,4 @@ object(DateTime)#%d (3) { string(13) "Europe/London" } bool(true) - -Warning: DateTime::createFromImmutable() expects parameter 1 to be DateTimeImmutable, object given in %stests%eDateTime_createFromImmutable.php on line %d -NULL +DateTime::createFromImmutable() expects parameter 1 to be DateTimeImmutable, object given diff --git a/ext/date/tests/bug36988.phpt b/ext/date/tests/bug36988.phpt index ab0f3a3c8a7d5..691bb4a7e24d7 100644 --- a/ext/date/tests/bug36988.phpt +++ b/ext/date/tests/bug36988.phpt @@ -6,7 +6,11 @@ Bug #36988 (mktime freezes on long numbers) getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: mktime() expects parameter 6 to be int, float given in %s on line %d +--EXPECT-- +mktime() expects parameter 6 to be int, float given diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index cbcccf84b90bd..b1f7f25d7bc7b 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -13,7 +13,11 @@ var_dump($d->format('Y-m-d H:i:s U')); var_dump($d->getTimestamp()); var_dump($d->format('U')); -$d->setTimestamp(100000000000); +try { + $d->setTimestamp(100000000000); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($d->format('Y-m-d H:i:s U')); var_dump($d->getTimestamp()); @@ -24,8 +28,7 @@ var_dump($i->format('%s')); string(32) "5138-11-16 09:46:40 100000000000" bool(false) string(12) "100000000000" - -Warning: DateTime::setTimestamp() expects parameter 1 to be int, float given in %s on line %d +DateTime::setTimestamp() expects parameter 1 to be int, float given string(32) "5138-11-16 09:46:40 100000000000" bool(false) string(10) "1215752192" diff --git a/ext/date/tests/bug70245.phpt b/ext/date/tests/bug70245.phpt index f754bf65a1770..b480192326b75 100644 --- a/ext/date/tests/bug70245.phpt +++ b/ext/date/tests/bug70245.phpt @@ -3,8 +3,11 @@ Bug #70245 (strtotime does not emit warning when 2nd parameter is object or stri --FILE-- getMessage(), "\n"; +} ?> --EXPECTF-- -Warning: strtotime() expects parameter 2 to be int, object given in %sbug70245.php on line %d -bool(false) +strtotime() expects parameter 2 to be int, object given diff --git a/ext/date/tests/date_default_timezone_set_error.phpt b/ext/date/tests/date_default_timezone_set_error.phpt index 15c6aa6fedc6d..24a851ff012b2 100644 --- a/ext/date/tests/date_default_timezone_set_error.phpt +++ b/ext/date/tests/date_default_timezone_set_error.phpt @@ -9,13 +9,6 @@ Test date_default_timezone_set() function : error variations echo "*** Testing date_default_timezone_set() : error variations ***\n"; -echo "\n-- Testing date_default_timezone_set() function with less than expected no. of arguments --\n"; -var_dump( date_default_timezone_set() ); - -echo "\n-- Testing date_default_timezone_set() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( date_default_timezone_set("GMT", $extra_arg) ); - echo "\n-- Testing date_default_timezone_set() function with invalid timezone identifier --\n"; var_dump( date_default_timezone_set("foo") ); @@ -24,16 +17,6 @@ var_dump( date_default_timezone_set("foo") ); --EXPECTF-- *** Testing date_default_timezone_set() : error variations *** --- Testing date_default_timezone_set() function with less than expected no. of arguments -- - -Warning: date_default_timezone_set() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing date_default_timezone_set() function with more than expected no. of arguments -- - -Warning: date_default_timezone_set() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing date_default_timezone_set() function with invalid timezone identifier -- Notice: date_default_timezone_set(): Timezone ID 'foo' is invalid in %s on line %d diff --git a/ext/date/tests/date_parse_001.phpt b/ext/date/tests/date_parse_001.phpt index b5c5ac0f48feb..0d58c1f8e964b 100644 --- a/ext/date/tests/date_parse_001.phpt +++ b/ext/date/tests/date_parse_001.phpt @@ -12,7 +12,6 @@ Test basic date_parse() var_dump(date_parse("03-03")); var_dump(date_parse("0-0")); var_dump(date_parse("")); - var_dump(date_parse(array())); echo "Done\n"; ?> --EXPECTF-- @@ -298,7 +297,4 @@ array(12) { ["is_localtime"]=> bool(false) } - -Warning: date_parse() expects parameter 1 to be string, array given in %sdate_parse_001.php on line %d -bool(false) Done diff --git a/ext/date/tests/date_parse_error.phpt b/ext/date/tests/date_parse_error.phpt index 9f444bb435056..dc03944004b52 100644 --- a/ext/date/tests/date_parse_error.phpt +++ b/ext/date/tests/date_parse_error.phpt @@ -12,14 +12,6 @@ date_default_timezone_set("Europe/London"); echo "*** Testing date_parse() : error conditions ***\n"; -echo "\n-- Testing date_parse() function with zero arguments --\n"; -var_dump( date_parse() ); - -echo "\n-- Testing date_parse() function with more than expected no. of arguments --\n"; -$date = "2009-02-27 10:00:00.5"; -$extra_arg = 10; -var_dump( date_parse($date, $extra_arg) ); - echo "\n-- Testing date_parse() function with unexpected characters in \$date argument --\n"; $invalid_date = "2OO9-02--27 10:00?00.5"; var_dump( date_parse($invalid_date) ); @@ -29,16 +21,6 @@ var_dump( date_parse($invalid_date) ); --EXPECTF-- *** Testing date_parse() : error conditions *** --- Testing date_parse() function with zero arguments -- - -Warning: date_parse() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing date_parse() function with more than expected no. of arguments -- - -Warning: date_parse() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing date_parse() function with unexpected characters in $date argument -- array(13) { ["year"]=> diff --git a/ext/date/tests/date_sunrise_variation9.phpt b/ext/date/tests/date_sunrise_variation9.phpt deleted file mode 100644 index 75794cc632a34..0000000000000 --- a/ext/date/tests/date_sunrise_variation9.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test date_sunrise() function : usage variation - Passing high positive and negative float values to time argument. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing date_sunrise() : usage variation *** - --- Testing date_sunrise() function by passing float 12.3456789000e10 value to time -- - -Warning: date_sunrise() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be int, float given in %s on line %d -bool(false) - --- Testing date_sunrise() function by passing float -12.3456789000e10 value to time -- - -Warning: date_sunrise() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunrise() expects parameter 1 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/date_sunset_variation9.phpt b/ext/date/tests/date_sunset_variation9.phpt deleted file mode 100644 index 4f897e1df0505..0000000000000 --- a/ext/date/tests/date_sunset_variation9.phpt +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Test date_sunset() function : usage variation - Passing high positive and negative float values to time argument. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing date_sunset() : usage variation *** - --- Testing date_sunset() function by passing float 12.3456789000e10 value to time -- - -Warning: date_sunset() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be int, float given in %s on line %d -bool(false) - --- Testing date_sunset() function by passing float -12.3456789000e10 value to time -- - -Warning: date_sunset() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: date_sunset() expects parameter 1 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/getdate_variation7.phpt b/ext/date/tests/getdate_variation7.phpt deleted file mode 100644 index e24f3e6d84ee0..0000000000000 --- a/ext/date/tests/getdate_variation7.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Test getdate() function : usage variation - Passing high positive and negative float values to timestamp. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing getdate() : usage variation *** - --- Testing getdate() function by passing float 12.3456789000e10 value to timestamp -- - -Warning: getdate() expects parameter 1 to be int, float given in %s on line %d -bool(false) - --- Testing getdate() function by passing float -12.3456789000e10 value to timestamp -- - -Warning: getdate() expects parameter 1 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/gmdate_variation14.phpt b/ext/date/tests/gmdate_variation14.phpt deleted file mode 100644 index 5b6c48fca5048..0000000000000 --- a/ext/date/tests/gmdate_variation14.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test gmdate() function : usage variation - Passing high positive and negetive float values to timestamp. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gmdate() : usage variation *** - --- Testing gmdate() function with float 12.3456789000e10 to timestamp -- - -Warning: gmdate() expects parameter 2 to be int, float given in %s on line %d -bool(false) - --- Testing gmdate() function with float -12.3456789000e10 to timestamp -- - -Warning: gmdate() expects parameter 2 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/gmmktime_basic.phpt b/ext/date/tests/gmmktime_basic.phpt index c125e353c4d11..dca6675e6c267 100644 --- a/ext/date/tests/gmmktime_basic.phpt +++ b/ext/date/tests/gmmktime_basic.phpt @@ -21,15 +21,9 @@ $year = 2008; // Calling gmmktime() with all possible arguments var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year) ); -// Calling gmmktime() with mandatory arguments -var_dump( gmmktime() ); - ?> ===DONE=== --EXPECTF-- *** Testing gmmktime() : basic functionality *** int(1218182888) - -Warning: gmmktime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) ===DONE=== diff --git a/ext/date/tests/idate_variation3.phpt b/ext/date/tests/idate_variation3.phpt deleted file mode 100644 index 9b6bc567e01ce..0000000000000 --- a/ext/date/tests/idate_variation3.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Test idate() function : usage variation - Passing higher positive and negetive float values to timestamp. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing idate() : usage variation *** - --- Testing idate() function with float 12.3456789000e10 to timestamp -- - -Warning: idate() expects parameter 2 to be int, float given in %s on line %d -bool(false) - --- Testing idate() function with float -12.3456789000e10 to timestamp -- - -Warning: idate() expects parameter 2 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/localtime_variation3.phpt b/ext/date/tests/localtime_variation3.phpt deleted file mode 100644 index 42731dc6ce084..0000000000000 --- a/ext/date/tests/localtime_variation3.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -Test localtime() function : usage variation - Passing higher positive and negetive float values to timestamp. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing localtime() : usage variation *** - --- Testing localtime() function with 'float 12.3456789000e10' to timestamp -- - -Warning: localtime() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: localtime() expects parameter 1 to be int, float given in %s on line %d -bool(false) - --- Testing localtime() function with 'float -12.3456789000e10' to timestamp -- - -Warning: localtime() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: localtime() expects parameter 1 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/microtime_error.phpt b/ext/date/tests/microtime_error.phpt index 699416d3826b9..0e4b5d5a359d4 100644 --- a/ext/date/tests/microtime_error.phpt +++ b/ext/date/tests/microtime_error.phpt @@ -7,13 +7,6 @@ Test wrong number of arguments for microtime() * Function is implemented in ext/standard/microtime.c */ -$opt_arg_0 = true; -$extra_arg = 1; - -echo "\n-- Too many arguments --\n"; -var_dump(microtime($opt_arg_0, $extra_arg)); - - echo "\n-- Bad Arg types --\n"; $bad_args = array(null, @@ -25,17 +18,16 @@ $bad_args = array(null, foreach ($bad_args as $bad_arg) { echo "\n--> bad arg: "; var_dump($bad_arg); - var_dump(microtime($bad_arg)); + try { + var_dump(microtime($bad_arg)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> ===DONE=== --EXPECTF-- --- Too many arguments -- - -Warning: microtime() expects at most 1 parameter, 2 given in %s on line 11 -NULL - -- Bad Arg types -- --> bad arg: NULL @@ -56,15 +48,11 @@ float(%s) int(0) } } - -Warning: microtime() expects parameter 1 to be bool, array given in %s on line 25 -NULL +microtime() expects parameter 1 to be bool, array given --> bad arg: object(stdClass)#%d (0) { } - -Warning: microtime() expects parameter 1 to be bool, object given in %s on line 25 -NULL +microtime() expects parameter 1 to be bool, object given --> bad arg: int(1) float(%s) diff --git a/ext/date/tests/mktime_error.phpt b/ext/date/tests/mktime_error.phpt index 02e94a7d4d95d..c507ecf78b157 100644 --- a/ext/date/tests/mktime_error.phpt +++ b/ext/date/tests/mktime_error.phpt @@ -14,7 +14,11 @@ date_default_timezone_set("Europe/London"); echo "*** Testing mktime() : error conditions ***\n"; echo "\n-- Testing mktime() function with Zero arguments --\n"; -var_dump( mktime() ); +try { + var_dump( mktime() ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "\n-- Testing mktime() function with more than expected no. of arguments --\n"; $hour = 10; @@ -24,7 +28,11 @@ $month = 7; $day = 2; $year = 1963; $extra_arg = 10; -var_dump( mktime($hour, $minute, $sec, $month, $day, $year, $extra_arg) ); +try { + var_dump( mktime($hour, $minute, $sec, $month, $day, $year, $extra_arg) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ===DONE=== @@ -32,12 +40,8 @@ var_dump( mktime($hour, $minute, $sec, $month, $day, $year, $extra_arg) ); *** Testing mktime() : error conditions *** -- Testing mktime() function with Zero arguments -- - -Warning: mktime() expects at least 1 parameter, 0 given in %s on line %d -bool(false) +mktime() expects at least 1 parameter, 0 given -- Testing mktime() function with more than expected no. of arguments -- - -Warning: mktime() expects at most 6 parameters, 7 given in %s on line %d -bool(false) +mktime() expects at most 6 parameters, 7 given ===DONE=== diff --git a/ext/date/tests/strftime_variation23.phpt b/ext/date/tests/strftime_variation23.phpt deleted file mode 100644 index 22f079702ae3d..0000000000000 --- a/ext/date/tests/strftime_variation23.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Test strftime() function : usage variation - Checking large positive and negative float values to timestamp. ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing strftime() : usage variation *** - --- Testing strftime() function with float 12.3456789000e10 to timestamp -- - -Warning: strftime() expects parameter 2 to be int, float given in %s on line %d -bool(false) - --- Testing strftime() function with float -12.3456789000e10 to timestamp -- - -Warning: strftime() expects parameter 2 to be int, float given in %s on line %d -bool(false) -===DONE=== diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index 413755ac72bf8..f77836c8ef8c9 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -15,31 +15,6 @@ $date = date_create("GMT"); echo "*** Testing timezone_offset_get() : error conditions ***\n"; -echo "\n-- Testing timezone_offset_get() function with zero arguments --\n"; -try { - var_dump( timezone_offset_get() ); -} catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; -} - -echo "\n-- Testing timezone_offset_get() function with less than expected no. of arguments --\n"; -try { - var_dump( timezone_offset_get($tz) ); -} catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; -} - -echo "\n-- Testing timezone_offset_get() function with more than expected no. of arguments --\n"; -$extra_arg = 99; -try { - var_dump( timezone_offset_get($tz, $date, $extra_arg) ); -} catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; -} - echo "\n-- Testing timezone_offset_get() function with an invalid values for \$object argument --\n"; $invalid_obj = new stdClass(); try { @@ -90,21 +65,6 @@ try { --EXPECTF-- *** Testing timezone_offset_get() : error conditions *** --- Testing timezone_offset_get() function with zero arguments -- - -Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) - --- Testing timezone_offset_get() function with less than expected no. of arguments -- - -Warning: timezone_offset_get() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) - --- Testing timezone_offset_get() function with more than expected no. of arguments -- - -Warning: timezone_offset_get() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) - -- Testing timezone_offset_get() function with an invalid values for $object argument -- string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of stdClass given" diff --git a/ext/dba/tests/dba011.phpt b/ext/dba/tests/dba011.phpt index 0891a30f4823e..1642587a4331b 100644 --- a/ext/dba/tests/dba011.phpt +++ b/ext/dba/tests/dba011.phpt @@ -9,7 +9,6 @@ die("info $HND handler used"); --EXPECTF-- database handler: flatfile - -Warning: Wrong parameter count for dba_open() in %sdba011.php on line %d -NULL resource(%d) of type (dba) Warning: dba_open(%stest0.dbm,n): No such handler: bogus in %sdba011.php on line %d diff --git a/ext/dba/tests/dba_handlers.phpt b/ext/dba/tests/dba_handlers.phpt index 41c23b5cf6f82..3c9d1745147f7 100644 --- a/ext/dba/tests/dba_handlers.phpt +++ b/ext/dba/tests/dba_handlers.phpt @@ -35,13 +35,9 @@ check(dba_handlers(null)); echo "Test 3\n"; -check(dba_handlers(1, 2)); - -echo "Test 4\n"; - check(dba_handlers(0)); -echo "Test 5 - full info\n"; +echo "Test 4 - full info\n"; $h = dba_handlers(1); foreach ($h as $key => $val) { if ($key === "flatfile") { @@ -61,9 +57,6 @@ Success: flatfile enabled Test 2 Success: flatfile enabled Test 3 - -Warning: dba_handlers() expects at most 1 parameter, 2 given in %sdba_handlers.php on line %d -Test 4 Success: flatfile enabled -Test 5 - full info +Test 4 - full info Success: flatfile enabled diff --git a/ext/dba/tests/dba_optimize.phpt b/ext/dba/tests/dba_optimize.phpt index 6347d4983ca30..21e135de81b01 100644 --- a/ext/dba/tests/dba_optimize.phpt +++ b/ext/dba/tests/dba_optimize.phpt @@ -23,8 +23,6 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { echo dba_exists("key$i", $db_file) ? "Y" : "N"; } echo "\n"; - var_dump(dba_optimize()); - var_dump(dba_optimize("")); var_dump(dba_optimize($db_file)); dba_close($db_file); } else { @@ -41,11 +39,5 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { --EXPECTF-- database handler: flatfile 2YY - -Warning: dba_optimize() expects exactly 1 parameter, 0 given in %sdba_optimize.php on line %d -NULL - -Warning: dba_optimize() expects parameter 1 to be resource, string given in %sdba_optimize.php on line %d -NULL bool(true) ===DONE=== diff --git a/ext/dba/tests/dba_split.phpt b/ext/dba/tests/dba_split.phpt index 0989f09feb9d6..1f660daf096f1 100644 --- a/ext/dba/tests/dba_split.phpt +++ b/ext/dba/tests/dba_split.phpt @@ -7,7 +7,6 @@ DBA Split Test ?> --FILE-- --EXPECTF-- -Warning: Wrong parameter count for dba_key_split() in %sdba_split.php on line %d -NULL array(2) { [0]=> string(0) "" diff --git a/ext/dba/tests/dba_sync.phpt b/ext/dba/tests/dba_sync.phpt index 0e64ea2905c1c..5b2ae5bb76470 100644 --- a/ext/dba/tests/dba_sync.phpt +++ b/ext/dba/tests/dba_sync.phpt @@ -23,8 +23,6 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { echo dba_exists("key$i", $db_file) ? "Y" : "N"; } echo "\n"; - var_dump(dba_sync()); - var_dump(dba_sync("")); var_dump(dba_sync($db_file)); dba_close($db_file); } else { @@ -41,11 +39,5 @@ if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) { --EXPECTF-- database handler: flatfile 2YY - -Warning: dba_sync() expects exactly 1 parameter, 0 given in %sdba_sync.php on line %d -NULL - -Warning: dba_sync() expects parameter 1 to be resource, string given in %sdba_sync.php on line %d -NULL bool(true) ===DONE=== diff --git a/ext/exif/tests/exif_imagetype_error.phpt b/ext/exif/tests/exif_imagetype_error.phpt index 3627ad969d812..2098b2d2735f3 100644 --- a/ext/exif/tests/exif_imagetype_error.phpt +++ b/ext/exif/tests/exif_imagetype_error.phpt @@ -12,13 +12,6 @@ Test exif_imagetype() function : error conditions echo "*** Testing exif_imagetype() : error conditions ***\n"; -echo "\n-- Testing exif_imagetype() function with no arguments --\n"; -var_dump( exif_imagetype() ); - -echo "\n-- Testing exif_imagetype() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( exif_imagetype(dirname(__FILE__).'/test2.jpg', $extra_arg) ); - echo "\n-- Testing exif_imagetype() function with an unknown file --\n"; var_dump( exif_imagetype(dirname(__FILE__).'/foo.jpg') ); @@ -28,16 +21,6 @@ var_dump( exif_imagetype(dirname(__FILE__).'/foo.jpg') ); --EXPECTF-- *** Testing exif_imagetype() : error conditions *** --- Testing exif_imagetype() function with no arguments -- - -Warning: exif_imagetype() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing exif_imagetype() function with more than expected no. of arguments -- - -Warning: exif_imagetype() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -- Testing exif_imagetype() function with an unknown file -- Warning: exif_imagetype(%s/foo.jpg): failed to open stream: No such file or directory in %s on line %d diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 57963146afe47..6343b48aa9d4b 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -292,9 +292,8 @@ PHP_FUNCTION(finfo_open) FILEINFO_DECLARE_INIT_OBJECT(object) char resolved_path[MAXPATHLEN]; zend_error_handling zeh; - int flags = object ? ZEND_PARSE_PARAMS_THROW : 0; - if (zend_parse_parameters_ex(flags, ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) { RETURN_FALSE; } diff --git a/ext/fileinfo/tests/bug71527-mb.phpt b/ext/fileinfo/tests/bug71527-mb.phpt index 60af049f4fd7a..1f56b679f87af 100644 --- a/ext/fileinfo/tests/bug71527-mb.phpt +++ b/ext/fileinfo/tests/bug71527-mb.phpt @@ -9,11 +9,8 @@ USE_ZEND_ALLOC=0 --FILE-- --EXPECTF-- Warning: finfo_open(): Failed to load magic database at '%sbug71527私はガラスを食べられます.magic'. in %sbug71527-mb.php on line %d - -Warning: finfo_file() expects parameter 1 to be resource, bool given in %sbug71527-mb.php on line %d bool(false) diff --git a/ext/fileinfo/tests/bug71527.phpt b/ext/fileinfo/tests/bug71527.phpt index 1feb29dd736b7..a670a79b51e58 100644 --- a/ext/fileinfo/tests/bug71527.phpt +++ b/ext/fileinfo/tests/bug71527.phpt @@ -9,11 +9,8 @@ USE_ZEND_ALLOC=0 --FILE-- --EXPECTF-- Warning: finfo_open(): Failed to load magic database at '%sbug71527.magic'. in %sbug71527.php on line %d - -Warning: finfo_file() expects parameter 1 to be resource, bool given in %sbug71527.php on line %d bool(false) diff --git a/ext/fileinfo/tests/finfo_close_error.phpt b/ext/fileinfo/tests/finfo_close_error.phpt index 374787aa55de6..acd26896f0fd5 100644 --- a/ext/fileinfo/tests/finfo_close_error.phpt +++ b/ext/fileinfo/tests/finfo_close_error.phpt @@ -12,17 +12,8 @@ Test finfo_close() function : error conditions echo "*** Testing finfo_close() : error conditions ***\n"; -$magicFile = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'magic'; -$finfo = finfo_open( FILEINFO_MIME, $magicFile ); -$fp = fopen( __FILE__, 'r' ); - -echo "\n-- Testing finfo_close() function with Zero arguments --\n"; -var_dump( finfo_close() ); - -echo "\n-- Testing finfo_close() function with more than expected no. of arguments --\n"; -var_dump( finfo_close( $finfo, '10') ); - echo "\n-- Testing finfo_close() function with wrong resource type --\n"; +$fp = fopen( __FILE__, 'r' ); var_dump( finfo_close( $fp ) ); ?> @@ -30,16 +21,6 @@ var_dump( finfo_close( $fp ) ); --EXPECTF-- *** Testing finfo_close() : error conditions *** --- Testing finfo_close() function with Zero arguments -- - -Warning: finfo_close() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing finfo_close() function with more than expected no. of arguments -- - -Warning: finfo_close() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing finfo_close() function with wrong resource type -- Warning: finfo_close(): supplied resource is not a valid file_info resource in %s on line %d diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt index 17935c367602b..98901f3a8efc8 100644 --- a/ext/fileinfo/tests/finfo_open_001.phpt +++ b/ext/fileinfo/tests/finfo_open_001.phpt @@ -5,7 +5,12 @@ finfo_open(): Testing magic_file names --FILE-- getMessage(), "\n"; +} + var_dump(finfo_open(FILEINFO_MIME, NULL)); var_dump(finfo_open(FILEINFO_MIME, '')); var_dump(finfo_open(FILEINFO_MIME, 123)); @@ -14,8 +19,7 @@ var_dump(finfo_open(FILEINFO_MIME, '/foo/bar/inexistent')); ?> --EXPECTF-- -Warning: finfo_open() expects parameter 2 to be a valid path, string given in %s on line %d -bool(false) +finfo_open() expects parameter 2 to be a valid path, string given resource(%d) of type (file_info) resource(%d) of type (file_info) diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt index 6a0ef96a4e49b..60fcbce9c2fb6 100644 --- a/ext/fileinfo/tests/finfo_open_error.phpt +++ b/ext/fileinfo/tests/finfo_open_error.phpt @@ -15,10 +15,13 @@ $magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic'; echo "*** Testing finfo_open() : error functionality ***\n"; var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) ); -var_dump( finfo_open( array(), $magicFile ) ); -var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) ); var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) ); -var_dump( finfo_open( 'foobar' ) ); + +try { + var_dump( finfo_open( 'foobar' ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} try { var_dump( new finfo('foobar') ); @@ -31,23 +34,15 @@ try { --EXPECTF-- *** Testing finfo_open() : error functionality *** -Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error.php on line 12 +Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error.php on line %d -Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error.php on line 12 +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 12 +Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error.php on line %d bool(false) -Warning: finfo_open() expects parameter 1 to be int, array given in %sfinfo_open_error.php on line 13 -bool(false) - -Warning: finfo_open() expects at most 2 parameters, 3 given in %sfinfo_open_error.php on line 14 -bool(false) - -Notice: finfo_open(): Warning: using regular magic file `%smagic' in %sfinfo_open_error.php on line 15 +Notice: finfo_open(): Warning: using regular magic file `%smagic' in %sfinfo_open_error.php on line %d resource(6) of type (file_info) - -Warning: finfo_open() expects parameter 1 to be int, string given in %sfinfo_open_error.php on line 16 -bool(false) +finfo_open() expects parameter 1 to be int, string given finfo::__construct() expects parameter 1 to be int, string given ===DONE=== diff --git a/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt b/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt index 615afd40f8e16..2641e7eb11358 100644 --- a/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt +++ b/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt @@ -17,14 +17,12 @@ echo "*** Testing finfo_set_flags() : basic functionality ***\n"; var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) ); var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) ); -var_dump( finfo_set_flags() ); finfo_close( $finfo ); // OO way $finfo = new finfo( FILEINFO_NONE, $magicFile ); var_dump( $finfo->set_flags( FILEINFO_MIME ) ); -var_dump( $finfo->set_flags() ); ?> ===DONE=== @@ -32,11 +30,5 @@ var_dump( $finfo->set_flags() ); *** Testing finfo_set_flags() : basic functionality *** bool(true) bool(true) - -Warning: finfo_set_flags() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) bool(true) - -Warning: finfo::set_flags() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) ===DONE=== diff --git a/ext/fileinfo/tests/finfo_set_flags_basic.phpt b/ext/fileinfo/tests/finfo_set_flags_basic.phpt index 3b7168a6845c3..12748c385f46d 100644 --- a/ext/fileinfo/tests/finfo_set_flags_basic.phpt +++ b/ext/fileinfo/tests/finfo_set_flags_basic.phpt @@ -17,14 +17,12 @@ echo "*** Testing finfo_set_flags() : basic functionality ***\n"; var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) ); var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) ); -var_dump( finfo_set_flags() ); finfo_close( $finfo ); // OO way $finfo = new finfo( FILEINFO_NONE, $magicFile ); var_dump( $finfo->set_flags( FILEINFO_MIME ) ); -var_dump( $finfo->set_flags() ); ?> ===DONE=== @@ -32,11 +30,5 @@ var_dump( $finfo->set_flags() ); *** Testing finfo_set_flags() : basic functionality *** bool(true) bool(true) - -Warning: finfo_set_flags() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) bool(true) - -Warning: finfo::set_flags() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) ===DONE=== diff --git a/ext/filter/tests/007.phpt b/ext/filter/tests/007.phpt index 87f9a77a12085..dc966b8cc9a21 100644 --- a/ext/filter/tests/007.phpt +++ b/ext/filter/tests/007.phpt @@ -14,20 +14,12 @@ var_dump(filter_has_var(INPUT_GET, "abc")); var_dump(filter_has_var(INPUT_GET, "nonex")); var_dump(filter_has_var(INPUT_GET, " ")); var_dump(filter_has_var(INPUT_GET, "")); -var_dump(filter_has_var(INPUT_GET, array())); var_dump(filter_has_var(INPUT_POST, "b")); var_dump(filter_has_var(INPUT_POST, "bbc")); var_dump(filter_has_var(INPUT_POST, "nonex")); var_dump(filter_has_var(INPUT_POST, " ")); var_dump(filter_has_var(INPUT_POST, "")); -var_dump(filter_has_var(INPUT_POST, array())); - -var_dump(filter_has_var(-1, "")); -var_dump(filter_has_var("", "")); -var_dump(filter_has_var(array(), array())); -var_dump(filter_has_var(array(), "")); -var_dump(filter_has_var("", array())); echo "Done\n"; ?> @@ -37,28 +29,9 @@ bool(true) bool(false) bool(false) bool(false) - -Warning: filter_has_var() expects parameter 2 to be string, array given in %s007.php on line %d -bool(false) bool(true) bool(true) bool(false) bool(false) bool(false) - -Warning: filter_has_var() expects parameter 2 to be string, array given in %s007.php on line %d -bool(false) -bool(false) - -Warning: filter_has_var() expects parameter 1 to be int, string given in %s007.php on line %d -bool(false) - -Warning: filter_has_var() expects parameter 1 to be int, array given in %s007.php on line %d -bool(false) - -Warning: filter_has_var() expects parameter 1 to be int, array given in %s007.php on line %d -bool(false) - -Warning: filter_has_var() expects parameter 1 to be int, string given in %s007.php on line %d -bool(false) Done diff --git a/ext/filter/tests/008.phpt b/ext/filter/tests/008.phpt index a3cb7172ff533..b34c977425f6a 100644 --- a/ext/filter/tests/008.phpt +++ b/ext/filter/tests/008.phpt @@ -6,7 +6,6 @@ filter_list() @@ -57,7 +56,4 @@ array(22) { [21]=> string(8) "callback" } - -Warning: filter_list() expects exactly 0 parameters, 1 given in %s on line %d -NULL Done diff --git a/ext/filter/tests/009.phpt b/ext/filter/tests/009.phpt index 5c38e5603a8ce..f456dc6dc1750 100644 --- a/ext/filter/tests/009.phpt +++ b/ext/filter/tests/009.phpt @@ -10,23 +10,15 @@ var_dump(filter_id("string")); var_dump(filter_id("url")); var_dump(filter_id("int")); var_dump(filter_id("none")); -var_dump(filter_id(array())); var_dump(filter_id(-1)); -var_dump(filter_id(0,0,0)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- int(513) int(513) int(518) int(257) bool(false) - -Warning: filter_id() expects parameter 1 to be string, array given in %s on line %d -NULL bool(false) - -Warning: filter_id() expects exactly 1 parameter, 3 given in %s on line %d -NULL Done diff --git a/ext/filter/tests/010.phpt b/ext/filter/tests/010.phpt index 3e71d331bd6b0..14f8db01af8a5 100644 --- a/ext/filter/tests/010.phpt +++ b/ext/filter/tests/010.phpt @@ -9,7 +9,6 @@ precision=14 var_dump(filter_var(array(1,"1","", "-23234", "text", "asdf234asdfgs", array()), FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY)); var_dump(filter_var(array(1.2,"1.7","", "-23234.123", "text", "asdf234.2asdfgs", array()), FILTER_VALIDATE_FLOAT, FILTER_REQUIRE_ARRAY)); -var_dump(filter_var(1, array())); var_dump(filter_var(1, FILTER_SANITIZE_STRING, 1)); var_dump(filter_var(1, FILTER_SANITIZE_STRING, 0)); var_dump(filter_var(1, FILTER_SANITIZE_STRING, array())); @@ -53,9 +52,6 @@ array(7) { array(0) { } } - -Warning: filter_var() expects parameter 2 to be int, array given in %s on line %d -NULL string(1) "1" string(1) "1" string(1) "1" diff --git a/ext/filter/tests/011.phpt b/ext/filter/tests/011.phpt index b5075d182128c..1b2a2ec3574ca 100644 --- a/ext/filter/tests/011.phpt +++ b/ext/filter/tests/011.phpt @@ -20,12 +20,6 @@ var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_FLOAT)); var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS)); var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_INT)); -var_dump(filter_var(new stdClass, "d")); - -var_dump(filter_input(INPUT_POST, "c", "", "")); -var_dump(filter_var("", "", "", "", "")); -var_dump(filter_var(0, 0, 0, 0, 0)); - echo "Done\n"; ?> --EXPECTF-- @@ -39,16 +33,4 @@ string(6) "string" float(12345.7) string(29) "<p>string</p>" bool(false) - -Warning: filter_var() expects parameter 2 to be int, string given in %s011.php on line %d -NULL - -Warning: filter_input() expects parameter 3 to be int, string given in %s011.php on line %d -NULL - -Warning: filter_var() expects at most 3 parameters, 5 given in %s011.php on line %d -NULL - -Warning: filter_var() expects at most 3 parameters, 5 given in %s011.php on line %d -NULL Done diff --git a/ext/filter/tests/039.phpt b/ext/filter/tests/039.phpt index 501414deee7c3..bdd090ae86f8e 100644 --- a/ext/filter/tests/039.phpt +++ b/ext/filter/tests/039.phpt @@ -6,7 +6,6 @@ filter_var_array() and different arguments "hoho"))); var_dump(filter_var_array(array(), -1)); @@ -51,9 +50,6 @@ echo "Done\n"; ?> --EXPECTF-- -- (1) - -Warning: filter_var_array() expects parameter 1 to be array, null given in %s on line %d -NULL array(0) { } array(2) { diff --git a/ext/filter/tests/040.phpt b/ext/filter/tests/040.phpt index d77b33135e8da..2ef6839405b80 100644 --- a/ext/filter/tests/040.phpt +++ b/ext/filter/tests/040.phpt @@ -9,9 +9,7 @@ ap[]=1&bp=test&cp= --FILE-- ---EXPECTF-- -Warning: filter_has_var() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) -bool(false) - -Warning: filter_has_var() expects parameter 2 to be string, array given in %s on line %d +--EXPECT-- bool(false) bool(true) bool(true) @@ -39,7 +31,4 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: filter_has_var() expects parameter 1 to be int, string given in %s on line %d -bool(false) Done diff --git a/ext/ftp/tests/004.phpt b/ext/ftp/tests/004.phpt index 3fcf272e3b1cc..b95c12c518d38 100644 --- a/ext/ftp/tests/004.phpt +++ b/ext/ftp/tests/004.phpt @@ -8,68 +8,22 @@ require 'skipif.inc'; --EXPECTF-- -bool(true) -string(4) "UNIX" - -Warning: ftp_alloc() expects parameter 2 to be int, array given in %s004.php on line 12 -bool(false) - -Warning: ftp_cdup() expects exactly 1 parameter, 2 given in %s004.php on line 13 -NULL - -Warning: ftp_chdir() expects parameter 2 to be string, array given in %s004.php on line 14 -NULL - -Warning: ftp_chmod() expects exactly 3 parameters, 2 given in %s on line %d +Warning: ftp_connect(): Timeout has to be greater than 0 in %s on line %d bool(false) +bool(true) -Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 16 -NULL - -Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 17 -bool(false) - -Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 18 -NULL - -Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 19 -NULL - -Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 21 -NULL - -Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 22 -NULL - -Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 24 -NULL - -Warning: ftp_login(): Not logged in. in %s004.php on line 25 +Warning: ftp_login(): Not logged in. in %s on line %d bool(false) bool(true) diff --git a/ext/ftp/tests/006.phpt b/ext/ftp/tests/006.phpt deleted file mode 100644 index ff0d2589170f3..0000000000000 --- a/ext/ftp/tests/006.phpt +++ /dev/null @@ -1,108 +0,0 @@ ---TEST-- -FTP with bogus parameters ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: ftp_connect() expects parameter 1 to be string, array given in %s006.php on line 4 -NULL - -Warning: ftp_connect(): Timeout has to be greater than 0 in %s006.php on line 5 -bool(false) - -Warning: ftp_raw() expects exactly 2 parameters, 1 given in %s006.php on line 6 -NULL - -Warning: ftp_mkdir() expects exactly 2 parameters, 1 given in %s006.php on line 7 -NULL - -Warning: ftp_rmdir() expects exactly 2 parameters, 1 given in %s006.php on line 8 -NULL - -Warning: ftp_nlist() expects exactly 2 parameters, 1 given in %s006.php on line 9 -NULL - -Warning: ftp_rawlist() expects at least 2 parameters, 1 given in %s006.php on line 10 -NULL - -Warning: ftp_fget() expects at least 3 parameters, 1 given in %s006.php on line 11 -NULL - -Warning: ftp_nb_fget() expects at least 3 parameters, 1 given in %s006.php on line 12 -NULL - -Warning: ftp_nb_get() expects at least 3 parameters, 1 given in %s006.php on line 13 -NULL - -Warning: ftp_pasv() expects exactly 2 parameters, 1 given in %s006.php on line 14 -NULL - -Warning: ftp_nb_continue() expects exactly 1 parameter, 0 given in %s006.php on line 15 -NULL - -Warning: ftp_fput() expects at least 3 parameters, 0 given in %s006.php on line 16 -NULL - -Warning: ftp_nb_fput() expects at least 3 parameters, 1 given in %s006.php on line 17 -NULL - -Warning: ftp_put() expects at least 3 parameters, 1 given in %s006.php on line 18 -NULL - -Warning: ftp_nb_put() expects at least 3 parameters, 1 given in %s006.php on line 19 -NULL - -Warning: ftp_size() expects exactly 2 parameters, 1 given in %s006.php on line 20 -NULL - -Warning: ftp_mdtm() expects exactly 2 parameters, 1 given in %s006.php on line 21 -NULL - -Warning: ftp_rename() expects exactly 3 parameters, 1 given in %s006.php on line 22 -NULL - -Warning: ftp_site() expects exactly 2 parameters, 1 given in %s006.php on line 23 -NULL - -Warning: ftp_set_option() expects exactly 3 parameters, 1 given in %s006.php on line 24 -NULL - -Warning: ftp_get_option() expects exactly 2 parameters, 1 given in %s006.php on line 25 -NULL - -Warning: ftp_mlsd() expects exactly 2 parameters, 1 given in %s006.php on line 26 -NULL - -Warning: ftp_append() expects at least 3 parameters, 1 given in %s006.php on line 27 -NULL diff --git a/ext/ftp/tests/ftp_get_basic.phpt b/ext/ftp/tests/ftp_get_basic.phpt index 60f1b1de79bc5..43022cde45cb0 100644 --- a/ext/ftp/tests/ftp_get_basic.phpt +++ b/ext/ftp/tests/ftp_get_basic.phpt @@ -29,9 +29,6 @@ unlink($tmpfname); //test non-existent file request ftp_get($ftp, $tmpfname ,'a warning.txt', FTP_ASCII); - -//test invalid ftp_get params -var_dump(ftp_get('foo', 'bar', 'baz')); ?> --EXPECTF-- bool(true) @@ -41,6 +38,3 @@ bool(true) string(21) "BINARYFoo%00Bar%0D%0A" Warning: ftp_get(): a warning: No such file or directory in %sftp_get_basic.php on line %d - -Warning: ftp_get() expects parameter 1 to be resource, string given in %s on line %d -NULL diff --git a/ext/ftp/tests/ftp_ssl_connect_error.phpt b/ext/ftp/tests/ftp_ssl_connect_error.phpt index b0ece5d63b877..13c8f9e9c02cb 100644 --- a/ext/ftp/tests/ftp_ssl_connect_error.phpt +++ b/ext/ftp/tests/ftp_ssl_connect_error.phpt @@ -12,14 +12,6 @@ echo "*** Testing ftp_ssl_connect() function : error conditions ***\n"; echo "\n-- Testing ftp_ssl_connect() function on failure --\n"; var_dump(ftp_ssl_connect('totes.invalid')); -echo "\n-- Testing ftp_ssl_connect() function invalid argument type --\n"; -ftp_ssl_connect([]); -ftp_ssl_connect('totes.invalid', []); -ftp_ssl_connect('totes.invalid', 21, []); - -echo "\n-- Testing ftp_ssl_connect() function with more than expected no. of arguments --\n"; -ftp_ssl_connect('totes.invalid', 21, 1, []); - echo "\n-- Testing ftp_ssl_connect() function timeout warning for value 0 --\n"; ftp_ssl_connect('totes.invalid', 21, 0); @@ -32,18 +24,6 @@ echo "===DONE===\n"; Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s on line %d bool(false) --- Testing ftp_ssl_connect() function invalid argument type -- - -Warning: ftp_ssl_connect() expects parameter 1 to be string, array given in %s on line %d - -Warning: ftp_ssl_connect() expects parameter 2 to be int, array given in %s on line %d - -Warning: ftp_ssl_connect() expects parameter 3 to be int, array given in %s on line %d - --- Testing ftp_ssl_connect() function with more than expected no. of arguments -- - -Warning: ftp_ssl_connect() expects at most 3 parameters, 4 given in %s on line %d - -- Testing ftp_ssl_connect() function timeout warning for value 0 -- Warning: ftp_ssl_connect(): Timeout has to be greater than 0 in %s on line %d diff --git a/ext/gd/tests/imagecolorallocatealpha_error1.phpt b/ext/gd/tests/imagecolorallocatealpha_error1.phpt index 793c02d106df9..cdc83d8479dca 100644 --- a/ext/gd/tests/imagecolorallocatealpha_error1.phpt +++ b/ext/gd/tests/imagecolorallocatealpha_error1.phpt @@ -9,17 +9,7 @@ Rafael Dohms --FILE-- --EXPECTF-- Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d - -Warning: imagecolorallocatealpha() expects parameter 1 to be resource, %s given in %s on line %d - -Warning: imagecolorallocatealpha() expects parameter 1 to be resource, array given in %s on line %d - -Warning: imagecolorallocatealpha() expects parameter 1 to be resource, null given in %s on line %d diff --git a/ext/gd/tests/imagecolorstotal_error.phpt b/ext/gd/tests/imagecolorstotal_error.phpt index 59999423ca56c..328cf12e7c765 100644 --- a/ext/gd/tests/imagecolorstotal_error.phpt +++ b/ext/gd/tests/imagecolorstotal_error.phpt @@ -1,5 +1,5 @@ --TEST-- -Test imagecolorstotal() function : error conditions - Pass incorrect number of arguments +Test imagecolorstotal() function : error conditions - Pass invalid resource type --SKIPIF-- --EXPECTF-- Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d - -Warning: imagecreatetruecolor() expects parameter 1 to be int, float given in %s on line %d - -Warning: imagecreatetruecolor() expects parameter 2 to be int, float given in %s on line %d diff --git a/ext/gd/tests/imagefilter_error1.phpt b/ext/gd/tests/imagefilter_error1.phpt index 41637994b46c0..407944d899fb1 100644 --- a/ext/gd/tests/imagefilter_error1.phpt +++ b/ext/gd/tests/imagefilter_error1.phpt @@ -11,8 +11,11 @@ if (!extension_loaded("gd")) die("skip GD not present"); getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: Wrong parameter count for imagefilter() in %s on line %d -NULL +--EXPECT-- +Wrong parameter count for imagefilter() diff --git a/ext/gd/tests/imagegd2_nullbyte_injection.phpt b/ext/gd/tests/imagegd2_nullbyte_injection.phpt index 2370d5036efd5..5eae5c719ca4f 100644 --- a/ext/gd/tests/imagegd2_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd2_nullbyte_injection.phpt @@ -22,13 +22,16 @@ $userinput = "1\0"; // from post or get data $temp = $tempdir. "/test" . $userinput .".tmp"; echo "\nimagegd2 TEST\n"; -imagegd2($image, $temp); +try { + imagegd2($image, $temp); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(file_exists($tempdir. "/test1")); var_dump(file_exists($tempdir. "/test1.tmp")); foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } ---EXPECTF-- +--EXPECT-- imagegd2 TEST - -Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d +imagegd2() expects parameter 2 to be a valid path, string given bool(false) bool(false) diff --git a/ext/gd/tests/imagegd_nullbyte_injection.phpt b/ext/gd/tests/imagegd_nullbyte_injection.phpt index 25e54fe36c6df..235bd4680c87e 100644 --- a/ext/gd/tests/imagegd_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd_nullbyte_injection.phpt @@ -22,13 +22,16 @@ $userinput = "1\0"; // from post or get data $temp = $tempdir. "/test" . $userinput .".tmp"; echo "\nimagegd TEST\n"; -imagegd($image, $temp); +try { + imagegd($image, $temp); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(file_exists($tempdir. "/test1")); var_dump(file_exists($tempdir. "/test1.tmp")); foreach (glob($tempdir . "/test*") as $file ) { unlink($file); } ---EXPECTF-- +--EXPECT-- imagegd TEST - -Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d +imagegd() expects parameter 2 to be a valid path, string given bool(false) bool(false) diff --git a/ext/gd/tests/imageistruecolor_error1.phpt b/ext/gd/tests/imageistruecolor_error1.phpt index ab0a9fe653045..e2364bcec68d3 100644 --- a/ext/gd/tests/imageistruecolor_error1.phpt +++ b/ext/gd/tests/imageistruecolor_error1.phpt @@ -9,16 +9,8 @@ Rafael Dohms ?> --FILE-- --EXPECTF-- -Warning: imageistruecolor() expects parameter 1 to be resource, string given in %s on line %d - Warning: imageistruecolor(): supplied resource is not a valid Image resource in %s on line %d - -Warning: imageistruecolor() expects parameter 1 to be resource, array given in %s on line %d diff --git a/ext/gd/tests/imagesetthickness_error1.phpt b/ext/gd/tests/imagesetthickness_error1.phpt index f54270afbc1be..2542444c876ae 100644 --- a/ext/gd/tests/imagesetthickness_error1.phpt +++ b/ext/gd/tests/imagesetthickness_error1.phpt @@ -9,14 +9,7 @@ Rafael Dohms --FILE-- --EXPECTF-- -Warning: imagesetthickness() expects parameter 1 to be resource, %s given in %s on line %d - -Warning: imagesetthickness() expects parameter 1 to be resource, array given in %s on line %d - Warning: imagesetthickness(): supplied resource is not a valid Image resource in %s on line %d diff --git a/ext/gd/tests/imagetruecolortopalette_error1.phpt b/ext/gd/tests/imagetruecolortopalette_error1.phpt index 3418449c0180f..a4d3bdfc168e9 100644 --- a/ext/gd/tests/imagetruecolortopalette_error1.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error1.phpt @@ -10,17 +10,7 @@ Rafael Dohms --FILE-- --EXPECTF-- Warning: imagetruecolortopalette(): supplied resource is not a valid Image resource in %s on line %d - -Warning: imagetruecolortopalette() expects parameter 1 to be resource, %s given in %s on line %d - -Warning: imagetruecolortopalette() expects parameter 1 to be resource, array given in %s on line %d - -Warning: imagetruecolortopalette() expects parameter 1 to be resource, null given in %s on line %d diff --git a/ext/gd/tests/imagetruecolortopalette_error3.phpt b/ext/gd/tests/imagetruecolortopalette_error3.phpt index d89bbcb31bb7f..2a256ba957574 100644 --- a/ext/gd/tests/imagetruecolortopalette_error3.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error3.phpt @@ -10,19 +10,7 @@ Rafael Dohms --FILE-- --EXPECTF-- -Warning: imagetruecolortopalette() expects parameter 3 to be int, string given in %s on line %d - -Warning: imagetruecolortopalette() expects parameter 3 to be int, resource given in %s on line %d - -Warning: imagetruecolortopalette() expects parameter 3 to be int, array given in %s on line %d - Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than %d in %s on line %d diff --git a/ext/gd/tests/lines.phpt b/ext/gd/tests/lines.phpt index dda8497222de4..9401b6c82d204 100644 --- a/ext/gd/tests/lines.phpt +++ b/ext/gd/tests/lines.phpt @@ -9,10 +9,6 @@ imageline no AA $im = imagecreatetruecolor(6,6); imagefill($im, 0,0, 0xffffff); -// Wrong argument count -imageline($im, 0,0, 5,5); - - // Horizontal line imageline($im, 0,5, 5,5, 0x00ff00); @@ -105,7 +101,6 @@ if ($p3) { ?> --EXPECTF-- -Warning: imageline() expects exactly 6 parameters, 5 given in %s on line %d Horizontal: ok Vertical: ok Diagonal: ok diff --git a/ext/gettext/tests/dcngettext.phpt b/ext/gettext/tests/dcngettext.phpt index 4bf493507b9a7..f004febcb6236 100644 --- a/ext/gettext/tests/dcngettext.phpt +++ b/ext/gettext/tests/dcngettext.phpt @@ -8,7 +8,6 @@ if (!function_exists("dcngettext")) die("skip dcngettext() doesn't exist"); --FILE-- ---EXPECTF-- -Warning: dcngettext() expects exactly 5 parameters, 4 given in %s on line %d -bool(false) +--EXPECT-- string(1) "1" string(4) "test" string(4) "test" diff --git a/ext/gmp/tests/gmp_abs.phpt b/ext/gmp/tests/gmp_abs.phpt index 811ab3d5eee09..236acc46842ba 100644 --- a/ext/gmp/tests/gmp_abs.phpt +++ b/ext/gmp/tests/gmp_abs.phpt @@ -15,8 +15,6 @@ var_dump(gmp_strval(gmp_abs("0000"))); var_dump(gmp_strval(gmp_abs("09876543"))); var_dump(gmp_strval(gmp_abs("-099987654"))); -var_dump(gmp_abs()); -var_dump(gmp_abs(1,2)); var_dump(gmp_abs(array())); echo "Done\n"; @@ -39,12 +37,6 @@ string(1) "0" Warning: gmp_abs(): Unable to convert variable to GMP - string is not an integer in %s on line %d string(1) "0" -Warning: gmp_abs() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: gmp_abs() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: gmp_abs(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) Done diff --git a/ext/gmp/tests/gmp_and.phpt b/ext/gmp/tests/gmp_and.phpt index 2fb27c3e7021f..b582a6b480f20 100644 --- a/ext/gmp/tests/gmp_and.phpt +++ b/ext/gmp/tests/gmp_and.phpt @@ -17,8 +17,6 @@ var_dump(gmp_strval(gmp_and($n, "34332"))); $n1 = gmp_init("987657878765436543456"); var_dump(gmp_strval(gmp_and($n, $n1))); -var_dump(gmp_and($n, $n1, 1)); -var_dump(gmp_and(1)); var_dump(gmp_and(array(), 1)); var_dump(gmp_and(1, array())); var_dump(gmp_and(array(), array())); @@ -37,12 +35,6 @@ string(1) "0" string(4) "1536" string(15) "424703623692768" -Warning: gmp_and() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_and() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_and(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_clrbit.phpt b/ext/gmp/tests/gmp_clrbit.phpt index 0aab89dd37aef..255b9947b90d2 100644 --- a/ext/gmp/tests/gmp_clrbit.phpt +++ b/ext/gmp/tests/gmp_clrbit.phpt @@ -28,10 +28,11 @@ gmp_clrbit($n, 20); var_dump(gmp_strval($n)); $n = array(); -gmp_clrbit($n, 3); -gmp_clrbit($n, 3, 1); -gmp_clrbit($n); -gmp_clrbit(); +try { + gmp_clrbit($n, 3); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -46,12 +47,5 @@ Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line string(7) "1000000" string(7) "1000000" string(30) "238462734628347239571822592658" - -Warning: gmp_clrbit() expects parameter 1 to be GMP, array given in %s on line %d - -Warning: gmp_clrbit() expects exactly 2 parameters, 3 given in %s on line %d - -Warning: gmp_clrbit() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: gmp_clrbit() expects exactly 2 parameters, 0 given in %s on line %d +gmp_clrbit() expects parameter 1 to be GMP, array given Done diff --git a/ext/gmp/tests/gmp_cmp.phpt b/ext/gmp/tests/gmp_cmp.phpt index 2e48d3b83b91c..4748e7db877fb 100644 --- a/ext/gmp/tests/gmp_cmp.phpt +++ b/ext/gmp/tests/gmp_cmp.phpt @@ -17,10 +17,7 @@ var_dump(gmp_cmp(0,$n) < 0); $n1 = gmp_init("827278512385463739"); var_dump(gmp_cmp($n1,$n)); -var_dump(gmp_cmp($n1,$n,1)); var_dump(gmp_cmp(array(),array())); -var_dump(gmp_cmp(array())); -var_dump(gmp_cmp()); echo "Done\n"; ?> @@ -34,15 +31,6 @@ int(-1) bool(true) int(0) -Warning: gmp_cmp() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: gmp_cmp(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_cmp() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_cmp() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_com.phpt b/ext/gmp/tests/gmp_com.phpt index ae6ec59200acc..97299dd064a80 100644 --- a/ext/gmp/tests/gmp_com.phpt +++ b/ext/gmp/tests/gmp_com.phpt @@ -19,7 +19,6 @@ $n = gmp_init("98765463337"); var_dump(gmp_strval(gmp_com($n))); var_dump(gmp_strval(gmp_com(array()))); -var_dump(gmp_strval(gmp_com())); echo "Done\n"; ?> @@ -38,9 +37,4 @@ string(12) "-98765463338" Warning: gmp_com(): Unable to convert variable to GMP - wrong type in %s on line %d string(1) "0" - -Warning: gmp_com() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d -bool(false) Done diff --git a/ext/gmp/tests/gmp_div_q.phpt b/ext/gmp/tests/gmp_div_q.phpt index afc64c3547e9b..9fd94efdac897 100644 --- a/ext/gmp/tests/gmp_div_q.phpt +++ b/ext/gmp/tests/gmp_div_q.phpt @@ -5,9 +5,6 @@ gmp_div_q() tests --FILE-- --EXPECTF-- -Warning: gmp_div_q() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_div_q() expects at least 2 parameters, 1 given in %s on line %d -NULL object(GMP)#%d (1) { ["num"]=> string(1) "0" diff --git a/ext/gmp/tests/gmp_div_qr.phpt b/ext/gmp/tests/gmp_div_qr.phpt index 936fbc6ef1b46..373beb570111c 100644 --- a/ext/gmp/tests/gmp_div_qr.phpt +++ b/ext/gmp/tests/gmp_div_qr.phpt @@ -5,9 +5,6 @@ gmp_div_qr() tests --FILE-- --EXPECTF-- -Warning: gmp_div_qr() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_div_qr() expects at least 2 parameters, 1 given in %s on line %d -NULL array(2) { [0]=> object(GMP)#%d (1) { diff --git a/ext/gmp/tests/gmp_div_r.phpt b/ext/gmp/tests/gmp_div_r.phpt index bab243e465872..2b19ed1f48b26 100644 --- a/ext/gmp/tests/gmp_div_r.phpt +++ b/ext/gmp/tests/gmp_div_r.phpt @@ -5,9 +5,6 @@ gmp_div_r() tests --FILE-- --EXPECTF-- -Warning: gmp_div_r() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_div_r() expects at least 2 parameters, 1 given in %s on line %d -NULL object(GMP)#%d (1) { ["num"]=> string(1) "0" diff --git a/ext/gmp/tests/gmp_divexact.phpt b/ext/gmp/tests/gmp_divexact.phpt index 53f0c677ab743..c6183cb734ef3 100644 --- a/ext/gmp/tests/gmp_divexact.phpt +++ b/ext/gmp/tests/gmp_divexact.phpt @@ -10,9 +10,6 @@ if (!defined('GMP_VERSION') || version_compare("4.2.1", GMP_VERSION, ">=")) { --FILE-- --EXPECTF-- -Warning: gmp_divexact() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_divexact() expects exactly 2 parameters, 0 given in %s on line %d -NULL string(1) "0" Warning: gmp_divexact(): Zero operand not allowed in %s on line %d diff --git a/ext/gmp/tests/gmp_export.phpt b/ext/gmp/tests/gmp_export.phpt index 52449ecf0aff1..bbc26d086cfd9 100644 --- a/ext/gmp/tests/gmp_export.phpt +++ b/ext/gmp/tests/gmp_export.phpt @@ -50,9 +50,6 @@ foreach ($export as $k => $test) { var_dump($passed); -// Invalid arguments (zpp failure) -var_dump(gmp_export()); - // Invalid word sizes var_dump(gmp_export(123, -1)); var_dump(gmp_export(123, 0)); @@ -63,9 +60,6 @@ var_dump(gmp_export(123, 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN)); --EXPECTF-- bool(true) -Warning: gmp_export() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_export(): Word size must be positive, -1 given in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_fact.phpt b/ext/gmp/tests/gmp_fact.phpt index 032f73543553f..d861fae40ede1 100644 --- a/ext/gmp/tests/gmp_fact.phpt +++ b/ext/gmp/tests/gmp_fact.phpt @@ -21,8 +21,6 @@ var_dump(gmp_strval(gmp_fact($n))); $n = gmp_init(-10); var_dump(gmp_strval(gmp_fact($n))); -var_dump(gmp_fact()); -var_dump(gmp_fact(1,1)); var_dump(gmp_fact(array())); var_dump(gmp_strval(gmp_fact(array()))); @@ -50,12 +48,6 @@ string(9) "479001600" Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d string(1) "0" -Warning: gmp_fact() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: gmp_fact() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: gmp_fact(): Number has to be an integer in %s on line %d object(GMP)#%d (1) { ["num"]=> diff --git a/ext/gmp/tests/gmp_gcd.phpt b/ext/gmp/tests/gmp_gcd.phpt index cf4eac9e92f27..4e130a1fd90f5 100644 --- a/ext/gmp/tests/gmp_gcd.phpt +++ b/ext/gmp/tests/gmp_gcd.phpt @@ -21,13 +21,10 @@ $n = gmp_init("8127346234"); var_dump(gmp_strval(gmp_gcd($n,$n))); $n = gmp_init("8127346234"); var_dump(gmp_strval(gmp_gcd($n,0))); -var_dump(gmp_gcd($n,$n,1)); -var_dump(gmp_gcd($n,array(),1)); -var_dump(gmp_gcd(array(),$n,1)); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(1) "3" string(5) "12387" string(3) "224" @@ -39,13 +36,4 @@ string(1) "2" string(1) "1" string(10) "8127346234" string(10) "8127346234" - -Warning: gmp_gcd() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_gcd() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_gcd() expects exactly 2 parameters, 3 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_gcdext.phpt b/ext/gmp/tests/gmp_gcdext.phpt index 4adecf25d26b8..d02f341129c37 100644 --- a/ext/gmp/tests/gmp_gcdext.phpt +++ b/ext/gmp/tests/gmp_gcdext.phpt @@ -31,9 +31,6 @@ foreach ($a as $val) { var_dump(gmp_gcdext($val[0],array())); var_dump(gmp_gcdext(array(),array())); -var_dump(gmp_gcdext(array(),array(),1)); -var_dump(gmp_gcdext(array())); -var_dump(gmp_gcdext()); echo "Done\n"; ?> @@ -64,13 +61,4 @@ bool(false) Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_hamdist.phpt b/ext/gmp/tests/gmp_hamdist.phpt index 60ef89f84dfaf..7057c5f32ac01 100644 --- a/ext/gmp/tests/gmp_hamdist.phpt +++ b/ext/gmp/tests/gmp_hamdist.phpt @@ -16,11 +16,9 @@ var_dump(gmp_hamdist($n, "8333765434567897654333334567")); var_dump(gmp_hamdist($n, $n)); var_dump(gmp_hamdist($n, $n1)); -var_dump(gmp_hamdist($n, $n1, 1)); var_dump(gmp_hamdist($n, array())); var_dump(gmp_hamdist(array(), $n)); var_dump(gmp_hamdist(array(), array())); -var_dump(gmp_hamdist()); echo "Done\n"; ?> @@ -33,9 +31,6 @@ int(43) int(0) int(26) -Warning: gmp_hamdist() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: gmp_hamdist(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) @@ -44,7 +39,4 @@ bool(false) Warning: gmp_hamdist(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_hamdist() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_import.phpt b/ext/gmp/tests/gmp_import.phpt index a9e931448340d..b3c4e0154a60e 100644 --- a/ext/gmp/tests/gmp_import.phpt +++ b/ext/gmp/tests/gmp_import.phpt @@ -47,9 +47,6 @@ foreach ($import as $k => $test) { var_dump($passed); -// Invalid arguments (zpp failure) -var_dump(gmp_import()); - // Invalid word sizes var_dump(gmp_import('a', -1)); var_dump(gmp_import('a', 0)); @@ -65,9 +62,6 @@ var_dump(gmp_import('a', 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN)); --EXPECTF-- bool(true) -Warning: gmp_import() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_import(): Word size must be positive, -1 given in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_init.phpt b/ext/gmp/tests/gmp_init.phpt index a35f12345cfa8..7da7c8e55eb7c 100644 --- a/ext/gmp/tests/gmp_init.phpt +++ b/ext/gmp/tests/gmp_init.phpt @@ -7,9 +7,6 @@ gmp_init() basic tests var_dump(gmp_init("98765678")); var_dump(gmp_strval(gmp_init("98765678"))); -var_dump(gmp_strval(gmp_init())); -var_dump(gmp_init()); -var_dump(gmp_init(1,2,3,4)); var_dump(gmp_init(1,-1)); var_dump(gmp_init("",36)); var_dump(gmp_init("foo",3)); @@ -24,17 +21,6 @@ object(GMP)#%d (1) { } string(8) "98765678" -Warning: gmp_init() expects at least 1 parameter, 0 given in %s on line %d - -Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d -bool(false) - -Warning: gmp_init() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gmp_init() expects at most 2 parameters, 4 given in %s on line %d -NULL - Warning: gmp_init(): Bad base for conversion: -1 (should be between 2 and %d) in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_intval.phpt b/ext/gmp/tests/gmp_intval.phpt index f30b391573553..019ab3d070c0e 100644 --- a/ext/gmp/tests/gmp_intval.phpt +++ b/ext/gmp/tests/gmp_intval.phpt @@ -5,7 +5,6 @@ gmp_intval() tests --FILE-- --EXPECTF-- -Warning: gmp_intval() expects exactly 1 parameter, 2 given in %s on line %d -NULL int(0) int(1) int(1) diff --git a/ext/gmp/tests/gmp_invert.phpt b/ext/gmp/tests/gmp_invert.phpt index 8c1d7c577cbb6..40793afd5351d 100644 --- a/ext/gmp/tests/gmp_invert.phpt +++ b/ext/gmp/tests/gmp_invert.phpt @@ -19,8 +19,6 @@ $n1 = gmp_init("3498273496234234523451"); var_dump(gmp_strval(gmp_invert($n, $n1))); var_dump(gmp_strval(gmp_invert($n1, $n))); -var_dump(gmp_invert($n1, $n, 10)); -var_dump(gmp_invert($n1)); var_dump(gmp_invert(array(), 1)); var_dump(gmp_invert(1, array())); var_dump(gmp_invert(array(), array())); @@ -38,12 +36,6 @@ string(1) "0" string(22) "3498273496234234523441" string(1) "1" -Warning: gmp_invert() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_invert() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_invert(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_jacobi.phpt b/ext/gmp/tests/gmp_jacobi.phpt index da92b87401270..2040b666f6a3b 100644 --- a/ext/gmp/tests/gmp_jacobi.phpt +++ b/ext/gmp/tests/gmp_jacobi.phpt @@ -24,10 +24,6 @@ var_dump(gmp_jacobi(3, array())); var_dump(gmp_jacobi(array(), 3)); var_dump(gmp_jacobi(array(), array())); -var_dump(gmp_jacobi(array(), array(), 1)); -var_dump(gmp_jacobi(array())); -var_dump(gmp_jacobi()); - echo "Done\n"; ?> --EXPECTF-- @@ -57,13 +53,4 @@ bool(false) Warning: gmp_jacobi(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_jacobi() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_jacobi() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_jacobi() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_legendre.phpt b/ext/gmp/tests/gmp_legendre.phpt index 71191e133d629..6b6197f25aa16 100644 --- a/ext/gmp/tests/gmp_legendre.phpt +++ b/ext/gmp/tests/gmp_legendre.phpt @@ -24,10 +24,6 @@ var_dump(gmp_legendre(3, array())); var_dump(gmp_legendre(array(), 3)); var_dump(gmp_legendre(array(), array())); -var_dump(gmp_legendre(array(), array(), 1)); -var_dump(gmp_legendre(array())); -var_dump(gmp_legendre()); - echo "Done\n"; ?> --EXPECTF-- @@ -57,13 +53,4 @@ bool(false) Warning: gmp_legendre(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_legendre() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_legendre() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_legendre() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_mod.phpt b/ext/gmp/tests/gmp_mod.phpt index 4f216965c96d6..135c2ca11cb67 100644 --- a/ext/gmp/tests/gmp_mod.phpt +++ b/ext/gmp/tests/gmp_mod.phpt @@ -5,8 +5,6 @@ gmp_mod tests() --FILE-- --EXPECTF-- -Warning: gmp_mod() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_mod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_mod(): Unable to convert variable to GMP - string is not an integer in %s on line %d bool(false) object(GMP)#%d (1) { diff --git a/ext/gmp/tests/gmp_neg.phpt b/ext/gmp/tests/gmp_neg.phpt index c457fa6574ae5..777de6910564d 100644 --- a/ext/gmp/tests/gmp_neg.phpt +++ b/ext/gmp/tests/gmp_neg.phpt @@ -17,8 +17,6 @@ var_dump(gmp_intval(gmp_neg($n))); $n = gmp_init("12345678901234567890"); var_dump(gmp_strval(gmp_neg($n))); -var_dump(gmp_neg(1,1)); -var_dump(gmp_neg()); var_dump(gmp_neg(array())); echo "Done\n"; @@ -35,12 +33,6 @@ int(0) int(0) string(21) "-12345678901234567890" -Warning: gmp_neg() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: gmp_neg() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_neg(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) Done diff --git a/ext/gmp/tests/gmp_or.phpt b/ext/gmp/tests/gmp_or.phpt index ef486df8e9ed6..affd6ae5b8232 100644 --- a/ext/gmp/tests/gmp_or.phpt +++ b/ext/gmp/tests/gmp_or.phpt @@ -17,8 +17,6 @@ var_dump(gmp_strval(gmp_or($n, "34332"))); $n1 = gmp_init("987657878765436543456"); var_dump(gmp_strval(gmp_or($n, $n1))); -var_dump(gmp_or($n, $n1, 1)); -var_dump(gmp_or(1)); var_dump(gmp_or(array(), 1)); var_dump(gmp_or(1, array())); var_dump(gmp_or(array(), array())); @@ -37,12 +35,6 @@ string(1) "0" string(15) "987657876576252" string(21) "987658441719689394144" -Warning: gmp_or() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_or() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_or(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_perfect_square.phpt b/ext/gmp/tests/gmp_perfect_square.phpt index 0f519c7b79c0d..b47791037843d 100644 --- a/ext/gmp/tests/gmp_perfect_square.phpt +++ b/ext/gmp/tests/gmp_perfect_square.phpt @@ -21,7 +21,6 @@ var_dump(gmp_perfect_square($n)); $n = gmp_init(-5); var_dump(gmp_perfect_square($n)); -var_dump(gmp_perfect_square()); var_dump(gmp_perfect_square(array())); echo "Done\n"; @@ -39,9 +38,6 @@ bool(false) bool(true) bool(false) -Warning: gmp_perfect_square() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_perfect_square(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) Done diff --git a/ext/gmp/tests/gmp_popcount.phpt b/ext/gmp/tests/gmp_popcount.phpt index 26a7b5af8db13..76dc2a89c0c56 100644 --- a/ext/gmp/tests/gmp_popcount.phpt +++ b/ext/gmp/tests/gmp_popcount.phpt @@ -13,7 +13,6 @@ var_dump(gmp_popcount("-23476123423433")); $n = gmp_init("9876546789222"); var_dump(gmp_popcount($n)); var_dump(gmp_popcount(array())); -var_dump(gmp_popcount()); echo "Done\n"; ?> @@ -27,7 +26,4 @@ int(20) Warning: gmp_popcount(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_popcount() expects exactly 1 parameter, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_pow.phpt b/ext/gmp/tests/gmp_pow.phpt index 5424d410a073c..e9525867e150f 100644 --- a/ext/gmp/tests/gmp_pow.phpt +++ b/ext/gmp/tests/gmp_pow.phpt @@ -21,11 +21,11 @@ var_dump(gmp_strval(gmp_pow($n,10))); $n = gmp_init("-20"); var_dump(gmp_strval(gmp_pow($n,10))); -var_dump(gmp_pow(2,10,1)); -var_dump(gmp_pow(2)); -var_dump(gmp_pow()); -var_dump(gmp_pow(array(), array())); -var_dump(gmp_pow(2,array())); +try { + var_dump(gmp_pow(2,array())); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(gmp_pow(array(),10)); echo "Done\n"; @@ -47,21 +47,7 @@ Warning: gmp_pow(): Negative exponent not supported in %s on line %d string(1) "0" string(14) "10240000000000" string(14) "10240000000000" - -Warning: gmp_pow() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_pow() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_pow() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_pow() expects parameter 2 to be int, array given in %s on line %d -NULL - -Warning: gmp_pow() expects parameter 2 to be int, array given in %s on line %d -NULL +gmp_pow() expects parameter 2 to be int, array given Warning: gmp_pow(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_pown.phpt b/ext/gmp/tests/gmp_pown.phpt index b732aa331fcc1..9a5b5deb11298 100644 --- a/ext/gmp/tests/gmp_pown.phpt +++ b/ext/gmp/tests/gmp_pown.phpt @@ -26,9 +26,6 @@ var_dump(gmp_powm(array(),$e,$m)); var_dump(gmp_powm($n,array(),$m)); var_dump(gmp_powm($n,$e,array())); var_dump(gmp_powm(array(),array(),array())); -var_dump(gmp_powm(array(),array())); -var_dump(gmp_powm(array())); -var_dump(gmp_powm()); $n = gmp_init("-5"); var_dump(gmp_powm(10, $n, 10)); @@ -67,15 +64,6 @@ bool(false) Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) -Warning: gmp_powm() expects exactly 3 parameters, 2 given in %s on line %d -NULL - -Warning: gmp_powm() expects exactly 3 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_powm() expects exactly 3 parameters, 0 given in %s on line %d -NULL - Warning: gmp_powm(): Second parameter cannot be less than 0 in %s on line %d bool(false) object(GMP)#%d (1) { diff --git a/ext/gmp/tests/gmp_prob_prime.phpt b/ext/gmp/tests/gmp_prob_prime.phpt index 99735bd7c009d..2872e01d840d0 100644 --- a/ext/gmp/tests/gmp_prob_prime.phpt +++ b/ext/gmp/tests/gmp_prob_prime.phpt @@ -28,7 +28,6 @@ var_dump(gmp_prob_prime($n)); $n = gmp_init(0); var_dump(gmp_prob_prime($n)); -var_dump(gmp_prob_prime()); var_dump(gmp_prob_prime(array())); echo "Done\n"; @@ -73,9 +72,6 @@ int(0) int(0) int(0) -Warning: gmp_prob_prime() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_prob_prime(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) Done diff --git a/ext/gmp/tests/gmp_random_bits.phpt b/ext/gmp/tests/gmp_random_bits.phpt index b4aa5d7b732b2..42b90d6fe3478 100644 --- a/ext/gmp/tests/gmp_random_bits.phpt +++ b/ext/gmp/tests/gmp_random_bits.phpt @@ -5,7 +5,6 @@ gmp_random_bits() basic tests --FILE-- --EXPECTF-- -Warning: gmp_random_bits() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_random_range.phpt b/ext/gmp/tests/gmp_random_range.phpt index 654ffbefb369a..fec82741674fa 100644 --- a/ext/gmp/tests/gmp_random_range.phpt +++ b/ext/gmp/tests/gmp_random_range.phpt @@ -9,8 +9,6 @@ $minusTen = gmp_init(-10); $plusTen = gmp_init(10); $zero = gmp_init(0); -var_dump(gmp_random_range()); -var_dump(gmp_random_range(10)); var_dump(gmp_random_range(10, -10)); var_dump(gmp_random_range($plusTen, $minusTen)); @@ -64,12 +62,6 @@ while (1) { echo "Done\n"; ?> --EXPECTF-- -Warning: gmp_random_range() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_random_range() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_remroot.phpt b/ext/gmp/tests/gmp_remroot.phpt index acd8f84925fe5..1316d7651c719 100644 --- a/ext/gmp/tests/gmp_remroot.phpt +++ b/ext/gmp/tests/gmp_remroot.phpt @@ -5,8 +5,6 @@ gmp_rootrem() basic tests --FILE-- --EXPECTF-- -Warning: gmp_rootrem() expects exactly 2 parameters, 0 given in %s on line %d -NULL array(2) { [0]=> object(GMP)#%d (1) { diff --git a/ext/gmp/tests/gmp_root.phpt b/ext/gmp/tests/gmp_root.phpt index 654e2ffeb62bc..47c1fcc608157 100644 --- a/ext/gmp/tests/gmp_root.phpt +++ b/ext/gmp/tests/gmp_root.phpt @@ -5,8 +5,6 @@ gmp_root() basic tests --FILE-- --EXPECTF-- -Warning: gmp_root() expects exactly 2 parameters, 0 given in %s on line %d -NULL object(GMP)#%d (1) { ["num"]=> string(2) "10" diff --git a/ext/gmp/tests/gmp_scan0.phpt b/ext/gmp/tests/gmp_scan0.phpt index fb70cf8b25b22..c06f91f7dda63 100644 --- a/ext/gmp/tests/gmp_scan0.phpt +++ b/ext/gmp/tests/gmp_scan0.phpt @@ -15,8 +15,6 @@ $n = gmp_init("24234527465274"); var_dump(gmp_scan0($n, 10)); var_dump(gmp_scan0(array(), 200)); -var_dump(gmp_scan0(array())); -var_dump(gmp_scan0()); echo "Done\n"; ?> @@ -31,10 +29,4 @@ int(13) Warning: gmp_scan0(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_scan0() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_scan0() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_scan1.phpt b/ext/gmp/tests/gmp_scan1.phpt index a89a9195b0582..43a2fdfa1baea 100644 --- a/ext/gmp/tests/gmp_scan1.phpt +++ b/ext/gmp/tests/gmp_scan1.phpt @@ -15,8 +15,6 @@ $n = gmp_init("24234527465274"); var_dump(gmp_scan1($n, 10)); var_dump(gmp_scan1(array(), 200)); -var_dump(gmp_scan1(array())); -var_dump(gmp_scan1()); echo "Done\n"; ?> @@ -31,10 +29,4 @@ int(10) Warning: gmp_scan1(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_scan1() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: gmp_scan1() expects exactly 2 parameters, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_setbit.phpt b/ext/gmp/tests/gmp_setbit.phpt index 2eac23db0edf8..15270eaf7bf56 100644 --- a/ext/gmp/tests/gmp_setbit.phpt +++ b/ext/gmp/tests/gmp_setbit.phpt @@ -32,12 +32,17 @@ gmp_setbit($n, 3); var_dump(gmp_strval($n)); $b = ""; -gmp_setbit($b, 23); -gmp_setbit($b); -gmp_setbit($b, 23,1,1); -gmp_setbit($b,array()); +try { + gmp_setbit($b, 23); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} $a = array(); -gmp_setbit($a,array()); +try { + gmp_setbit($a, array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -52,14 +57,6 @@ string(1) "7" string(12) "100008388608" string(12) "100000000000" string(12) "100000000008" - -Warning: gmp_setbit() expects parameter 1 to be GMP, string given in %s on line %d - -Warning: gmp_setbit() expects at least 2 parameters, 1 given in %s on line %d - -Warning: gmp_setbit() expects at most 3 parameters, 4 given in %s on line %d - -Warning: gmp_setbit() expects parameter 1 to be GMP, string given in %s on line %d - -Warning: gmp_setbit() expects parameter 1 to be GMP, array given in %s on line %d +gmp_setbit() expects parameter 1 to be GMP, string given +gmp_setbit() expects parameter 1 to be GMP, array given Done diff --git a/ext/gmp/tests/gmp_sign.phpt b/ext/gmp/tests/gmp_sign.phpt index 7ac03013d4a90..ac01845395fe1 100644 --- a/ext/gmp/tests/gmp_sign.phpt +++ b/ext/gmp/tests/gmp_sign.phpt @@ -13,9 +13,7 @@ var_dump(gmp_sign("-34535345345")); var_dump(gmp_sign("+34534573457345")); $n = gmp_init("098909878976786545"); var_dump(gmp_sign($n)); -var_dump(gmp_sign($n, $n)); var_dump(gmp_sign(array())); -var_dump(gmp_sign()); echo "Done\n"; ?> @@ -32,12 +30,6 @@ bool(false) Warning: gmp_init(): Unable to convert variable to GMP - string is not an integer in %s on line %d int(0) -Warning: gmp_sign() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: gmp_sign(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_sign() expects exactly 1 parameter, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_sqrt.phpt b/ext/gmp/tests/gmp_sqrt.phpt index e824de3706ee8..03c460b79a932 100644 --- a/ext/gmp/tests/gmp_sqrt.phpt +++ b/ext/gmp/tests/gmp_sqrt.phpt @@ -18,8 +18,6 @@ var_dump(gmp_strval(gmp_sqrt($n))); $n = gmp_init(777); var_dump(gmp_strval(gmp_sqrt($n))); -var_dump(gmp_sqrt($n, 1)); -var_dump(gmp_sqrt()); var_dump(gmp_sqrt(array())); echo "Done\n"; @@ -39,12 +37,6 @@ Warning: gmp_sqrt(): Number has to be greater than or equal to 0 in %s on line % string(1) "0" string(2) "27" -Warning: gmp_sqrt() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: gmp_sqrt() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_sqrt(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) Done diff --git a/ext/gmp/tests/gmp_sqrtrem.phpt b/ext/gmp/tests/gmp_sqrtrem.phpt index 595a1dc45ae7e..c19969158e363 100644 --- a/ext/gmp/tests/gmp_sqrtrem.phpt +++ b/ext/gmp/tests/gmp_sqrtrem.phpt @@ -51,7 +51,6 @@ var_dump(gmp_strval($r[0])); var_dump(gmp_strval($r[1])); var_dump(gmp_sqrtrem(array())); -var_dump(gmp_sqrtrem()); echo "Done\n"; ?> @@ -82,7 +81,4 @@ string(1) "1" Warning: gmp_sqrtrem(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) - -Warning: gmp_sqrtrem() expects exactly 1 parameter, 0 given in %s on line %d -NULL Done diff --git a/ext/gmp/tests/gmp_strval.phpt b/ext/gmp/tests/gmp_strval.phpt index cfa7335667b0c..b349d31699c9a 100644 --- a/ext/gmp/tests/gmp_strval.phpt +++ b/ext/gmp/tests/gmp_strval.phpt @@ -5,11 +5,8 @@ gmp_strval() tests --FILE-- --EXPECTF-- -Warning: gmp_strval() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in %s on line %d bool(false) -Warning: gmp_strval() expects parameter 2 to be int, string given in %s on line %d -NULL - Warning: gmp_strval(): Bad base for conversion: -1 (should be between 2 and %d or -2 and -%d) in %s on line %d bool(false) -Warning: gmp_strval() expects parameter 2 to be int, string given in %s on line %d -NULL - Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) string(7) "9765456" @@ -68,12 +54,6 @@ Warning: gmp_strval(): Bad base for conversion: 100000 (should be between 2 and bool(false) string(8) "-3373333" -Warning: gmp_strval() expects parameter 2 to be int, array given in %s on line %d -NULL - -Warning: gmp_strval() expects parameter 2 to be int, object given in %s on line %d -NULL - Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) diff --git a/ext/gmp/tests/gmp_sub.phpt b/ext/gmp/tests/gmp_sub.phpt index fabc0c0ebbeaa..b8dce49774e04 100644 --- a/ext/gmp/tests/gmp_sub.phpt +++ b/ext/gmp/tests/gmp_sub.phpt @@ -5,10 +5,7 @@ gmp_sub() tests --FILE-- --EXPECTF-- -Warning: gmp_sub() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: gmp_sub() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_sub(): Unable to convert variable to GMP - string is not an integer in %s on line %d bool(false) -Warning: gmp_sub() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) object(GMP)#%d (1) { diff --git a/ext/gmp/tests/gmp_testbit.phpt b/ext/gmp/tests/gmp_testbit.phpt index bdabe3d841866..f18af5d44da21 100644 --- a/ext/gmp/tests/gmp_testbit.phpt +++ b/ext/gmp/tests/gmp_testbit.phpt @@ -5,8 +5,6 @@ gmp_testbit() basic tests --FILE-- --EXPECTF-- -Warning: gmp_testbit() expects exactly 2 parameters, 0 given in %s on line %d -NULL - Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on line %d bool(false) bool(false) diff --git a/ext/gmp/tests/gmp_xor.phpt b/ext/gmp/tests/gmp_xor.phpt index 9bf31f02f4155..cc508907aa023 100644 --- a/ext/gmp/tests/gmp_xor.phpt +++ b/ext/gmp/tests/gmp_xor.phpt @@ -17,8 +17,6 @@ var_dump(gmp_strval(gmp_xor($n, "34332"))); $n1 = gmp_init("987657878765436543456"); var_dump(gmp_strval(gmp_xor($n, $n1))); -var_dump(gmp_xor($n, $n1, 1)); -var_dump(gmp_xor(1)); var_dump(gmp_xor(array(), 1)); var_dump(gmp_xor(1, array())); var_dump(gmp_xor(array(), array())); @@ -37,12 +35,6 @@ string(1) "0" string(15) "987657876574716" string(21) "987658017016065701376" -Warning: gmp_xor() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: gmp_xor() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: gmp_xor(): Unable to convert variable to GMP - wrong type in %s on line %d bool(false) diff --git a/ext/hash/tests/hash_error.phpt b/ext/hash/tests/hash_error.phpt index e760819e69aaf..f879d491d79a8 100644 --- a/ext/hash/tests/hash_error.phpt +++ b/ext/hash/tests/hash_error.phpt @@ -10,14 +10,6 @@ Hash: hash() function : error conditions */ echo "*** Testing hash() : error conditions ***\n"; -echo "\n-- Testing hash() function with less than expected no. of arguments --\n"; -var_dump(hash()); -var_dump(hash('adler32')); - -echo "\n-- Testing hash() function with more than expected no. of arguments --\n"; -$extra_arg= 10; -var_dump(hash('adler32', '', false, $extra_arg)); - echo "\n-- Testing hash() function with invalid hash algorithm --\n"; var_dump(hash('foo', '')); @@ -26,19 +18,6 @@ var_dump(hash('foo', '')); --EXPECTF-- *** Testing hash() : error conditions *** --- Testing hash() function with less than expected no. of arguments -- - -Warning: hash() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: hash() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing hash() function with more than expected no. of arguments -- - -Warning: hash() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Testing hash() function with invalid hash algorithm -- Warning: hash(): Unknown hashing algorithm: foo in %s on line %d diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt index a634070de5b32..b001001861aad 100644 --- a/ext/hash/tests/hash_file_error.phpt +++ b/ext/hash/tests/hash_file_error.phpt @@ -24,13 +24,6 @@ var_dump( hash_file( 'foobar', $filename ) ); echo "\n-- Testing hash_file() function with a non-existent file --\n"; var_dump( hash_file( 'md5', 'nonexistent.txt' ) ); -echo "\n-- Testing hash_file() function with less than expected no. of arguments --\n"; -var_dump( hash_file( 'md5' ) ); - -echo "\n-- Testing hash_file() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( hash_file( 'md5', $filename, false, $extra_arg ) ); - ?> ===DONE=== --CLEAN-- @@ -52,14 +45,4 @@ bool(false) Warning: hash_file(%s): failed to open stream: No such file or directory in %s on line %d bool(false) - --- Testing hash_file() function with less than expected no. of arguments -- - -Warning: hash_file() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing hash_file() function with more than expected no. of arguments -- - -Warning: hash_file() expects at most 3 parameters, 4 given in %s on line %d -NULL ===DONE=== diff --git a/ext/hash/tests/hash_hkdf_error.phpt b/ext/hash/tests/hash_hkdf_error.phpt index b833054e80954..e5903f126a48f 100644 --- a/ext/hash/tests/hash_hkdf_error.phpt +++ b/ext/hash/tests/hash_hkdf_error.phpt @@ -12,13 +12,6 @@ $ikm = 'input key material'; echo "*** Testing hash_hkdf(): error conditions ***\n"; -echo "\n-- Testing hash_hkdf() function with less than expected no. of arguments --\n"; -var_dump(hash_hkdf()); -var_dump(hash_hkdf('sha1')); - -echo "\n-- Testing hash_hkdf() function with more than expected no. of arguments --\n"; -var_dump(hash_hkdf('sha1', $ikm, 20, '', '', 'extra parameter')); - echo "\n-- Testing hash_hkdf() function with invalid hash algorithm --\n"; var_dump(hash_hkdf('foo', $ikm)); @@ -41,19 +34,6 @@ var_dump(hash_hkdf('sha1', $ikm, 20 * 255 + 1)); // Length can't be more than 25 --EXPECTF-- *** Testing hash_hkdf(): error conditions *** --- Testing hash_hkdf() function with less than expected no. of arguments -- - -Warning: hash_hkdf() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: hash_hkdf() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing hash_hkdf() function with more than expected no. of arguments -- - -Warning: hash_hkdf() expects at most 5 parameters, 6 given in %s on line %d -NULL - -- Testing hash_hkdf() function with invalid hash algorithm -- Warning: hash_hkdf(): Unknown hashing algorithm: foo in %s on line %d diff --git a/ext/hash/tests/hash_hmac_error.phpt b/ext/hash/tests/hash_hmac_error.phpt index 89d29b8df8bc0..1ed3e54127416 100644 --- a/ext/hash/tests/hash_hmac_error.phpt +++ b/ext/hash/tests/hash_hmac_error.phpt @@ -12,15 +12,6 @@ echo "*** Testing hash_hmac() : error conditions ***\n"; $data = "This is a sample string used to test the hash_hmac function with various hashing algorithms"; $key = 'secret'; -echo "\n-- Testing hash_hmac() function with less than expected no. of arguments --\n"; -var_dump(hash_hmac()); -var_dump(hash_hmac('md5')); -var_dump(hash_hmac('md5', $data)); - -echo "\n-- Testing hash_hmac() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump(hash_hmac('md5', $data, $key, TRUE, $extra_arg)); - echo "\n-- Testing hash_hmac() function with invalid hash algorithm --\n"; var_dump(hash_hmac('foo', $data, $key)); @@ -32,22 +23,6 @@ var_dump(hash_hmac('crc32', $data, $key)); --EXPECTF-- *** Testing hash_hmac() : error conditions *** --- Testing hash_hmac() function with less than expected no. of arguments -- - -Warning: hash_hmac() expects at least 3 parameters, 0 given in %s on line %d -NULL - -Warning: hash_hmac() expects at least 3 parameters, 1 given in %s on line %d -NULL - -Warning: hash_hmac() expects at least 3 parameters, 2 given in %s on line %d -NULL - --- Testing hash_hmac() function with more than expected no. of arguments -- - -Warning: hash_hmac() expects at most 4 parameters, 5 given in %s on line %d -NULL - -- Testing hash_hmac() function with invalid hash algorithm -- Warning: hash_hmac(): Unknown hashing algorithm: foo in %s on line %d diff --git a/ext/hash/tests/hash_hmac_file_basic.phpt b/ext/hash/tests/hash_hmac_file_basic.phpt index 913582500823a..7ad271b00b173 100644 --- a/ext/hash/tests/hash_hmac_file_basic.phpt +++ b/ext/hash/tests/hash_hmac_file_basic.phpt @@ -54,11 +54,6 @@ echo "whirlpool: " . hash_hmac_file('whirlpool', $file, $key) . "\n"; echo "md5(raw): " . bin2hex(hash_hmac_file('md5', $file, $key, TRUE)). "\n"; echo "sha256(raw): " . bin2hex(hash_hmac_file('sha256', $file, $key, TRUE)). "\n"; -echo "Error cases:\n"; -hash_hmac_file(); -hash_hmac_file('foo', $file); -hash_hmac_file('foo', $file, $key, TRUE, 10); - unlink($file); ?> @@ -83,11 +78,4 @@ tiger192,3: ca89badf843ba68e3fae5832635aa848a72a4bc11676edd4 whirlpool: 37a0fbb90547690d5e5e11c046f6654ffdb7bab15e16d9d79c7d85765cc4bdcbfd9df8db7a3ce9558f3f244fead00ca29cf05297f75596555195a0683f15d69f md5(raw): 8bddf39dd1c566c27acc7fa85ec36acf sha256(raw): 9135286ca4c84dec711e4b831f6cd39e672e5ff93d011321274eb76733cc1e40 -Error cases: - -Warning: hash_hmac_file() expects at least 3 parameters, 0 given in %s on line %d - -Warning: hash_hmac_file() expects at least 3 parameters, 2 given in %s on line %d - -Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d ===Done=== diff --git a/ext/hash/tests/hash_hmac_file_error.phpt b/ext/hash/tests/hash_hmac_file_error.phpt index 5b82c288ec18a..505d52fef90fb 100644 --- a/ext/hash/tests/hash_hmac_file_error.phpt +++ b/ext/hash/tests/hash_hmac_file_error.phpt @@ -14,15 +14,6 @@ echo "*** Testing hash() : error conditions ***\n"; $file = dirname(__FILE__) . "hash_file.txt"; $key = 'secret'; -echo "\n-- Testing hash_hmac_file() function with less than expected no. of arguments --\n"; -var_dump(hash_hmac_file()); -var_dump(hash_hmac_file('crc32')); -var_dump(hash_hmac_file('crc32', $file)); - -echo "\n-- Testing hash_hmac_file() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -hash_hmac_file('crc32', $file, $key, TRUE, $extra_arg); - echo "\n-- Testing hash_hmac_file() function with invalid hash algorithm --\n"; hash_hmac_file('foo', $file, $key, TRUE); @@ -37,21 +28,6 @@ hash_hmac_file('md5', $file.chr(0).$file, $key, TRUE); --EXPECTF-- *** Testing hash() : error conditions *** --- Testing hash_hmac_file() function with less than expected no. of arguments -- - -Warning: hash_hmac_file() expects at least 3 parameters, 0 given in %s on line %d -NULL - -Warning: hash_hmac_file() expects at least 3 parameters, 1 given in %s on line %d -NULL - -Warning: hash_hmac_file() expects at least 3 parameters, 2 given in %s on line %d -NULL - --- Testing hash_hmac_file() function with more than expected no. of arguments -- - -Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d - -- Testing hash_hmac_file() function with invalid hash algorithm -- Warning: hash_hmac_file(): Unknown hashing algorithm: foo in %s on line %d diff --git a/ext/hash/tests/hash_init_error.phpt b/ext/hash/tests/hash_init_error.phpt index e941aabca5854..9105b96801ad1 100644 --- a/ext/hash/tests/hash_init_error.phpt +++ b/ext/hash/tests/hash_init_error.phpt @@ -4,9 +4,6 @@ Hash: hash_init() function - errors test --EXPECTF-- *** Testing hash_init(): error conditions *** --- Testing hash_init() function with no parameters -- - -Warning: hash_init() expects at least 1 parameter, 0 given in %s on line %d -NULL -- Testing hash_init() function with unknown algorithms -- Warning: hash_init(): Unknown hashing algorithm: dummy in %s on line %d diff --git a/ext/hash/tests/hash_pbkdf2_error.phpt b/ext/hash/tests/hash_pbkdf2_error.phpt index c0a76e17b4b6e..a7fd08649bb43 100644 --- a/ext/hash/tests/hash_pbkdf2_error.phpt +++ b/ext/hash/tests/hash_pbkdf2_error.phpt @@ -12,15 +12,6 @@ echo "*** Testing hash_pbkdf2() : error conditions ***\n"; $password = 'password'; $salt = 'salt'; -echo "\n-- Testing hash_pbkdf2() function with less than expected no. of arguments --\n"; -var_dump(hash_pbkdf2()); -var_dump(hash_pbkdf2('md5')); -var_dump(hash_pbkdf2('md5', $password)); -var_dump(hash_pbkdf2('md5', $password, $salt)); - -echo "\n-- Testing hash_pbkdf2() function with more than expected no. of arguments --\n"; -var_dump(hash_pbkdf2('md5', $password, $salt, 10, 10, true, 'extra arg')); - echo "\n-- Testing hash_pbkdf2() function with invalid hash algorithm --\n"; var_dump(hash_pbkdf2('foo', $password, $salt, 1)); @@ -39,25 +30,6 @@ var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1)); --EXPECTF-- *** Testing hash_pbkdf2() : error conditions *** --- Testing hash_pbkdf2() function with less than expected no. of arguments -- - -Warning: hash_pbkdf2() expects at least 4 parameters, 0 given in %s on line %d -NULL - -Warning: hash_pbkdf2() expects at least 4 parameters, 1 given in %s on line %d -NULL - -Warning: hash_pbkdf2() expects at least 4 parameters, 2 given in %s on line %d -NULL - -Warning: hash_pbkdf2() expects at least 4 parameters, 3 given in %s on line %d -NULL - --- Testing hash_pbkdf2() function with more than expected no. of arguments -- - -Warning: hash_pbkdf2() expects at most 6 parameters, 7 given in %s on line %d -NULL - -- Testing hash_pbkdf2() function with invalid hash algorithm -- Warning: hash_pbkdf2(): Unknown hashing algorithm: foo in %s on line %d diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp index 9969561206029..e5f5aae74b6fa 100644 --- a/ext/intl/breakiterator/breakiterator_iterators.cpp +++ b/ext/intl/breakiterator/breakiterator_iterators.cpp @@ -277,8 +277,6 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator) INTLITERATOR_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlPartsIterator::getBreakIterator: bad arguments", 0); return; } diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp index 6d6211db73690..34509376c8448 100644 --- a/ext/intl/breakiterator/breakiterator_methods.cpp +++ b/ext/intl/breakiterator/breakiterator_methods.cpp @@ -55,9 +55,6 @@ static void _breakiter_factory(const char *func_name, if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &locale_str, &dummy) == FAILURE) { - spprintf(&msg, 0, "%s: bad arguments", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); - efree(msg); RETURN_NULL(); } @@ -118,8 +115,6 @@ U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_create_code_point_instance: bad arguments", 0); RETURN_NULL(); } @@ -133,8 +128,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_text: bad arguments", 0); RETURN_FALSE; } @@ -155,8 +148,6 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &text) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_set_text: bad arguments", 0); RETURN_FALSE; } @@ -189,9 +180,6 @@ static void _breakiter_no_args_ret_int32( object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - spprintf(&msg, 0, "%s: bad arguments", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); - efree(msg); RETURN_FALSE; } @@ -213,9 +201,6 @@ static void _breakiter_int32_ret_int32( object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg) == FAILURE) { - spprintf(&msg, 0, "%s: bad arguments", func_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1); - efree(msg); RETURN_FALSE; } @@ -290,8 +275,6 @@ U_CFUNC PHP_FUNCTION(breakiter_current) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_current: bad arguments", 0); RETURN_FALSE; } @@ -324,8 +307,6 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary) if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &offset) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_is_boundary: bad arguments", 0); RETURN_FALSE; } @@ -350,8 +331,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &locale_type) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_locale: bad arguments", 0); RETURN_FALSE; } @@ -378,8 +357,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &key_type) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_parts_iterator: bad arguments", 0); RETURN_FALSE; } @@ -403,8 +380,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_error_code: bad arguments", 0); RETURN_FALSE; } @@ -423,8 +398,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "breakiter_get_error_message: bad arguments", 0 ); RETURN_FALSE; } diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp index f1dd0960e69a6..dac50dcab63d4 100644 --- a/ext/intl/breakiterator/codepointiterator_methods.cpp +++ b/ext/intl/breakiterator/codepointiterator_methods.cpp @@ -33,8 +33,6 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "cpbi_get_last_code_point: bad arguments", 0); RETURN_FALSE; } diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index 5529d0671807f..65023af089a41 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -43,8 +43,6 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "s|b", &rules, &rules_len, &compiled) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_create_instance: bad arguments", 0); return; } @@ -105,8 +103,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_rules: bad arguments", 0); RETURN_FALSE; } @@ -132,8 +128,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_rule_status: bad arguments", 0); RETURN_FALSE; } @@ -148,8 +142,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_rule_status_vec: bad arguments", 0); RETURN_FALSE; } @@ -188,8 +180,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules) object = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "rbbi_get_binary_rules: bad arguments", 0); RETURN_FALSE; } diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp index 2188fb82765c3..0571b62c7d962 100644 --- a/ext/intl/calendar/calendar_methods.cpp +++ b/ext/intl/calendar/calendar_methods.cpp @@ -63,8 +63,6 @@ U_CFUNC PHP_FUNCTION(intlcal_create_instance) if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zs!", &zv_timezone, &locale_str, &dummy) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_create_calendar: bad arguments", 0); RETURN_NULL(); } @@ -154,8 +152,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale) if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb", &key, &key_len, &locale, &locale_len, &commonly_used) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_keyword_values_for_locale: bad arguments", 0); RETURN_FALSE; } @@ -190,8 +186,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_now) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_now: bad arguments", 0); RETURN_FALSE; } @@ -203,8 +197,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_available_locales) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_available_locales: bad arguments", 0); RETURN_FALSE; } @@ -228,9 +220,6 @@ static void _php_intlcal_field_uec_ret_in32t_method( if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { - spprintf(&message, 0, "%s: bad arguments", method_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1); - efree(message); RETURN_FALSE; } @@ -262,8 +251,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_time: bad arguments", 0); RETURN_FALSE; } @@ -283,8 +270,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Od", &object, Calendar_ce_ptr, &time_arg) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_time: bad arguments", 0); RETURN_FALSE; } @@ -304,8 +289,6 @@ U_CFUNC PHP_FUNCTION(intlcal_add) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &object, Calendar_ce_ptr, &field, &amount) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_add: bad arguments", 0); RETURN_FALSE; } @@ -336,8 +319,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz!", &object, Calendar_ce_ptr, &zv_timezone) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_time_zone: bad arguments", 0); RETURN_FALSE; } @@ -370,8 +351,6 @@ static void _php_intlcal_before_after( if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, Calendar_ce_ptr, &when_object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_before/after: bad arguments", 0); RETURN_FALSE; } @@ -430,8 +409,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set) zend_parse_method_parameters(ZEND_NUM_ARGS(), object, "Oll|llll", &object, Calendar_ce_ptr, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set: bad arguments", 0); RETURN_FALSE; } @@ -489,15 +466,11 @@ U_CFUNC PHP_FUNCTION(intlcal_roll) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), object, "Olb", &object, Calendar_ce_ptr, &field, &bool_variant_val) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_roll: bad arguments", 0); RETURN_FALSE; } bool_variant_val = Z_TYPE(args[1]) == IS_TRUE? 1 : 0; } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(), object, "Oll", &object, Calendar_ce_ptr, &field, &value) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_roll: bad arguments", 0); RETURN_FALSE; } @@ -535,8 +508,6 @@ U_CFUNC PHP_FUNCTION(intlcal_clear) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l!", &object, Calendar_ce_ptr, &field, &field_is_null) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_clear: bad arguments", 0); RETURN_FALSE; } @@ -565,8 +536,6 @@ U_CFUNC PHP_FUNCTION(intlcal_field_difference) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Odl", &object, Calendar_ce_ptr, &when, &field) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_field_difference: bad arguments", 0); RETURN_FALSE; } @@ -605,8 +574,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_day_of_week_type) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_day_of_week_type: bad arguments", 0); RETURN_FALSE; } @@ -632,8 +599,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_first_day_of_week) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_first_day_of_week: bad arguments", 0); RETURN_FALSE; } @@ -657,9 +622,6 @@ static void _php_intlcal_field_ret_in32t_method( if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { - spprintf(&message, 0, "%s: bad arguments", method_name); - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1); - efree(message); RETURN_FALSE; } @@ -697,8 +659,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_locale) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &locale_type) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_locale: bad arguments", 0); RETURN_FALSE; } @@ -730,8 +690,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_minimal_days_in_first_week) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_minimal_days_in_first_week: bad arguments", 0); RETURN_FALSE; } @@ -756,8 +714,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_time_zone: bad arguments", 0); RETURN_FALSE; } @@ -779,8 +735,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_type) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_type: bad arguments", 0); RETURN_FALSE; } @@ -796,8 +750,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_weekend_transition) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_weekend_transition: bad arguments", 0); RETURN_FALSE; } @@ -823,8 +775,6 @@ U_CFUNC PHP_FUNCTION(intlcal_in_daylight_time) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_in_daylight_time: bad arguments", 0); RETURN_FALSE; } @@ -846,8 +796,6 @@ U_CFUNC PHP_FUNCTION(intlcal_is_equivalent_to) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_equivalent_to: bad arguments", 0); RETURN_FALSE; } @@ -869,8 +817,6 @@ U_CFUNC PHP_FUNCTION(intlcal_is_lenient) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_lenient: bad arguments", 0); RETURN_FALSE; } @@ -886,8 +832,6 @@ U_CFUNC PHP_FUNCTION(intlcal_is_set) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_set: bad arguments", 0); RETURN_FALSE; } @@ -910,8 +854,6 @@ U_CFUNC PHP_FUNCTION(intlcal_is_weekend) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|d!", &object, Calendar_ce_ptr, &date, &date_is_null) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_is_weekend: bad arguments", 0); RETURN_FALSE; } @@ -935,8 +877,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_first_day_of_week) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_first_day_of_week: bad arguments", 0); RETURN_FALSE; } @@ -960,8 +900,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &object, Calendar_ce_ptr, &is_lenient) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_lenient: bad arguments", 0); RETURN_FALSE; } @@ -979,8 +917,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_minimal_days_in_first_week: bad arguments", 0); RETURN_FALSE; } @@ -1007,8 +943,6 @@ U_CFUNC PHP_FUNCTION(intlcal_equals) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_equals: bad arguments", 0); RETURN_FALSE; } @@ -1032,8 +966,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_repeated_wall_time_option) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_repeated_wall_time_option: bad arguments", 0); RETURN_FALSE; } @@ -1048,8 +980,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_skipped_wall_time_option: bad arguments", 0); RETURN_FALSE; } @@ -1065,8 +995,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &option) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_repeated_wall_time_option: bad arguments", 0); RETURN_FALSE; } @@ -1090,8 +1018,6 @@ U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, Calendar_ce_ptr, &option) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_set_skipped_wall_time_option: bad arguments", 0); RETURN_FALSE; } @@ -1125,8 +1051,6 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time) if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!", &zv_arg, &locale_str, &locale_str_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_from_date_time: bad arguments", 0); RETURN_NULL(); } @@ -1206,8 +1130,6 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_to_date_time: bad arguments", 0); RETURN_FALSE; } @@ -1286,8 +1208,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_code) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_error_code: bad arguments", 0); RETURN_FALSE; } @@ -1306,8 +1226,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, Calendar_ce_ptr) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlcal_get_error_message: bad arguments", 0 ); RETURN_FALSE; } diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp index d96fffda6f741..0c0c80b1cd666 100644 --- a/ext/intl/calendar/gregoriancalendar_methods.cpp +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp @@ -56,7 +56,6 @@ static void _php_intlgregcal_constructor_body( zend_long largs[6]; UErrorCode status = U_ZERO_ERROR; int variant; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; intl_error_reset(NULL); // parameter number validation / variant determination @@ -86,10 +85,8 @@ static void _php_intlgregcal_constructor_body( // argument parsing if (variant <= 2) { - if (zend_parse_parameters_ex(zpp_flags, MIN(ZEND_NUM_ARGS(), 2), + if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2), "|z!s!", &tz_object, &locale, &locale_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_create_instance: bad arguments", 0); if (!is_constructor) { zval_ptr_dtor(return_value); RETVAL_NULL(); @@ -97,11 +94,9 @@ static void _php_intlgregcal_constructor_body( return; } } - if (variant > 2 && zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), + if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS(), "lll|lll", &largs[0], &largs[1], &largs[2], &largs[3], &largs[4], &largs[5]) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_create_instance: bad arguments", 0); if (!is_constructor) { zval_ptr_dtor(return_value); RETVAL_NULL(); @@ -232,8 +227,6 @@ U_CFUNC PHP_FUNCTION(intlgregcal_set_gregorian_change) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Od", &object, GregorianCalendar_ce_ptr, &date) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_set_gregorian_change: bad arguments", 0); RETURN_FALSE; } @@ -252,8 +245,6 @@ U_CFUNC PHP_FUNCTION(intlgregcal_get_gregorian_change) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, GregorianCalendar_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_get_gregorian_change: bad arguments", 0); RETURN_FALSE; } @@ -269,8 +260,6 @@ U_CFUNC PHP_FUNCTION(intlgregcal_is_leap_year) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intlgregcal_is_leap_year: bad arguments", 0); RETURN_FALSE; } diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c index 5170d4c720cf5..6710a60b15fca 100644 --- a/ext/intl/collator/collator_attr.c +++ b/ext/intl/collator/collator_attr.c @@ -41,9 +41,6 @@ PHP_FUNCTION( collator_get_attribute ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", &object, Collator_ce_ptr, &attribute ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_get_attribute: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -72,9 +69,6 @@ PHP_FUNCTION( collator_set_attribute ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oll", &object, Collator_ce_ptr, &attribute, &value ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_set_attribute: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -102,9 +96,6 @@ PHP_FUNCTION( collator_get_strength ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Collator_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_get_strength: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -131,9 +122,6 @@ PHP_FUNCTION( collator_set_strength ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", &object, Collator_ce_ptr, &strength ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_set_strength: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c index c95d144f1af4c..c3f6b3bc52c08 100644 --- a/ext/intl/collator/collator_compare.c +++ b/ext/intl/collator/collator_compare.c @@ -49,9 +49,6 @@ PHP_FUNCTION( collator_compare ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oss", &object, Collator_ce_ptr, &str1, &str1_len, &str2, &str2_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_compare: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c index cb2ff183e22fc..e5bc724b48a35 100644 --- a/ext/intl/collator/collator_create.c +++ b/ext/intl/collator/collator_create.c @@ -31,16 +31,13 @@ static int collator_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) size_t locale_len = 0; zval* object; Collator_object* co; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; intl_error_reset( NULL ); object = return_value; /* Parse parameters. */ - if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "s", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "s", &locale, &locale_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_create: unable to parse input params", 0 ); return FAILURE; } diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c index b485cf14f1a92..6781f13d8e91d 100644 --- a/ext/intl/collator/collator_error.c +++ b/ext/intl/collator/collator_error.c @@ -36,9 +36,6 @@ PHP_FUNCTION( collator_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Collator_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_get_error_code: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -67,9 +64,6 @@ PHP_FUNCTION( collator_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Collator_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_get_error_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c index 2a379bc97713f..2c9bf72b303bc 100644 --- a/ext/intl/collator/collator_locale.c +++ b/ext/intl/collator/collator_locale.c @@ -42,9 +42,6 @@ PHP_FUNCTION( collator_get_locale ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", &object, Collator_ce_ptr, &type ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_get_locale: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 292391c43b772..e3f967537505b 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -303,9 +303,6 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa/|l", &object, Collator_ce_ptr, &array, &sort_flags ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_sort_internal: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -397,9 +394,6 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa", &object, Collator_ce_ptr, &array ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_sort_with_sort_keys: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -563,9 +557,6 @@ PHP_FUNCTION( collator_get_sort_key ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os", &object, Collator_ce_ptr, &str, &str_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "collator_get_sort_key: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index 5c5e1ca990608..0fc7b31cde8a6 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -211,8 +211,6 @@ static PHP_METHOD(IntlIterator, current) INTLITERATOR_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::current: bad arguments", 0); return; } @@ -228,8 +226,6 @@ static PHP_METHOD(IntlIterator, key) INTLITERATOR_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::key: bad arguments", 0); return; } @@ -247,8 +243,6 @@ static PHP_METHOD(IntlIterator, next) INTLITERATOR_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::next: bad arguments", 0); return; } @@ -264,8 +258,6 @@ static PHP_METHOD(IntlIterator, rewind) INTLITERATOR_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::rewind: bad arguments", 0); return; } @@ -283,8 +275,6 @@ static PHP_METHOD(IntlIterator, valid) INTLITERATOR_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "IntlIterator::valid: bad arguments", 0); return; } diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c index a4a4e56b0a076..29b15d456d089 100644 --- a/ext/intl/common/common_error.c +++ b/ext/intl/common/common_error.c @@ -54,9 +54,6 @@ PHP_FUNCTION( intl_is_failure ) if( zend_parse_parameters( ZEND_NUM_ARGS(), "l", &err_code ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intl_is_failure: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -76,9 +73,6 @@ PHP_FUNCTION( intl_error_name ) if( zend_parse_parameters( ZEND_NUM_ARGS(), "l", &err_code ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intl_error_name: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 09fa699b0095c..6eab9a1713aa0 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -586,8 +586,6 @@ static PHP_METHOD(UConverter, setSubstChars) { int ret = 1; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &chars, &chars_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::setSubstChars(): bad arguments", 0); RETURN_FALSE; } intl_errors_reset(&objval->error); @@ -721,8 +719,6 @@ static PHP_METHOD(UConverter, reasonText) { zend_long reason; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &reason) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::reasonText(): bad arguments", 0); RETURN_FALSE; } intl_error_reset(NULL); @@ -756,8 +752,6 @@ static PHP_METHOD(UConverter, convert) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &str, &str_len, &reverse) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::convert(): bad arguments", 0); RETURN_FALSE; } intl_errors_reset(&objval->error); @@ -790,8 +784,6 @@ static PHP_METHOD(UConverter, transcode) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|a!", &str, &str_len, &dest, &dest_len, &src, &src_len, &options) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::transcode(): bad arguments", 0); RETURN_FALSE; } intl_error_reset(NULL); @@ -910,8 +902,6 @@ static PHP_METHOD(UConverter, getAliases) { uint16_t i, count; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "UConverter::getAliases(): bad arguments", 0); RETURN_FALSE; } intl_error_reset(NULL); diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c index b1821ce0d386a..e64b687a5b610 100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.c @@ -77,8 +77,6 @@ PHP_FUNCTION( datefmt_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -103,9 +101,6 @@ PHP_FUNCTION( datefmt_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_error_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index d44b3d1789966..5e8f3b4454ac5 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -38,8 +38,6 @@ PHP_FUNCTION( datefmt_get_datetype ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_datetype: unable to parse input params", 0 ); RETURN_FALSE; } @@ -64,8 +62,6 @@ PHP_FUNCTION( datefmt_get_timetype ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_timetype: unable to parse input params", 0 ); RETURN_FALSE; } @@ -95,8 +91,6 @@ PHP_FUNCTION( datefmt_get_pattern ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_pattern: unable to parse input params", 0 ); RETURN_FALSE; } @@ -140,8 +134,6 @@ PHP_FUNCTION( datefmt_set_pattern ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os", &object, IntlDateFormatter_ce_ptr, &value, &value_len ) == FAILURE ) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_pattern: unable to parse input params", 0); RETURN_FALSE; } @@ -178,8 +170,6 @@ PHP_FUNCTION( datefmt_get_locale ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l", &object, IntlDateFormatter_ce_ptr,&loc_type) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_locale: unable to parse input params", 0 ); RETURN_FALSE; } @@ -207,8 +197,6 @@ PHP_FUNCTION( datefmt_is_lenient ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_is_lenient: unable to parse input params", 0 ); RETURN_FALSE; } @@ -235,8 +223,6 @@ PHP_FUNCTION( datefmt_set_lenient ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ob", &object, IntlDateFormatter_ce_ptr,&isLenient ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_lenient: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index fec8eb1a67fe7..c6cae6757b70b 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -49,8 +49,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_get_timezone_" - "id: unable to parse input params", 0); RETURN_FALSE; } @@ -75,8 +73,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_timezone: unable to parse input params", 0 ); RETURN_FALSE; } @@ -105,8 +101,6 @@ U_CFUNC PHP_FUNCTION(datefmt_set_timezone) if ( zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &timezone_zv) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_set_timezone: " - "unable to parse input params", 0); RETURN_FALSE; } @@ -132,8 +126,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_calendar: unable to parse input params", 0); RETURN_FALSE; } @@ -159,9 +151,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_calendar_object: unable to parse input params", - 0); RETURN_FALSE; } @@ -196,8 +185,6 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &calendar_zv) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_calendar: unable to parse input params", 0); RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 9268b9ddf5d3d..fbff95743e88b 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -65,16 +65,13 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) UChar* svalue = NULL; /* UTF-16 pattern_str */ int32_t slength = 0; IntlDateFormatter_object* dfo; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; intl_error_reset(NULL); object = return_value; /* Parse parameters. */ - if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs", &locale_str, &locale_len, &date_type, &time_type, &timezone_zv, &calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: " - "unable to parse input parameters", 0); return FAILURE; } diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index af960952423b7..2507713c8a8ff 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -137,7 +137,6 @@ PHP_FUNCTION(datefmt_parse) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 ); RETURN_FALSE; } @@ -182,7 +181,6 @@ PHP_FUNCTION(datefmt_localtime) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index b04c33eaad361..049304d385751 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -39,9 +39,6 @@ PHP_FUNCTION( numfmt_get_attribute ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_attribute: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -112,9 +109,6 @@ PHP_FUNCTION( numfmt_get_text_attribute ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", &object, NumberFormatter_ce_ptr, &attribute ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_text_attribute: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -153,9 +147,6 @@ PHP_FUNCTION( numfmt_set_attribute ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Olz", &object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_attribute: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -216,9 +207,6 @@ PHP_FUNCTION( numfmt_set_text_attribute ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols", &object, NumberFormatter_ce_ptr, &attribute, &value, &len ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_text_attribute: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -257,9 +245,6 @@ PHP_FUNCTION( numfmt_get_symbol ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol", &object, NumberFormatter_ce_ptr, &symbol ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_symbol: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -306,9 +291,6 @@ PHP_FUNCTION( numfmt_set_symbol ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols", &object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_symbol: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -351,9 +333,6 @@ PHP_FUNCTION( numfmt_get_pattern ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, NumberFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_pattern: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -394,9 +373,6 @@ PHP_FUNCTION( numfmt_set_pattern ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os", &object, NumberFormatter_ce_ptr, &value, &value_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_set_pattern: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -432,9 +408,6 @@ PHP_FUNCTION( numfmt_get_locale ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l", &object, NumberFormatter_ce_ptr, &type ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_locale: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index 05ef6789ef9d7..2f812d3ddeb78 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -44,9 +44,6 @@ PHP_FUNCTION( numfmt_format ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oz|l", &object, NumberFormatter_ce_ptr, &number, &type ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_format: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -150,9 +147,6 @@ PHP_FUNCTION( numfmt_format_currency ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ods", &object, NumberFormatter_ce_ptr, &number, ¤cy, ¤cy_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_format_currency: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index a4671c093ae7b..959fcd71dde20 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -33,15 +33,12 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) zend_long style; UChar* spattern = NULL; int32_t spattern_len = 0; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "sl|s", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s", &locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_create: unable to parse input parameters", 0 ); return FAILURE; } @@ -117,9 +114,6 @@ PHP_FUNCTION( numfmt_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, NumberFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_error_code: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -144,9 +138,6 @@ PHP_FUNCTION( numfmt_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, NumberFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "numfmt_get_error_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index a2a20f147dc73..68fcd36e2ac11 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -54,9 +54,6 @@ PHP_FUNCTION( numfmt_parse ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|lz!", &object, NumberFormatter_ce_ptr, &str, &str_len, &type, &zposition ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "number_parse: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -139,9 +136,6 @@ PHP_FUNCTION( numfmt_parse_currency ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Osz/|z!", &object, NumberFormatter_ce_ptr, &str, &str_len, &zcurrency, &zposition ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "number_parse_currency: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 6e5fc4ffb49ed..0417958b26e43 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -63,8 +63,6 @@ PHP_FUNCTION(grapheme_strlen) UErrorCode status; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &string, &string_len) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strlen: unable to parse input param", 0 ); RETURN_FALSE; } @@ -116,8 +114,6 @@ PHP_FUNCTION(grapheme_strpos) zend_long ret_pos; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strpos: unable to parse input param", 0 ); RETURN_FALSE; } @@ -179,8 +175,6 @@ PHP_FUNCTION(grapheme_stripos) int is_ascii; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_stripos: unable to parse input param", 0 ); RETURN_FALSE; } @@ -248,8 +242,6 @@ PHP_FUNCTION(grapheme_strrpos) int is_ascii; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strrpos: unable to parse input param", 0 ); RETURN_FALSE; } @@ -311,8 +303,6 @@ PHP_FUNCTION(grapheme_strripos) int is_ascii; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strrpos: unable to parse input param", 0 ); RETURN_FALSE; } @@ -391,8 +381,6 @@ PHP_FUNCTION(grapheme_substr) zend_bool no_length = 1; if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l!", &str, &str_len, &lstart, &length, &no_length) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_substr: unable to parse input param", 0 ); RETURN_FALSE; } @@ -598,10 +586,6 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas zend_bool part = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &haystack, &haystack_len, &needle, &needle_len, &part) == FAILURE) { - - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_strstr: unable to parse input param", 0 ); - RETURN_FALSE; } @@ -789,8 +773,6 @@ PHP_FUNCTION(grapheme_extract) zval *next = NULL; /* return offset of next part of the string */ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|llz", &str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "grapheme_extract: unable to parse input param", 0 ); RETURN_FALSE; } diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index afcb44ac576e7..513b2187cce77 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -185,7 +185,6 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode) if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|llz", &domain, &option, &variant, &idna_info) == FAILURE) { - php_intl_bad_args("bad arguments"); RETURN_NULL(); /* don't set FALSE because that's not the way it was before... */ } diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index f03aa72928171..20a156af91461 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -227,9 +227,6 @@ PHP_NAMED_FUNCTION(zif_locale_set_default) if(zend_parse_parameters( ZEND_NUM_ARGS(), "S", &locale_name) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_set_default: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -397,10 +394,6 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name ,&loc_name_len ) == FAILURE) { - spprintf(&msg , 0, "locale_get_%s : unable to parse input params", tag_name ); - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 ); - efree(msg); - RETURN_FALSE; } @@ -506,9 +499,6 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME &loc_name, &loc_name_len , &disp_loc_name ,&disp_loc_name_len ) == FAILURE) { - spprintf(&msg , 0, "locale_get_display_%s : unable to parse input params", tag_name ); - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 ); - efree(msg); RETURN_FALSE; } @@ -698,9 +688,6 @@ PHP_FUNCTION( locale_get_keywords ) if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name, &loc_name_len ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_get_keywords: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -920,8 +907,6 @@ PHP_FUNCTION(locale_compose) if(zend_parse_parameters( ZEND_NUM_ARGS(), "a", &arr) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_compose: unable to parse input params", 0 ); RETURN_FALSE; } @@ -1108,9 +1093,6 @@ PHP_FUNCTION(locale_parse) if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name, &loc_name_len ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_parse: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -1158,9 +1140,6 @@ PHP_FUNCTION(locale_get_all_variants) if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &loc_name, &loc_name_len ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_parse: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -1264,9 +1243,6 @@ PHP_FUNCTION(locale_filter_matches) &lang_tag, &lang_tag_len , &loc_range , &loc_range_len , &boolCanonical) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_filter_matches: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -1540,7 +1516,6 @@ PHP_FUNCTION(locale_lookup) if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS", &arr, &loc_range, &loc_range_len, &boolCanonical, &fallback_loc_str) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 ); RETURN_FALSE; } @@ -1594,8 +1569,6 @@ PHP_FUNCTION(locale_accept_from_http) if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &http_accept, &http_accept_len) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_accept_from_http: unable to parse input parameters", 0 ); RETURN_FALSE; } if(http_accept_len > ULOC_FULLNAME_CAPACITY) { diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index 2439b5855a63c..dd4420a6ad3d6 100644 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -36,16 +36,13 @@ static int msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) int spattern_len = 0; zval* object; MessageFormatter_object* mfo; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; intl_error_reset( NULL ); object = return_value; /* Parse parameters. */ - if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "ss", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss", &locale, &locale_len, &pattern, &pattern_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_create: unable to parse input parameters", 0 ); return FAILURE; } @@ -137,9 +134,6 @@ PHP_FUNCTION( msgfmt_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_get_error_code: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -165,9 +159,6 @@ PHP_FUNCTION( msgfmt_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_get_error_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c index 51d9df049f94f..d9f36c6ac372d 100644 --- a/ext/intl/msgformat/msgformat_attr.c +++ b/ext/intl/msgformat/msgformat_attr.c @@ -38,8 +38,6 @@ PHP_FUNCTION( msgfmt_get_pattern ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE ) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_get_pattern: unable to parse input params", 0 ); RETURN_FALSE; } @@ -71,8 +69,6 @@ PHP_FUNCTION( msgfmt_set_pattern ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os", &object, MessageFormatter_ce_ptr, &value, &value_len ) == FAILURE ) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_set_pattern: unable to parse input params", 0); RETURN_FALSE; } @@ -127,9 +123,6 @@ PHP_FUNCTION( msgfmt_get_locale ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_get_locale: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c index a11c167a4bc30..58c5dcb99a46e 100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@ -65,9 +65,6 @@ PHP_FUNCTION( msgfmt_format ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa", &object, MessageFormatter_ce_ptr, &args ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_format: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -99,9 +96,6 @@ PHP_FUNCTION( msgfmt_format_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "ssa", &slocale, &slocale_len, &pattern, &pattern_len, &args ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_format_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c index c517288bff2c8..e1de6a883f9dc 100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@ -69,9 +69,6 @@ PHP_FUNCTION( msgfmt_parse ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os", &object, MessageFormatter_ce_ptr, &source, &source_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_parse: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -104,9 +101,6 @@ PHP_FUNCTION( msgfmt_parse_message ) if( zend_parse_parameters( ZEND_NUM_ARGS(), "sss", &slocale, &slocale_len, &pattern, &pattern_len, &source, &src_len ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "msgfmt_parse_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c index 6c56cdcf2afc7..a6aa66e385e50 100644 --- a/ext/intl/normalizer/normalizer_normalize.c +++ b/ext/intl/normalizer/normalizer_normalize.c @@ -109,9 +109,6 @@ PHP_FUNCTION( normalizer_normalize ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l", &input, &input_len, &form ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "normalizer_normalize: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -249,9 +246,6 @@ PHP_FUNCTION( normalizer_is_normalized ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l", &input, &input_len, &form) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "normalizer_is_normalized: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 9b9cb9f9a62de..d20fe7d55fa0c 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -82,18 +82,15 @@ static int resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constr const char *locale; size_t locale_len = 0; zend_bool fallback = 1; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; zval *object = return_value; ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object ); intl_error_reset( NULL ); - if( zend_parse_parameters_ex( zpp_flags, ZEND_NUM_ARGS(), "s!s!|b", + if( zend_parse_parameters( ZEND_NUM_ARGS(), "s!s!|b", &locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_ctor: unable to parse input parameters", 0 ); return FAILURE; } @@ -259,8 +256,6 @@ PHP_FUNCTION( resourcebundle_get ) zval * object; if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get: unable to parse input params", 0); RETURN_FALSE; } @@ -300,8 +295,6 @@ PHP_FUNCTION( resourcebundle_count ) RESOURCEBUNDLE_METHOD_INIT_VARS; if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_count: unable to parse input params", 0); RETURN_FALSE; } @@ -334,8 +327,6 @@ PHP_FUNCTION( resourcebundle_locales ) if( zend_parse_parameters(ZEND_NUM_ARGS(), "s", &bundlename, &bundlename_len ) == FAILURE ) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_locales: unable to parse input params", 0); RETURN_FALSE; } @@ -379,8 +370,6 @@ PHP_FUNCTION( resourcebundle_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -407,8 +396,6 @@ PHP_FUNCTION( resourcebundle_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "resourcebundle_get_error_message: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/tests/breakiter_createCodePointInstance_error.phpt b/ext/intl/tests/breakiter_createCodePointInstance_error.phpt deleted file mode 100644 index 13adc53b03193..0000000000000 --- a/ext/intl/tests/breakiter_createCodePointInstance_error.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -IntlBreakIterator::createCodePointInstance(): bad arguments ---SKIPIF-- -setText("\x80sdfé\x90d888 dfsa9"); - -var_dump($bi->first(1)); -var_dump($bi->last(1)); -var_dump($bi->previous(1)); -var_dump($bi->current(1)); ---EXPECTF-- -Warning: IntlBreakIterator::first() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlBreakIterator::first(): breakiter_first: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::last() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlBreakIterator::last(): breakiter_last: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::previous() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlBreakIterator::previous(): breakiter_previous: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::current() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlBreakIterator::current(): breakiter_current: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/breakiter_following_preceding_isBoundary_error.phpt b/ext/intl/tests/breakiter_following_preceding_isBoundary_error.phpt deleted file mode 100644 index 56ed60ffcf4ca..0000000000000 --- a/ext/intl/tests/breakiter_following_preceding_isBoundary_error.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -IntlBreakIterator::following()/preceding()/isBoundary(): arg errors ---SKIPIF-- -setText("\x80sdfé\x90d888 dfsa9"); - -var_dump($bi->following(1, 2)); -var_dump($bi->following(array())); -var_dump($bi->preceding(1, 2)); -var_dump($bi->preceding(array())); -var_dump($bi->isBoundary(1, 2)); -var_dump($bi->isBoundary(array())); ---EXPECTF-- -Warning: IntlBreakIterator::following() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::following(): breakiter_following: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::following() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlBreakIterator::following(): breakiter_following: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::preceding() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::preceding(): breakiter_preceding: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::preceding() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlBreakIterator::preceding(): breakiter_preceding: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::isBoundary() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::isBoundary(): breakiter_is_boundary: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::isBoundary() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlBreakIterator::isBoundary(): breakiter_is_boundary: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/breakiter_getLocale_error.phpt b/ext/intl/tests/breakiter_getLocale_error.phpt deleted file mode 100644 index f318743948efe..0000000000000 --- a/ext/intl/tests/breakiter_getLocale_error.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -IntlBreakIterator::getLocale(): arg errors ---SKIPIF-- -setText("\x80sdfé\x90d888 dfsa9"); - -var_dump($bi->getLocale(1, 2)); -var_dump($bi->getLocale(array())); -var_dump($bi->getLocale()); ---EXPECTF-- -Warning: IntlBreakIterator::getLocale() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::getLocale() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::getLocale() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/breakiter_getPartsIterator_error.phpt b/ext/intl/tests/breakiter_getPartsIterator_error.phpt index b756540578557..506b376c1901b 100644 --- a/ext/intl/tests/breakiter_getPartsIterator_error.phpt +++ b/ext/intl/tests/breakiter_getPartsIterator_error.phpt @@ -10,23 +10,11 @@ ini_set("intl.error_level", E_WARNING); ini_set("intl.default_locale", "pt_PT"); $it = IntlBreakIterator::createWordInstance(NULL); -var_dump($it->getPartsIterator(array())); -var_dump($it->getPartsIterator(1, 2)); var_dump($it->getPartsIterator(-1)); ?> ==DONE== --EXPECTF-- -Warning: IntlBreakIterator::getPartsIterator() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlBreakIterator::getPartsIterator(): breakiter_get_parts_iterator: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::getPartsIterator() expects at most 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::getPartsIterator(): breakiter_get_parts_iterator: bad arguments in %s on line %d -bool(false) - Warning: IntlBreakIterator::getPartsIterator(): breakiter_get_parts_iterator: bad key type in %s on line %d bool(false) ==DONE== diff --git a/ext/intl/tests/breakiter_getText_error.phpt b/ext/intl/tests/breakiter_getText_error.phpt deleted file mode 100644 index d66b4bb69f0de..0000000000000 --- a/ext/intl/tests/breakiter_getText_error.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -IntlBreakIterator::getText(): arg errors ---SKIPIF-- -getText(array())); ---EXPECTF-- -Warning: IntlBreakIterator::getText() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlBreakIterator::getText(): breakiter_get_text: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/breakiter_next_error.phpt b/ext/intl/tests/breakiter_next_error.phpt deleted file mode 100644 index eb4664308c90a..0000000000000 --- a/ext/intl/tests/breakiter_next_error.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -IntlBreakIterator::next(): arg errors ---SKIPIF-- -setText("\x80sdfé\x90d888 dfsa9"); - -var_dump($bi->next(1, 2)); -var_dump($bi->next(array())); ---EXPECTF-- -Warning: IntlBreakIterator::next() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::next(): breakiter_next: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::next() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlBreakIterator::next(): breakiter_next: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/breakiter_setText_error.phpt b/ext/intl/tests/breakiter_setText_error.phpt deleted file mode 100644 index c94a8433f1b63..0000000000000 --- a/ext/intl/tests/breakiter_setText_error.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -IntlBreakIterator::setText(): arg errors ---SKIPIF-- -setText()); -var_dump($bi->setText(array())); -var_dump($bi->setText(1,2)); - -class A { -function __destruct() { var_dump('destructed'); throw new Exception('e'); } -function __tostring() { return 'foo'; } -} - -try { -var_dump($bi->setText(new A)); -} catch (Exception $e) { -var_dump($e->getMessage()); -} ---EXPECTF-- -Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::setText() expects parameter 1 to be string, array given in %s on line %d - -Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d -bool(false) - -Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d -bool(false) -string(10) "destructed" -string(1) "e" diff --git a/ext/intl/tests/calendar_add_error.phpt b/ext/intl/tests/calendar_add_error.phpt index 017551821d3eb..1fc12828e13d0 100644 --- a/ext/intl/tests/calendar_add_error.phpt +++ b/ext/intl/tests/calendar_add_error.phpt @@ -10,33 +10,8 @@ if (!extension_loaded('intl')) add(1, 2, 3)); -var_dump($c->add(-1, 2)); -var_dump($c->add(1)); - -var_dump(intlcal_add($c, 1, 2, 3)); var_dump(intlcal_add(1, 2, 3)); --EXPECTF-- -Warning: IntlCalendar::add() expects exactly 2 parameters, 3 given in %s on line %d - -Warning: IntlCalendar::add(): intlcal_add: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::add(): intlcal_add: invalid field in %s on line %d -bool(false) - -Warning: IntlCalendar::add() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::add(): intlcal_add: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_add() expects exactly 3 parameters, 4 given in %s on line %d - -Warning: intlcal_add(): intlcal_add: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_add() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_add(1, 2, 3) diff --git a/ext/intl/tests/calendar_before_after_error.phpt b/ext/intl/tests/calendar_before_after_error.phpt index 279e3d816e383..805f0648417a2 100644 --- a/ext/intl/tests/calendar_before_after_error.phpt +++ b/ext/intl/tests/calendar_before_after_error.phpt @@ -61,25 +61,18 @@ try { echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; } --EXPECT-- -error: 2, IntlCalendar::after() expects exactly 1 parameter, 0 given -error: 2, IntlCalendar::after(): intlcal_before/after: bad arguments -bool(false) -error: 2, IntlCalendar::before() expects exactly 1 parameter, 0 given -error: 2, IntlCalendar::before(): intlcal_before/after: bad arguments -bool(false) +error: 0, IntlCalendar::after() expects exactly 1 parameter, 0 given + +error: 0, IntlCalendar::before() expects exactly 1 parameter, 0 given + error: 0, Argument 1 passed to IntlCalendar::after() must be an instance of IntlCalendar, int given error: 0, Argument 1 passed to IntlCalendar::before() must be an instance of IntlCalendar, int given -error: 2, IntlCalendar::after() expects exactly 1 parameter, 2 given -error: 2, IntlCalendar::after(): intlcal_before/after: bad arguments -bool(false) -error: 2, IntlCalendar::before() expects exactly 1 parameter, 2 given -error: 2, IntlCalendar::before(): intlcal_before/after: bad arguments -bool(false) -error: 2, intlcal_after() expects exactly 2 parameters, 1 given -error: 2, intlcal_after(): intlcal_before/after: bad arguments -bool(false) -error: 2, intlcal_before() expects exactly 2 parameters, 1 given -error: 2, intlcal_before(): intlcal_before/after: bad arguments -bool(false) +error: 0, IntlCalendar::after() expects exactly 1 parameter, 2 given + +error: 0, IntlCalendar::before() expects exactly 1 parameter, 2 given + +error: 0, intlcal_after() expects exactly 2 parameters, 1 given + +error: 0, intlcal_before() expects exactly 2 parameters, 1 given diff --git a/ext/intl/tests/calendar_clear_error.phpt b/ext/intl/tests/calendar_clear_error.phpt index bffa103eac7b5..e91b7a6326aa6 100644 --- a/ext/intl/tests/calendar_clear_error.phpt +++ b/ext/intl/tests/calendar_clear_error.phpt @@ -12,17 +12,11 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->clear(1, 2)); var_dump($c->clear(-1)); var_dump(intlcal_clear($c, -1)); var_dump(intlcal_clear(1, 2)); --EXPECTF-- -Warning: IntlCalendar::clear() expects at most 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::clear(): intlcal_clear: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::clear(): intlcal_clear: invalid field in %s on line %d bool(false) diff --git a/ext/intl/tests/calendar_createInstance_error.phpt b/ext/intl/tests/calendar_createInstance_error.phpt index 5cb9fa1c63487..516cc9260eae5 100644 --- a/ext/intl/tests/calendar_createInstance_error.phpt +++ b/ext/intl/tests/calendar_createInstance_error.phpt @@ -12,25 +12,7 @@ class X extends IntlTimeZone { function __construct() {} } -var_dump(IntlCalendar::createInstance(1, 2, 3)); -var_dump(intlcal_create_instance(1, 2, 3)); var_dump(intlcal_create_instance(new X, NULL)); -var_dump(intlcal_create_instance(NULL, array())); --EXPECTF-- -Warning: IntlCalendar::createInstance() expects at most 2 parameters, 3 given in %s on line %d - -Warning: IntlCalendar::createInstance(): intlcal_create_calendar: bad arguments in %s on line %d -NULL - -Warning: intlcal_create_instance() expects at most 2 parameters, 3 given in %s on line %d - -Warning: intlcal_create_instance(): intlcal_create_calendar: bad arguments in %s on line %d -NULL - Warning: intlcal_create_instance(): intlcal_create_instance: passed IntlTimeZone is not properly constructed in %s on line %d NULL - -Warning: intlcal_create_instance() expects parameter 2 to be string, array given in %s on line %d - -Warning: intlcal_create_instance(): intlcal_create_calendar: bad arguments in %s on line %d -NULL diff --git a/ext/intl/tests/calendar_equals_error.phpt b/ext/intl/tests/calendar_equals_error.phpt index 4c585a6018bef..d716c1a698d33 100644 --- a/ext/intl/tests/calendar_equals_error.phpt +++ b/ext/intl/tests/calendar_equals_error.phpt @@ -45,9 +45,8 @@ try { echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; } --EXPECT-- -error: 2, IntlCalendar::equals() expects exactly 1 parameter, 0 given -error: 2, IntlCalendar::equals(): intlcal_equals: bad arguments -bool(false) +error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given + error: 0, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, instance of stdClass given error: 0, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, int given diff --git a/ext/intl/tests/calendar_fieldDifference_error.phpt b/ext/intl/tests/calendar_fieldDifference_error.phpt index 4f3fc351cb1d2..fa8860534874e 100644 --- a/ext/intl/tests/calendar_fieldDifference_error.phpt +++ b/ext/intl/tests/calendar_fieldDifference_error.phpt @@ -12,30 +12,25 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->fieldDifference($c, 2, 3)); +try { + var_dump($c->fieldDifference($c, 2, 3)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($c->fieldDifference(INF, 2)); -var_dump($c->fieldDifference(1)); -var_dump(intlcal_field_difference($c, 0, 1, 2)); +try { + var_dump(intlcal_field_difference($c, 0, 1, 2)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(intlcal_field_difference(1, 0, 1)); --EXPECTF-- -Warning: IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given in %s on line %d - -Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: bad arguments in %s on line %d -bool(false) +IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d bool(false) - -Warning: IntlCalendar::fieldDifference() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_field_difference() expects exactly 3 parameters, 4 given in %s on line %d - -Warning: intlcal_field_difference(): intlcal_field_difference: bad arguments in %s on line %d -bool(false) +intlcal_field_difference() expects exactly 3 parameters, 4 given Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_field_difference() must be an instance of IntlCalendar, int given in %s:%d Stack trace: diff --git a/ext/intl/tests/calendar_fromDateTime_error.phpt b/ext/intl/tests/calendar_fromDateTime_error.phpt index 1074159687bb6..6fbaeb57f89a6 100644 --- a/ext/intl/tests/calendar_fromDateTime_error.phpt +++ b/ext/intl/tests/calendar_fromDateTime_error.phpt @@ -10,13 +10,10 @@ ini_set("intl.error_level", E_WARNING); ini_set("intl.default_locale", "nl"); date_default_timezone_set('Europe/Lisbon'); -var_dump(IntlCalendar::fromDateTime()); -var_dump(IntlCalendar::fromDateTime(0,1,2)); - try { -IntlCalendar::fromDateTime("foobar"); + IntlCalendar::fromDateTime("foobar"); } catch (Exception $e) { - echo "threw exception, OK"; + echo "threw exception, OK"; } class A extends DateTime { function __construct() {} @@ -29,18 +26,7 @@ var_dump(IntlCalendar::fromDateTime($date)); $date = new DateTime('2012-01-01 00:00:00 WEST'); var_dump(IntlCalendar::fromDateTime($date)); - -var_dump(intlcal_from_date_time()); --EXPECTF-- -Warning: IntlCalendar::fromDateTime() expects at least 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad arguments in %s on line %d -NULL - -Warning: IntlCalendar::fromDateTime() expects at most 2 parameters, 3 given in %s on line %d - -Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad arguments in %s on line %d -NULL threw exception, OK Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: DateTime object is unconstructed in %s on line %d NULL @@ -50,8 +36,3 @@ NULL Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d NULL - -Warning: intlcal_from_date_time() expects at least 1 parameter, 0 given in %s on line %d - -Warning: intlcal_from_date_time(): intlcal_from_date_time: bad arguments in %s on line %d -NULL diff --git a/ext/intl/tests/calendar_getAvailableLocales_error.phpt b/ext/intl/tests/calendar_getAvailableLocales_error.phpt deleted file mode 100644 index 3aee500fea234..0000000000000 --- a/ext/intl/tests/calendar_getAvailableLocales_error.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -IntlCalendar::getAvailableLocales(): bad arguments ---SKIPIF-- -getDayOfWeekType(1, 2)); var_dump($c->getDayOfWeekType(0)); -var_dump($c->getDayOfWeekType()); -var_dump(intlcal_get_day_of_week_type($c, "foo")); var_dump(intlcal_get_day_of_week_type(1, 1)); --EXPECTF-- -Warning: IntlCalendar::getDayOfWeekType() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::getDayOfWeekType(): intlcal_get_day_of_week_type: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::getDayOfWeekType(): intlcal_get_day_of_week_type: invalid day of week in %s on line %d bool(false) -Warning: IntlCalendar::getDayOfWeekType() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getDayOfWeekType(): intlcal_get_day_of_week_type: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_day_of_week_type() expects parameter 2 to be int, string given in %s on line %d - -Warning: intlcal_get_day_of_week_type(): intlcal_get_day_of_week_type: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_day_of_week_type() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_day_of_week_type(1, 1) diff --git a/ext/intl/tests/calendar_getErrorCode_error.phpt b/ext/intl/tests/calendar_getErrorCode_error.phpt index fd999fbbbf4cf..56e748fa12908 100644 --- a/ext/intl/tests/calendar_getErrorCode_error.phpt +++ b/ext/intl/tests/calendar_getErrorCode_error.phpt @@ -10,17 +10,8 @@ if (!extension_loaded('intl')) getErrorCode(array())); - var_dump(intlcal_get_error_code(null)); --EXPECTF-- -Warning: IntlCalendar::getErrorCode() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getErrorCode(): intlcal_get_error_code: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_error_code() must be an instance of IntlCalendar, null given in %s:%d Stack trace: #0 %s(%d): intlcal_get_error_code(NULL) diff --git a/ext/intl/tests/calendar_getErrorMessage_error.phpt b/ext/intl/tests/calendar_getErrorMessage_error.phpt index cc52449d9431f..8cdbb1f34b13b 100644 --- a/ext/intl/tests/calendar_getErrorMessage_error.phpt +++ b/ext/intl/tests/calendar_getErrorMessage_error.phpt @@ -10,17 +10,8 @@ if (!extension_loaded('intl')) getErrorMessage(array())); - var_dump(intlcal_get_error_message(null)); --EXPECTF-- -Warning: IntlCalendar::getErrorMessage() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getErrorMessage(): intlcal_get_error_message: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_error_message() must be an instance of IntlCalendar, null given in %s:%d Stack trace: #0 %s(%d): intlcal_get_error_message(NULL) diff --git a/ext/intl/tests/calendar_getFirstDayOfWeek_error.phpt b/ext/intl/tests/calendar_getFirstDayOfWeek_error.phpt index ca2dc4a9f23e9..68e0fd9074842 100644 --- a/ext/intl/tests/calendar_getFirstDayOfWeek_error.phpt +++ b/ext/intl/tests/calendar_getFirstDayOfWeek_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) getFirstDayOfWeek(1)); - -var_dump(intlcal_get_first_day_of_week($c, 1)); var_dump(intlcal_get_first_day_of_week(1)); --EXPECTF-- -Warning: IntlCalendar::getFirstDayOfWeek() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getFirstDayOfWeek(): intlcal_get_first_day_of_week: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_first_day_of_week() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_first_day_of_week(): intlcal_get_first_day_of_week: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_first_day_of_week() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_first_day_of_week(1) diff --git a/ext/intl/tests/calendar_getKeywordValuesForLocale_error.phpt b/ext/intl/tests/calendar_getKeywordValuesForLocale_error.phpt deleted file mode 100644 index 717c435be7348..0000000000000 --- a/ext/intl/tests/calendar_getKeywordValuesForLocale_error.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -IntlCalendar::getKeywordValuesForLocale(): bad arguments ---SKIPIF-- -getLocale()); -var_dump($c->getLocale(2)); -var_dump($c->getLocale(2, 3)); - -var_dump(intlcal_get_locale($c)); var_dump(intlcal_get_locale(1)); --EXPECTF-- -Warning: IntlCalendar::getLocale() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getLocale(): intlcal_get_locale: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getLocale(): intlcal_get_locale: invalid locale type in %s on line %d -bool(false) - -Warning: IntlCalendar::getLocale() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::getLocale(): intlcal_get_locale: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlcal_get_locale(): intlcal_get_locale: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_locale() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_locale(1) diff --git a/ext/intl/tests/calendar_getMinimalDaysInFirstWeek_error.phpt b/ext/intl/tests/calendar_getMinimalDaysInFirstWeek_error.phpt index a1190e5ce0417..fe3825ad6846e 100644 --- a/ext/intl/tests/calendar_getMinimalDaysInFirstWeek_error.phpt +++ b/ext/intl/tests/calendar_getMinimalDaysInFirstWeek_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) getMinimalDaysInFirstWeek(1)); - -var_dump(intlcal_get_minimal_days_in_first_week($c, 1)); var_dump(intlcal_get_minimal_days_in_first_week(1)); --EXPECTF-- -Warning: IntlCalendar::getMinimalDaysInFirstWeek() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getMinimalDaysInFirstWeek(): intlcal_get_minimal_days_in_first_week: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_minimal_days_in_first_week() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_minimal_days_in_first_week(): intlcal_get_minimal_days_in_first_week: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_minimal_days_in_first_week() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_minimal_days_in_first_week(1) diff --git a/ext/intl/tests/calendar_getNow_error.phpt b/ext/intl/tests/calendar_getNow_error.phpt deleted file mode 100644 index 712e210851849..0000000000000 --- a/ext/intl/tests/calendar_getNow_error.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -IntlCalendar::getNow(): bad arguments ---SKIPIF-- -getSkippedWallTimeOption(1)); -var_dump($c->getRepeatedWallTimeOption(1)); - -var_dump(intlcal_get_skipped_wall_time_option($c, 1)); -var_dump(intlcal_get_repeated_wall_time_option($c, 1)); - var_dump(intlcal_get_skipped_wall_time_option(1)); --EXPECTF-- -Warning: IntlCalendar::getSkippedWallTimeOption() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getSkippedWallTimeOption(): intlcal_get_skipped_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getRepeatedWallTimeOption() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getRepeatedWallTimeOption(): intlcal_get_repeated_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_skipped_wall_time_option() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_skipped_wall_time_option(): intlcal_get_skipped_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_repeated_wall_time_option() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_repeated_wall_time_option(): intlcal_get_repeated_wall_time_option: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_skipped_wall_time_option() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_skipped_wall_time_option(1) diff --git a/ext/intl/tests/calendar_getTimeZone_error.phpt b/ext/intl/tests/calendar_getTimeZone_error.phpt index ea7e85db4c106..f78d93f454a68 100644 --- a/ext/intl/tests/calendar_getTimeZone_error.phpt +++ b/ext/intl/tests/calendar_getTimeZone_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) getTimeZone(1)); - -var_dump(intlcal_get_time_zone($c, 1)); var_dump(intlcal_get_time_zone(1)); --EXPECTF-- -Warning: IntlCalendar::getTimeZone() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getTimeZone(): intlcal_get_time_zone: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_time_zone() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_time_zone(): intlcal_get_time_zone: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_time_zone() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_time_zone(1) diff --git a/ext/intl/tests/calendar_getTime_error.phpt b/ext/intl/tests/calendar_getTime_error.phpt index 61eaea97dc0cd..51cb0cfe7e8be 100644 --- a/ext/intl/tests/calendar_getTime_error.phpt +++ b/ext/intl/tests/calendar_getTime_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) getTime(1)); - -var_dump(intlcal_get_time($c, 1)); var_dump(intlcal_get_time(1)); --EXPECTF-- -Warning: IntlCalendar::getTime() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getTime(): intlcal_get_time: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_time() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_time(): intlcal_get_time: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_time() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_time(1) diff --git a/ext/intl/tests/calendar_getType_error.phpt b/ext/intl/tests/calendar_getType_error.phpt index c124151893d27..abc5f17fdd899 100644 --- a/ext/intl/tests/calendar_getType_error.phpt +++ b/ext/intl/tests/calendar_getType_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) getType(1)); - -var_dump(intlcal_get_type($c, 1)); var_dump(intlcal_get_type(1)); --EXPECTF-- -Warning: IntlCalendar::getType() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::getType(): intlcal_get_type: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_get_type() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_get_type(): intlcal_get_type: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_type() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_type(1) diff --git a/ext/intl/tests/calendar_getWeekendTransition_error.phpt b/ext/intl/tests/calendar_getWeekendTransition_error.phpt index d61c9d5a25233..f6a4a71c18c14 100644 --- a/ext/intl/tests/calendar_getWeekendTransition_error.phpt +++ b/ext/intl/tests/calendar_getWeekendTransition_error.phpt @@ -11,32 +11,13 @@ if (!extension_loaded('intl')) ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); - -var_dump($c->getWeekendTransition()); -var_dump($c->getWeekendTransition(1, 2)); var_dump($c->getWeekendTransition(0)); -var_dump(intlcal_get_weekend_transition($c)); var_dump(intlcal_get_weekend_transition(1, 1)); --EXPECTF-- -Warning: IntlCalendar::getWeekendTransition() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getWeekendTransition(): intlcal_get_weekend_transition: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getWeekendTransition() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::getWeekendTransition(): intlcal_get_weekend_transition: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::getWeekendTransition(): intlcal_get_weekend_transition: invalid day of week in %s on line %d bool(false) -Warning: intlcal_get_weekend_transition() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlcal_get_weekend_transition(): intlcal_get_weekend_transition: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_weekend_transition() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_get_weekend_transition(1, 1) diff --git a/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt b/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt index 6c6f67f95397e..9612862119118 100644 --- a/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt +++ b/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt @@ -12,11 +12,6 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->getLeastMaximum()); -var_dump($c->getMaximum()); -var_dump($c->getGreatestMinimum()); -var_dump($c->getMinimum()); - var_dump($c->getLeastMaximum(-1)); var_dump($c->getMaximum(-1)); var_dump($c->getGreatestMinimum(-1)); @@ -53,26 +48,6 @@ try { echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; } --EXPECTF-- -Warning: IntlCalendar::getLeastMaximum() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getLeastMaximum(): intlcal_get_least_maximum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getMaximum() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getMaximum(): intlcal_get_maximum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getGreatestMinimum() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getGreatestMinimum(): intlcal_get_greatest_minimum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getMinimum() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getMinimum(): intlcal_get_minimum: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::getLeastMaximum(): intlcal_get_least_maximum: invalid field in %s on line %d bool(false) diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt index d7d20ed6cd9e8..3853d612a3358 100644 --- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt +++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt @@ -12,37 +12,12 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->get()); -var_dump($c->getActualMaximum()); -var_dump($c->getActualMinimum()); - var_dump($c->get(-1)); var_dump($c->getActualMaximum(-1)); var_dump($c->getActualMinimum(-1)); -var_dump($c->get("s")); -var_dump($c->getActualMaximum("s")); -var_dump($c->getActualMinimum("s")); - -var_dump($c->get(1, 2)); -var_dump($c->getActualMaximum(1, 2)); -var_dump($c->getActualMinimum(1, 2)); +?> --EXPECTF-- -Warning: IntlCalendar::get() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::get(): intlcal_get: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getActualMaximum() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getActualMaximum(): intlcal_get_actual_maximum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getActualMinimum() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::getActualMinimum(): intlcal_get_actual_minimum: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::get(): intlcal_get: invalid field in %s on line %d bool(false) @@ -51,33 +26,3 @@ bool(false) Warning: IntlCalendar::getActualMinimum(): intlcal_get_actual_minimum: invalid field in %s on line %d bool(false) - -Warning: IntlCalendar::get() expects parameter 1 to be int, string given in %s on line %d - -Warning: IntlCalendar::get(): intlcal_get: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getActualMaximum() expects parameter 1 to be int, string given in %s on line %d - -Warning: IntlCalendar::getActualMaximum(): intlcal_get_actual_maximum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getActualMinimum() expects parameter 1 to be int, string given in %s on line %d - -Warning: IntlCalendar::getActualMinimum(): intlcal_get_actual_minimum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::get() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::get(): intlcal_get: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getActualMaximum() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::getActualMaximum(): intlcal_get_actual_maximum: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::getActualMinimum() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::getActualMinimum(): intlcal_get_actual_minimum: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt index 37e3816fefcf9..98408a4327259 100644 --- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt +++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt @@ -81,30 +81,24 @@ try { echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; } --EXPECT-- -error: 2, intlcal_get() expects exactly 2 parameters, 1 given -error: 2, intlcal_get(): intlcal_get: bad arguments -bool(false) -error: 2, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given -error: 2, intlcal_get_actual_maximum(): intlcal_get_actual_maximum: bad arguments -bool(false) -error: 2, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given -error: 2, intlcal_get_actual_minimum(): intlcal_get_actual_minimum: bad arguments -bool(false) +error: 0, intlcal_get() expects exactly 2 parameters, 1 given + +error: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given + +error: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given + error: 2, intlcal_get(): intlcal_get: invalid field bool(false) error: 2, intlcal_get_actual_maximum(): intlcal_get_actual_maximum: invalid field bool(false) error: 2, intlcal_get_actual_minimum(): intlcal_get_actual_minimum: invalid field bool(false) -error: 2, intlcal_get() expects parameter 2 to be int, string given -error: 2, intlcal_get(): intlcal_get: bad arguments -bool(false) -error: 2, intlcal_get_actual_maximum() expects parameter 2 to be int, string given -error: 2, intlcal_get_actual_maximum(): intlcal_get_actual_maximum: bad arguments -bool(false) -error: 2, intlcal_get_actual_minimum() expects parameter 2 to be int, string given -error: 2, intlcal_get_actual_minimum(): intlcal_get_actual_minimum: bad arguments -bool(false) +error: 0, intlcal_get() expects parameter 2 to be int, string given + +error: 0, intlcal_get_actual_maximum() expects parameter 2 to be int, string given + +error: 0, intlcal_get_actual_minimum() expects parameter 2 to be int, string given + error: 0, Argument 1 passed to intlcal_get() must be an instance of IntlCalendar, int given error: 0, Argument 1 passed to intlcal_get_actual_maximum() must be an instance of IntlCalendar, int given diff --git a/ext/intl/tests/calendar_inDaylightTime_error.phpt b/ext/intl/tests/calendar_inDaylightTime_error.phpt index 6644f477ea129..bbcfcaabb1b5c 100644 --- a/ext/intl/tests/calendar_inDaylightTime_error.phpt +++ b/ext/intl/tests/calendar_inDaylightTime_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) inDaylightTime(1)); - -var_dump(intlcal_in_daylight_time($c, 1)); var_dump(intlcal_in_daylight_time(1)); --EXPECTF-- -Warning: IntlCalendar::inDaylightTime() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::inDaylightTime(): intlcal_in_daylight_time: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_in_daylight_time() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_in_daylight_time(): intlcal_in_daylight_time: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_in_daylight_time() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_in_daylight_time(1) diff --git a/ext/intl/tests/calendar_isEquivalentTo_error.phpt b/ext/intl/tests/calendar_isEquivalentTo_error.phpt index c7e30fd64561b..254d1dab84639 100644 --- a/ext/intl/tests/calendar_isEquivalentTo_error.phpt +++ b/ext/intl/tests/calendar_isEquivalentTo_error.phpt @@ -51,14 +51,12 @@ try { --EXPECT-- error: 0, Argument 1 passed to IntlCalendar::isEquivalentTo() must be an instance of IntlCalendar, int given -error: 2, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given -error: 2, IntlCalendar::isEquivalentTo(): intlcal_is_equivalent_to: bad arguments -bool(false) +error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given + error: 0, Argument 1 passed to IntlCalendar::isEquivalentTo() must be an instance of IntlCalendar, int given -error: 2, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given -error: 2, intlcal_is_equivalent_to(): intlcal_is_equivalent_to: bad arguments -bool(false) +error: 0, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given + error: 0, Argument 2 passed to intlcal_is_equivalent_to() must be an instance of IntlCalendar, int given error: 0, Argument 1 passed to intlcal_is_equivalent_to() must be an instance of IntlCalendar, int given diff --git a/ext/intl/tests/calendar_isLenient_error.phpt b/ext/intl/tests/calendar_isLenient_error.phpt index 263d82bb376df..6fec30734990a 100644 --- a/ext/intl/tests/calendar_isLenient_error.phpt +++ b/ext/intl/tests/calendar_isLenient_error.phpt @@ -10,23 +10,8 @@ if (!extension_loaded('intl')) isLenient(1)); - -var_dump(intlcal_is_lenient($c, 1)); var_dump(intlcal_is_lenient(1)); --EXPECTF-- -Warning: IntlCalendar::isLenient() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::isLenient(): intlcal_is_lenient: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_is_lenient() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_is_lenient(): intlcal_is_lenient: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_lenient() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_is_lenient(1) diff --git a/ext/intl/tests/calendar_isSet_error.phpt b/ext/intl/tests/calendar_isSet_error.phpt index 7e5b2beaa6b1b..9cb266f742262 100644 --- a/ext/intl/tests/calendar_isSet_error.phpt +++ b/ext/intl/tests/calendar_isSet_error.phpt @@ -12,31 +12,13 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->isSet()); -var_dump($c->isSet(1, 2)); var_dump($c->isSet(-1)); -var_dump(intlcal_is_set($c)); var_dump(intlcal_is_set(1, 2)); --EXPECTF-- -Warning: IntlCalendar::isSet() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::isSet(): intlcal_is_set: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::isSet() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::isSet(): intlcal_is_set: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::isSet(): intlcal_is_set: invalid field in %s on line %d bool(false) -Warning: intlcal_is_set() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlcal_is_set(): intlcal_is_set: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_set() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_is_set(1, 2) diff --git a/ext/intl/tests/calendar_isWeekend_error.phpt b/ext/intl/tests/calendar_isWeekend_error.phpt index c1f8180fa3339..de40b2aee691d 100644 --- a/ext/intl/tests/calendar_isWeekend_error.phpt +++ b/ext/intl/tests/calendar_isWeekend_error.phpt @@ -10,29 +10,8 @@ if (!extension_loaded('intl')) isWeekend(1, 2)); -var_dump($c->isWeekend("jhhk")); - -var_dump(intlcal_is_weekend($c, "jj")); var_dump(intlcal_is_weekend(1)); --EXPECTF-- -Warning: IntlCalendar::isWeekend() expects at most 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::isWeekend(): intlcal_is_weekend: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::isWeekend() expects parameter 1 to be float, string given in %s on line %d - -Warning: IntlCalendar::isWeekend(): intlcal_is_weekend: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_is_weekend() expects parameter 2 to be float, string given in %s on line %d - -Warning: intlcal_is_weekend(): intlcal_is_weekend: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_is_weekend() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_is_weekend(1) diff --git a/ext/intl/tests/calendar_roll_error.phpt b/ext/intl/tests/calendar_roll_error.phpt index 27160ee8ca5f2..bc00896d8b8f2 100644 --- a/ext/intl/tests/calendar_roll_error.phpt +++ b/ext/intl/tests/calendar_roll_error.phpt @@ -12,27 +12,13 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->roll(1, 2, 3)); var_dump($c->roll(-1, 2)); -var_dump($c->roll(1)); -var_dump(intlcal_roll($c, 1, 2, 3)); var_dump(intlcal_roll(1, 2, 3)); --EXPECTF-- -Warning: IntlCalendar::roll(): intlcal_set: too many arguments in %s on line %d -bool(false) - Warning: IntlCalendar::roll(): intlcal_roll: invalid field in %s on line %d bool(false) -Warning: IntlCalendar::roll() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::roll(): intlcal_roll: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_roll(): intlcal_set: too many arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_roll() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_roll(1, 2, 3) diff --git a/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt b/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt index a22c3b28427db..6dcff918a782c 100644 --- a/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt +++ b/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt @@ -12,23 +12,11 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->setFirstDayOfWeek()); -var_dump($c->setFirstDayOfWeek(1, 2)); var_dump($c->setFirstDayOfWeek(0)); var_dump(intlcal_set_first_day_of_week($c, 0)); var_dump(intlcal_set_first_day_of_week(1, 2)); --EXPECTF-- -Warning: IntlCalendar::setFirstDayOfWeek() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::setFirstDayOfWeek(): intlcal_set_first_day_of_week: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setFirstDayOfWeek() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setFirstDayOfWeek(): intlcal_set_first_day_of_week: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::setFirstDayOfWeek(): intlcal_set_first_day_of_week: invalid day of week in %s on line %d bool(false) diff --git a/ext/intl/tests/calendar_setLenient_error.phpt b/ext/intl/tests/calendar_setLenient_error.phpt index b2a6f25d5d66b..2d73857c2b404 100644 --- a/ext/intl/tests/calendar_setLenient_error.phpt +++ b/ext/intl/tests/calendar_setLenient_error.phpt @@ -10,35 +10,8 @@ if (!extension_loaded('intl')) setLenient()); -var_dump($c->setLenient(array())); -var_dump($c->setLenient(1, 2)); - -var_dump(intlcal_set_lenient($c, array())); var_dump(intlcal_set_lenient(1, false)); --EXPECTF-- -Warning: IntlCalendar::setLenient() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::setLenient(): intlcal_set_lenient: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setLenient() expects parameter 1 to be bool, array given in %s on line %d - -Warning: IntlCalendar::setLenient(): intlcal_set_lenient: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setLenient() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setLenient(): intlcal_set_lenient: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_set_lenient() expects parameter 2 to be bool, array given in %s on line %d - -Warning: intlcal_set_lenient(): intlcal_set_lenient: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_lenient() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_set_lenient(1, false) diff --git a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt index 48d18bf28dce6..430fc953bd759 100644 --- a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt +++ b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt @@ -12,23 +12,11 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->setMinimalDaysInFirstWeek()); -var_dump($c->setMinimalDaysInFirstWeek(1, 2)); var_dump($c->setMinimalDaysInFirstWeek(0)); var_dump(intlcal_set_minimal_days_in_first_week($c, 0)); var_dump(intlcal_set_minimal_days_in_first_week(1, 2)); --EXPECTF-- -Warning: IntlCalendar::setMinimalDaysInFirstWeek() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::setMinimalDaysInFirstWeek(): intlcal_set_minimal_days_in_first_week: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setMinimalDaysInFirstWeek() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setMinimalDaysInFirstWeek(): intlcal_set_minimal_days_in_first_week: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::setMinimalDaysInFirstWeek(): intlcal_set_minimal_days_in_first_week: invalid number of days; must be between 1 and 7 in %s on line %d bool(false) diff --git a/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt b/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt index 776cb8b8250be..e3d03815dc9fe 100644 --- a/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt +++ b/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt @@ -12,69 +12,17 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->setSkippedWallTimeOption()); -var_dump($c->setRepeatedWallTimeOption()); - -var_dump($c->setSkippedWallTimeOption(1, 2)); -var_dump($c->setRepeatedWallTimeOption(1, 2)); - -var_dump($c->setSkippedWallTimeOption(array())); -var_dump($c->setRepeatedWallTimeOption(array())); - var_dump($c->setSkippedWallTimeOption(3)); var_dump($c->setRepeatedWallTimeOption(2)); -var_dump(intlcal_set_skipped_wall_time_option($c)); -var_dump(intlcal_set_repeated_wall_time_option($c)); - var_dump(intlcal_set_repeated_wall_time_option(1, 1)); --EXPECTF-- -Warning: IntlCalendar::setSkippedWallTimeOption() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::setSkippedWallTimeOption(): intlcal_set_skipped_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setRepeatedWallTimeOption() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlCalendar::setRepeatedWallTimeOption(): intlcal_set_repeated_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setSkippedWallTimeOption() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setSkippedWallTimeOption(): intlcal_set_skipped_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setRepeatedWallTimeOption() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setRepeatedWallTimeOption(): intlcal_set_repeated_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setSkippedWallTimeOption() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlCalendar::setSkippedWallTimeOption(): intlcal_set_skipped_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setRepeatedWallTimeOption() expects parameter 1 to be int, array given in %s on line %d - -Warning: IntlCalendar::setRepeatedWallTimeOption(): intlcal_set_repeated_wall_time_option: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::setSkippedWallTimeOption(): intlcal_set_skipped_wall_time_option: invalid option in %s on line %d bool(false) Warning: IntlCalendar::setRepeatedWallTimeOption(): intlcal_set_repeated_wall_time_option: invalid option in %s on line %d bool(false) -Warning: intlcal_set_skipped_wall_time_option() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlcal_set_skipped_wall_time_option(): intlcal_set_skipped_wall_time_option: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_set_repeated_wall_time_option() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlcal_set_repeated_wall_time_option(): intlcal_set_repeated_wall_time_option: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_repeated_wall_time_option() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_set_repeated_wall_time_option(1, 1) diff --git a/ext/intl/tests/calendar_setTimeZone_error.phpt b/ext/intl/tests/calendar_setTimeZone_error.phpt index dee773d377e0d..1cace3b4eaa44 100644 --- a/ext/intl/tests/calendar_setTimeZone_error.phpt +++ b/ext/intl/tests/calendar_setTimeZone_error.phpt @@ -41,13 +41,10 @@ try{ echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n"; } --EXPECT-- -error: 2, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given -error: 2, IntlCalendar::setTimeZone(): intlcal_set_time_zone: bad arguments -bool(false) -error: 2, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given -error: 2, IntlCalendar::setTimeZone(): intlcal_set_time_zone: bad arguments -bool(false) -error: 2, intlcal_set_time_zone() expects exactly 2 parameters, 3 given -error: 2, intlcal_set_time_zone(): intlcal_set_time_zone: bad arguments -bool(false) +error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given + +error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given + +error: 0, intlcal_set_time_zone() expects exactly 2 parameters, 3 given + error: 0, Argument 1 passed to intlcal_set_time_zone() must be an instance of IntlCalendar, int given diff --git a/ext/intl/tests/calendar_setTime_error.phpt b/ext/intl/tests/calendar_setTime_error.phpt index d3fa46c5919b8..6ecbd698bf96d 100644 --- a/ext/intl/tests/calendar_setTime_error.phpt +++ b/ext/intl/tests/calendar_setTime_error.phpt @@ -10,29 +10,8 @@ if (!extension_loaded('intl')) setTime(1, 2)); -var_dump($c->setTime("jjj")); - -var_dump(intlcal_set_time($c, 1, 2)); var_dump(intlcal_set_time(1)); --EXPECTF-- -Warning: IntlCalendar::setTime() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlCalendar::setTime(): intlcal_set_time: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::setTime() expects parameter 1 to be float, string given in %s on line %d - -Warning: IntlCalendar::setTime(): intlcal_set_time: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_set_time() expects exactly 2 parameters, 3 given in %s on line %d - -Warning: intlcal_set_time(): intlcal_set_time: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_time() must be an instance of IntlCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlcal_set_time(1) diff --git a/ext/intl/tests/calendar_set_error.phpt b/ext/intl/tests/calendar_set_error.phpt index 5827ad41ec4a9..2116786d322b0 100644 --- a/ext/intl/tests/calendar_set_error.phpt +++ b/ext/intl/tests/calendar_set_error.phpt @@ -12,22 +12,12 @@ ini_set("intl.error_level", E_WARNING); $c = new IntlGregorianCalendar(NULL, 'pt_PT'); -var_dump($c->set(1)); -var_dump($c->set(1, 2, 3, 4)); var_dump($c->set(1, 2, 3, 4, 5, 6, 7)); var_dump($c->set(-1, 2)); var_dump(intlcal_set($c, -1, 2)); var_dump(intlcal_set(1, 2, 3)); --EXPECTF-- -Warning: IntlCalendar::set() expects at least 2 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::set(): intlcal_set: bad arguments in %s on line %d -bool(false) - -Warning: IntlCalendar::set(): intlcal_set: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::set(): intlcal_set: too many arguments in %s on line %d bool(false) diff --git a/ext/intl/tests/calendar_toDateTime_error.phpt b/ext/intl/tests/calendar_toDateTime_error.phpt index 584bd28f65ea3..e251c501b6084 100644 --- a/ext/intl/tests/calendar_toDateTime_error.phpt +++ b/ext/intl/tests/calendar_toDateTime_error.phpt @@ -9,11 +9,6 @@ if (!extension_loaded('intl')) ini_set("intl.error_level", E_WARNING); ini_set('date.timezone', 'Europe/Lisbon'); -$cal = new IntlGregorianCalendar(); -var_dump($cal->toDateTime(3)); - -var_dump(intlcal_to_date_time($cal, 3)); - $cal = new IntlGregorianCalendar("Etc/Unknown"); try { var_dump($cal->toDateTime()); @@ -23,16 +18,6 @@ var_dump("exception: {$e->getMessage()}"); var_dump(intlcal_to_date_time(3)); --EXPECTF-- -Warning: IntlCalendar::toDateTime() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: bad arguments in %s on line %d -bool(false) - -Warning: intlcal_to_date_time() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlcal_to_date_time(): intlcal_to_date_time: bad arguments in %s on line %d -bool(false) - Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: DateTimeZone constructor threw exception in %s on line %d string(77) "exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)" diff --git a/ext/intl/tests/cpbi_getLastCodePoint_error.phpt b/ext/intl/tests/cpbi_getLastCodePoint_error.phpt deleted file mode 100644 index 505a076ca3c72..0000000000000 --- a/ext/intl/tests/cpbi_getLastCodePoint_error.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -IntlBreakIterator::getLastCodePoint(): bad args ---SKIPIF-- -getLastCodePoint(array())); ---EXPECTF-- -Warning: IntlCodePointBreakIterator::getLastCodePoint() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlCodePointBreakIterator::getLastCodePoint(): cpbi_get_last_code_point: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/dateformat_formatObject_error.phpt b/ext/intl/tests/dateformat_formatObject_error.phpt index bfcc951b73c8e..24be090035841 100644 --- a/ext/intl/tests/dateformat_formatObject_error.phpt +++ b/ext/intl/tests/dateformat_formatObject_error.phpt @@ -10,8 +10,6 @@ ini_set("intl.error_level", E_WARNING); ini_set("intl.default_locale", "pt_PT"); ini_set("date.timezone", "Europe/Lisbon"); -var_dump(IntlDateFormatter::formatObject()); -var_dump(IntlDateFormatter::formatObject(1)); var_dump(IntlDateFormatter::formatObject(new stdclass)); class A extends IntlCalendar {function __construct(){}} @@ -26,17 +24,10 @@ var_dump(IntlDateFormatter::formatObject($cal, array(1,2,3))); var_dump(IntlDateFormatter::formatObject($cal, array(array(), 1))); var_dump(IntlDateFormatter::formatObject($cal, array(1, -2))); var_dump(IntlDateFormatter::formatObject($cal, "")); -var_dump(IntlDateFormatter::formatObject($cal, "YYYY", array())); ?> ==DONE== --EXPECTF-- -Warning: IntlDateFormatter::formatObject() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: IntlDateFormatter::formatObject() expects parameter 1 to be object, int given in %s on line %d -bool(false) - Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the passed object must be an instance of either IntlCalendar or DateTime in %s on line %d bool(false) @@ -65,7 +56,4 @@ bool(false) Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the format is empty in %s on line %d bool(false) - -Warning: IntlDateFormatter::formatObject() expects parameter 3 to be string, array given in %s on line %d -bool(false) ==DONE== diff --git a/ext/intl/tests/dateformat_getCalendarObject_error.phpt b/ext/intl/tests/dateformat_getCalendarObject_error.phpt deleted file mode 100644 index d5a7833ded557..0000000000000 --- a/ext/intl/tests/dateformat_getCalendarObject_error.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -IntlDateFormatter::getCalendarObject(): bad args ---SKIPIF-- -getCalendarObject(9)); -var_dump(datefmt_get_calendar_object($df, 9)); -var_dump(datefmt_get_calendar_object($df, 9)); -var_dump(datefmt_get_calendar_object(new stdclass)); - -?> -==DONE== ---EXPECTF-- -Warning: IntlDateFormatter::getCalendarObject() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlDateFormatter::getCalendarObject(): datefmt_get_calendar_object: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_get_calendar_object() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: datefmt_get_calendar_object(): datefmt_get_calendar_object: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_get_calendar_object() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: datefmt_get_calendar_object(): datefmt_get_calendar_object: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_get_calendar_object() expects parameter 1 to be IntlDateFormatter, object given in %s on line %d - -Warning: datefmt_get_calendar_object(): datefmt_get_calendar_object: unable to parse input params in %s on line %d -bool(false) -==DONE== diff --git a/ext/intl/tests/dateformat_getTimeZone_error.phpt b/ext/intl/tests/dateformat_getTimeZone_error.phpt deleted file mode 100644 index d2ab92d86a25a..0000000000000 --- a/ext/intl/tests/dateformat_getTimeZone_error.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -IntlDateFormatter::getTimeZone(): bad args ---SKIPIF-- -getTimeZone(9)); -var_dump(datefmt_get_timezone($df, 9)); -var_dump(datefmt_get_timezone($df, 9)); -var_dump(datefmt_get_timezone(new stdclass)); - -?> -==DONE== ---EXPECTF-- -Warning: IntlDateFormatter::getTimeZone() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlDateFormatter::getTimeZone(): datefmt_get_timezone: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_get_timezone() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: datefmt_get_timezone(): datefmt_get_timezone: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_get_timezone() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: datefmt_get_timezone(): datefmt_get_timezone: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_get_timezone() expects parameter 1 to be IntlDateFormatter, object given in %s on line %d - -Warning: datefmt_get_timezone(): datefmt_get_timezone: unable to parse input params in %s on line %d -bool(false) -==DONE== diff --git a/ext/intl/tests/dateformat_setTimeZone_error.phpt b/ext/intl/tests/dateformat_setTimeZone_error.phpt index b58d159088958..e5ba550910802 100644 --- a/ext/intl/tests/dateformat_setTimeZone_error.phpt +++ b/ext/intl/tests/dateformat_setTimeZone_error.phpt @@ -12,41 +12,17 @@ ini_set("date.timezone", 'Atlantic/Azores'); $df = new IntlDateFormatter(NULL, 0, 0); -var_dump($df->setTimeZone()); -var_dump(datefmt_set_timezone()); var_dump($df->setTimeZone(array())); -var_dump($df->setTimeZone(1, 2)); var_dump($df->setTimeZone('non existing timezone')); -var_dump(datefmt_set_timezone(new stdclass, 'UTC')); ?> ==DONE== --EXPECTF-- -Warning: IntlDateFormatter::setTimeZone() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: unable to parse input params in %s on line %d -bool(false) - -Warning: datefmt_set_timezone() expects exactly 2 parameters, 0 given in %s on line %d - -Warning: datefmt_set_timezone(): datefmt_set_timezone: unable to parse input params in %s on line %d -bool(false) - Notice: Array to string conversion in %s on line %d Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: no such time zone: 'Array' in %s on line %d bool(false) -Warning: IntlDateFormatter::setTimeZone() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: unable to parse input params in %s on line %d -bool(false) - Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: no such time zone: 'non existing timezone' in %s on line %d bool(false) - -Warning: datefmt_set_timezone() expects parameter 1 to be IntlDateFormatter, object given in %s on line %d - -Warning: datefmt_set_timezone(): datefmt_set_timezone: unable to parse input params in %s on line %d -bool(false) ==DONE== diff --git a/ext/intl/tests/formatter_fail.phpt b/ext/intl/tests/formatter_fail.phpt index 9cfc6f505426d..0a8d7f398b2ee 100644 --- a/ext/intl/tests/formatter_fail.phpt +++ b/ext/intl/tests/formatter_fail.phpt @@ -27,10 +27,20 @@ function crt($t, $l, $s) { } break; case $t == "C": - return NumberFormatter::create($l, $s); + try { + return NumberFormatter::create($l, $s); + } catch (Throwable $e) { + print_exception($e); + return null; + } break; case $t == "P": - return numfmt_create($l, $s); + try { + return numfmt_create($l, $s); + } catch (Throwable $e) { + print_exception($e); + return null; + } break; } } @@ -50,9 +60,19 @@ try { $fmt = null; } err($fmt); -$fmt = numfmt_create(); +try { + $fmt = numfmt_create(); +} catch (TypeError $e) { + print_exception($e); + $fmt = null; +} err($fmt); -$fmt = NumberFormatter::create(); +try { + $fmt = NumberFormatter::create(); +} catch (TypeError $e) { + print_exception($e); + $fmt = null; +} err($fmt); foreach($args as $arg) { @@ -67,34 +87,34 @@ foreach($args as $arg) { ?> --EXPECTF-- ArgumentCountError: NumberFormatter::__construct() expects at least 2 parameters, 0 given in %s on line %d -'numfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +'U_ZERO_ERROR' -Warning: numfmt_create() expects at least 2 parameters, 0 given in %s on line %d -'numfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +ArgumentCountError: numfmt_create() expects at least 2 parameters, 0 given in %s on line %d +'U_ZERO_ERROR' -Warning: NumberFormatter::create() expects at least 2 parameters, 0 given in %s on line %d -'numfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +ArgumentCountError: NumberFormatter::create() expects at least 2 parameters, 0 given in %s on line %d +'U_ZERO_ERROR' -IntlException: Constructor failed in %sformatter_fail.php on line %d +IntlException: Constructor failed in %s on line %d 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' TypeError: NumberFormatter::__construct() expects parameter 1 to be string, array given in %s on line %d -'numfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +'U_ZERO_ERROR' -Warning: NumberFormatter::create() expects parameter 1 to be string, array given in %s on line %d -'numfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +TypeError: NumberFormatter::create() expects parameter 1 to be string, array given in %s on line %d +'U_ZERO_ERROR' -Warning: numfmt_create() expects parameter 1 to be string, array given in %s on line %d -'numfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +TypeError: numfmt_create() expects parameter 1 to be string, array given in %s on line %d +'U_ZERO_ERROR' -IntlException: Constructor failed in %sformatter_fail.php on line %d +IntlException: Constructor failed in %s on line %d 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' 'numfmt_create: number formatter creation failed: U_UNSUPPORTED_ERROR' -IntlException: Constructor failed in %sformatter_fail.php on line %d +IntlException: Constructor failed in %s on line %d 'numfmt_create: number formatter creation failed: U_MEMORY_ALLOCATION_ERROR' 'numfmt_create: number formatter creation failed: U_MEMORY_ALLOCATION_ERROR' 'numfmt_create: number formatter creation failed: U_MEMORY_ALLOCATION_ERROR' diff --git a/ext/intl/tests/gregoriancalendar_getGregorianChange_error.phpt b/ext/intl/tests/gregoriancalendar_getGregorianChange_error.phpt index a1cfb593d7528..3353690d1cc2c 100644 --- a/ext/intl/tests/gregoriancalendar_getGregorianChange_error.phpt +++ b/ext/intl/tests/gregoriancalendar_getGregorianChange_error.phpt @@ -10,22 +10,10 @@ if (!extension_loaded('intl')) getGregorianChange(1)); - -var_dump(intlgregcal_get_gregorian_change($c, 1)); var_dump(intlgregcal_get_gregorian_change(1)); ---EXPECTF-- -Warning: IntlGregorianCalendar::getGregorianChange() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlGregorianCalendar::getGregorianChange(): intlgregcal_get_gregorian_change: bad arguments in %s on line %d -bool(false) - -Warning: intlgregcal_get_gregorian_change() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: intlgregcal_get_gregorian_change(): intlgregcal_get_gregorian_change: bad arguments in %s on line %d -bool(false) +?> +--EXPECTF-- Fatal error: Uncaught TypeError: Argument 1 passed to intlgregcal_get_gregorian_change() must be an instance of IntlGregorianCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlgregcal_get_gregorian_change(1) diff --git a/ext/intl/tests/gregoriancalendar_isLeapYear_error.phpt b/ext/intl/tests/gregoriancalendar_isLeapYear_error.phpt index 9da5aaf4188f0..701e643e00d8f 100644 --- a/ext/intl/tests/gregoriancalendar_isLeapYear_error.phpt +++ b/ext/intl/tests/gregoriancalendar_isLeapYear_error.phpt @@ -10,40 +10,10 @@ if (!extension_loaded('intl')) isLeapYear(2000, 2011)); -var_dump($c->isLeapYear()); -var_dump($c->isLeapYear("fgdf")); - -var_dump(intlgregcal_is_leap_year($c, 1, 2)); -var_dump(intlgregcal_is_leap_year($c)); var_dump(intlgregcal_is_leap_year(1, 2)); ---EXPECTF-- -Warning: IntlGregorianCalendar::isLeapYear() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlGregorianCalendar::isLeapYear(): intlgregcal_is_leap_year: bad arguments in %s on line %d -bool(false) - -Warning: IntlGregorianCalendar::isLeapYear() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlGregorianCalendar::isLeapYear(): intlgregcal_is_leap_year: bad arguments in %s on line %d -bool(false) - -Warning: IntlGregorianCalendar::isLeapYear() expects parameter 1 to be int, string given in %s on line %d - -Warning: IntlGregorianCalendar::isLeapYear(): intlgregcal_is_leap_year: bad arguments in %s on line %d -bool(false) - -Warning: intlgregcal_is_leap_year() expects exactly 2 parameters, 3 given in %s on line %d - -Warning: intlgregcal_is_leap_year(): intlgregcal_is_leap_year: bad arguments in %s on line %d -bool(false) - -Warning: intlgregcal_is_leap_year() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlgregcal_is_leap_year(): intlgregcal_is_leap_year: bad arguments in %s on line %d -bool(false) +?> +--EXPECTF-- Fatal error: Uncaught TypeError: Argument 1 passed to intlgregcal_is_leap_year() must be an instance of IntlGregorianCalendar, int given in %s:%d Stack trace: #0 %s(%d): intlgregcal_is_leap_year(1, 2) diff --git a/ext/intl/tests/gregoriancalendar_setGregorianChange_error.phpt b/ext/intl/tests/gregoriancalendar_setGregorianChange_error.phpt deleted file mode 100644 index 0dd27802b5f77..0000000000000 --- a/ext/intl/tests/gregoriancalendar_setGregorianChange_error.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -IntlGregorianCalendar::setGregorianChange(): bad arguments ---INI-- -date.timezone=Atlantic/Azores ---SKIPIF-- -setGregorianChange()); -var_dump($c->setGregorianChange(1, 2)); -var_dump($c->setGregorianChange("sdfds")); - -var_dump(intlgregcal_set_gregorian_change($c)); -var_dump(intlgregcal_set_gregorian_change(1, 4.)); ---EXPECTF-- -Warning: IntlGregorianCalendar::setGregorianChange() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlGregorianCalendar::setGregorianChange(): intlgregcal_set_gregorian_change: bad arguments in %s on line %d -bool(false) - -Warning: IntlGregorianCalendar::setGregorianChange() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlGregorianCalendar::setGregorianChange(): intlgregcal_set_gregorian_change: bad arguments in %s on line %d -bool(false) - -Warning: IntlGregorianCalendar::setGregorianChange() expects parameter 1 to be float, string given in %s on line %d - -Warning: IntlGregorianCalendar::setGregorianChange(): intlgregcal_set_gregorian_change: bad arguments in %s on line %d -bool(false) - -Warning: intlgregcal_set_gregorian_change() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: intlgregcal_set_gregorian_change(): intlgregcal_set_gregorian_change: bad arguments in %s on line %d -bool(false) - -Fatal error: Uncaught TypeError: Argument 1 passed to intlgregcal_set_gregorian_change() must be an instance of IntlGregorianCalendar, int given in %s:%d -Stack trace: -#0 %s(%d): intlgregcal_set_gregorian_change(1, 4) -#1 {main} - thrown in %s on line %d diff --git a/ext/intl/tests/idn_uts46_errors.phpt b/ext/intl/tests/idn_uts46_errors.phpt index 55d2d56215d68..e468e8caf886f 100644 --- a/ext/intl/tests/idn_uts46_errors.phpt +++ b/ext/intl/tests/idn_uts46_errors.phpt @@ -11,10 +11,6 @@ IDN UTS #46 API error tests ini_set("intl.error_level", E_WARNING); echo "=> PHP level errors", "\n"; -echo "bad args:", "\n"; -var_dump(idn_to_ascii("", 0, array())); -var_dump(idn_to_ascii("", 0, INTL_IDNA_VARIANT_UTS46, $foo, null)); - echo "bad variant:", "\n"; var_dump(idn_to_ascii("", 0, INTL_IDNA_VARIANT_UTS46 + 10)); @@ -36,19 +32,10 @@ var_dump(idn_to_ascii( INTL_IDNA_VARIANT_UTS46, $foo)); var_dump($foo); var_dump($foo["errors"]==IDNA_ERROR_CONTEXTJ); + +?> --EXPECTF-- => PHP level errors -bad args: - -Warning: idn_to_ascii() expects parameter 3 to be int, array given in %s on line %d - -Warning: idn_to_ascii(): idn_to_ascii: bad arguments in %s on line %d -NULL - -Warning: idn_to_ascii() expects at most 4 parameters, 5 given in %s on line %d - -Warning: idn_to_ascii(): idn_to_ascii: bad arguments in %s on line %d -NULL bad variant: Warning: idn_to_ascii(): idn_to_ascii: invalid variant, must be INTL_IDNA_VARIANT_UTS46 in %s on line %d diff --git a/ext/intl/tests/intl_get_error_code.phpt b/ext/intl/tests/intl_get_error_code.phpt index 6cd361ba71a4e..797aee4fb717e 100644 --- a/ext/intl/tests/intl_get_error_code.phpt +++ b/ext/intl/tests/intl_get_error_code.phpt @@ -11,7 +11,7 @@ intl_get_error_code() // Suppress warning messages. error_reporting( E_ERROR ); -if( collator_get_locale() !== false ) +if( collator_get_locale(new Collator('en_US'), -1) !== false ) echo "failed\n"; else { diff --git a/ext/intl/tests/intl_get_error_message.phpt b/ext/intl/tests/intl_get_error_message.phpt index f81b5c03d5e62..e03fb806589f6 100644 --- a/ext/intl/tests/intl_get_error_message.phpt +++ b/ext/intl/tests/intl_get_error_message.phpt @@ -11,11 +11,11 @@ intl_get_error_message() // Suppress warning messages. error_reporting( E_ERROR ); -if( collator_get_locale() !== false ) +if( collator_get_locale(new Collator('en_US'), -1) !== false ) echo "failed\n"; else printf( "%s\n", intl_get_error_message() ); ?> --EXPECT-- -collator_get_locale: unable to parse input params: U_ILLEGAL_ARGUMENT_ERROR +Error getting locale by type: U_ILLEGAL_ARGUMENT_ERROR diff --git a/ext/intl/tests/locale_accept.phpt b/ext/intl/tests/locale_accept.phpt index a2834d8adec28..6a29cd6723bc4 100644 --- a/ext/intl/tests/locale_accept.phpt +++ b/ext/intl/tests/locale_accept.phpt @@ -19,7 +19,6 @@ function ut_main() 'zh, en-us;q=0.8, en;q=0.7', 'xx, fr-FR;q=0.3, de-DE;q=0.5', 'none', - array() ); foreach($http_acc as $http) { @@ -34,13 +33,9 @@ include_once( 'ut_common.inc' ); ut_run(); ?> ---EXPECTF-- -Warning: Locale::acceptFromHttp() expects parameter 1 to be string, array given in %s on line %d - -Warning: locale_accept_from_http() expects parameter 1 to be string, array given in %s on line %d +--EXPECT-- Accepting en-us,en;q=0.5: en_US Accepting da, en-gb;q=0.8, en;q=0.7: da Accepting zh, en-us;q=0.8, en;q=0.7: zh Accepting xx, fr-FR;q=0.3, de-DE;q=0.5: de_DE Accepting none: -Accepting Array: diff --git a/ext/intl/tests/msgfmt_fail2.phpt b/ext/intl/tests/msgfmt_fail2.phpt index 0016de4bb7a9e..688e65a861ae5 100644 --- a/ext/intl/tests/msgfmt_fail2.phpt +++ b/ext/intl/tests/msgfmt_fail2.phpt @@ -27,10 +27,20 @@ function crt($t, $l, $s) { } break; case $t == "C": - return MessageFormatter::create($l, $s); + try { + return MessageFormatter::create($l, $s); + } catch (Throwable $e) { + print_exception($e); + return null; + } break; case $t == "P": - return msgfmt_create($l, $s); + try { + return msgfmt_create($l, $s); + } catch (Throwable $e) { + print_exception($e); + return null; + } break; } } @@ -51,9 +61,19 @@ try { $fmt = null; } err($fmt); -$fmt = msgfmt_create(); +try { + $fmt = msgfmt_create(); +} catch (TypeError $e) { + print_exception($e); + $fmt = null; +} err($fmt); -$fmt = MessageFormatter::create(); +try { + $fmt = MessageFormatter::create(); +} catch (TypeError $e) { + print_exception($e); + $fmt = null; +} err($fmt); try { $fmt = new MessageFormatter('en'); @@ -62,9 +82,19 @@ try { $fmt = null; } err($fmt); -$fmt = msgfmt_create('en'); +try { + $fmt = msgfmt_create('en'); +} catch (TypeError $e) { + print_exception($e); + $fmt = null; +} err($fmt); -$fmt = MessageFormatter::create('en'); +try { + $fmt = MessageFormatter::create('en'); +} catch (TypeError $e) { + print_exception($e); + $fmt = null; +} err($fmt); foreach($args as $arg) { @@ -79,53 +109,53 @@ foreach($args as $arg) { ?> --EXPECTF-- ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +'U_ZERO_ERROR' -Warning: msgfmt_create() expects exactly 2 parameters, 0 given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 0 given in %s on line %d +'U_ZERO_ERROR' -Warning: MessageFormatter::create() expects exactly 2 parameters, 0 given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 0 given in %s on line %d +'U_ZERO_ERROR' ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +'U_ZERO_ERROR' -Warning: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d +'U_ZERO_ERROR' -Warning: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d +'U_ZERO_ERROR' -IntlException: Constructor failed in %smsgfmt_fail2.php on line %d +IntlException: Constructor failed in %s on line %d 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' -IntlException: Constructor failed in %smsgfmt_fail2.php on line %d +IntlException: Constructor failed in %s on line %d 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' 'msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR' TypeError: MessageFormatter::__construct() expects parameter 1 to be string, array given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +'U_ZERO_ERROR' -Warning: MessageFormatter::create() expects parameter 1 to be string, array given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +TypeError: MessageFormatter::create() expects parameter 1 to be string, array given in %s on line %d +'U_ZERO_ERROR' -Warning: msgfmt_create() expects parameter 1 to be string, array given in %s on line %d -'msgfmt_create: unable to parse input parameters: U_ILLEGAL_ARGUMENT_ERROR' +TypeError: msgfmt_create() expects parameter 1 to be string, array given in %s on line %d +'U_ZERO_ERROR' -IntlException: Constructor failed in %smsgfmt_fail2.php on line %d +IntlException: Constructor failed in %s on line %d 'msgfmt_create: message formatter creation failed: U_PATTERN_SYNTAX_ERROR' 'msgfmt_create: message formatter creation failed: U_PATTERN_SYNTAX_ERROR' 'msgfmt_create: message formatter creation failed: U_PATTERN_SYNTAX_ERROR' -IntlException: Constructor failed in %smsgfmt_fail2.php on line %d +IntlException: Constructor failed in %s on line %d 'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES' 'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES' 'msgfmt_create: message formatter creation failed: U_UNMATCHED_BRACES' -IntlException: Constructor failed in %smsgfmt_fail2.php on line %d +IntlException: Constructor failed in %s on line %d 'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND' 'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND' 'msgfmt_create: error converting pattern to UTF-16: U_INVALID_CHAR_FOUND' diff --git a/ext/intl/tests/timezone_countEquivalentIDs_error.phpt b/ext/intl/tests/timezone_countEquivalentIDs_error.phpt index 3087f49cbe8f5..4fc9b02a1d11b 100644 --- a/ext/intl/tests/timezone_countEquivalentIDs_error.phpt +++ b/ext/intl/tests/timezone_countEquivalentIDs_error.phpt @@ -8,25 +8,7 @@ if (!extension_loaded('intl')) --EXPECTF-- Warning: IntlTimeZone::createEnumeration(): intltz_create_enumeration: invalid argument type in %s on line %d bool(false) - -Warning: IntlTimeZone::createEnumeration() expects at most 1 parameter, 2 given in %s on line %d - -Warning: IntlTimeZone::createEnumeration(): intltz_create_enumeration: bad arguments in %s on line %d -bool(false) diff --git a/ext/intl/tests/timezone_createTimeZoneIDEnumeration_error.phpt b/ext/intl/tests/timezone_createTimeZoneIDEnumeration_error.phpt index 5edfaeaf6b66a..2b847ec841c6c 100644 --- a/ext/intl/tests/timezone_createTimeZoneIDEnumeration_error.phpt +++ b/ext/intl/tests/timezone_createTimeZoneIDEnumeration_error.phpt @@ -8,31 +8,7 @@ if (!extension_loaded('intl')) --EXPECTF-- -Warning: IntlTimeZone::createTimeZone() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlTimeZone::createTimeZone(): intltz_create_time_zone: bad arguments in %s on line %d -NULL - -Warning: IntlTimeZone::createTimeZone() expects parameter 1 to be string, object given in %s on line %d - -Warning: IntlTimeZone::createTimeZone(): intltz_create_time_zone: bad arguments in %s on line %d -NULL - -Warning: IntlTimeZone::createTimeZone() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlTimeZone::createTimeZone(): intltz_create_time_zone: bad arguments in %s on line %d -NULL - Warning: IntlTimeZone::createTimeZone(): intltz_create_time_zone: could not convert time zone id to UTF-16 in %s on line %d NULL diff --git a/ext/intl/tests/timezone_fromDateTimeZone_error.phpt b/ext/intl/tests/timezone_fromDateTimeZone_error.phpt index f50e59f97c1a0..54a70d1f17b84 100644 --- a/ext/intl/tests/timezone_fromDateTimeZone_error.phpt +++ b/ext/intl/tests/timezone_fromDateTimeZone_error.phpt @@ -10,39 +10,9 @@ if (!extension_loaded('intl')) getTimeZone())); - -var_dump(intltz_from_date_time_zone()); +?> --EXPECTF-- -Warning: IntlTimeZone::fromDateTimeZone() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d -NULL - -Warning: IntlTimeZone::fromDateTimeZone() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d -NULL - -Warning: IntlTimeZone::fromDateTimeZone() expects parameter 1 to be DateTimeZone, string given in %s on line %d - -Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d -NULL - -Warning: IntlTimeZone::fromDateTimeZone() expects parameter 1 to be DateTimeZone, object given in %s on line %d - -Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d -NULL - Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d NULL - -Warning: intltz_from_date_time_zone() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: intltz_from_date_time_zone(): intltz_from_date_time_zone: bad arguments in %s on line %d -NULL diff --git a/ext/intl/tests/timezone_getCanonicalID_error.phpt b/ext/intl/tests/timezone_getCanonicalID_error.phpt index 684d946b1ef2e..c1f7b6927a0ef 100644 --- a/ext/intl/tests/timezone_getCanonicalID_error.phpt +++ b/ext/intl/tests/timezone_getCanonicalID_error.phpt @@ -8,19 +8,8 @@ if (!extension_loaded('intl')) --EXPECTF-- -Warning: IntlTimeZone::getCanonicalID() expects at least 1 parameter, 0 given in %s on line %d - -Warning: IntlTimeZone::getCanonicalID(): intltz_get_canonical_id: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getCanonicalID() expects parameter 1 to be string, array given in %s on line %d - -Warning: IntlTimeZone::getCanonicalID(): intltz_get_canonical_id: bad arguments in %s on line %d -bool(false) - Warning: IntlTimeZone::getCanonicalID(): intltz_get_canonical_id: could not convert time zone id to UTF-16 in %s on line %d bool(false) diff --git a/ext/intl/tests/timezone_getDSTSavings_error.phpt b/ext/intl/tests/timezone_getDSTSavings_error.phpt index 9df04f08c14fa..ebb0eb7776a82 100644 --- a/ext/intl/tests/timezone_getDSTSavings_error.phpt +++ b/ext/intl/tests/timezone_getDSTSavings_error.phpt @@ -8,16 +8,9 @@ if (!extension_loaded('intl')) getDSTSavings(array())); - var_dump(intltz_get_dst_savings(null)); +?> --EXPECTF-- -Warning: IntlTimeZone::getDSTSavings() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::getDSTSavings(): intltz_get_dst_savings: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_dst_savings() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_dst_savings(NULL) diff --git a/ext/intl/tests/timezone_getDisplayName_error.phpt b/ext/intl/tests/timezone_getDisplayName_error.phpt index 8d30f8840fbcd..108530d2c3fe7 100644 --- a/ext/intl/tests/timezone_getDisplayName_error.phpt +++ b/ext/intl/tests/timezone_getDisplayName_error.phpt @@ -9,37 +9,13 @@ if (!extension_loaded('intl')) ini_set("intl.error_level", E_WARNING); $tz = IntlTimeZone::createTimeZone('Europe/Lisbon'); -var_dump($tz->getDisplayName(array())); -var_dump($tz->getDisplayName(false, array())); var_dump($tz->getDisplayName(false, -1)); -var_dump($tz->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT, array())); -var_dump($tz->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT, NULL, NULL)); var_dump(intltz_get_display_name(null, IntlTimeZone::DISPLAY_SHORT, false, 'pt_PT')); --EXPECTF-- -Warning: IntlTimeZone::getDisplayName() expects parameter 1 to be bool, array given in %s on line %d - -Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getDisplayName() expects parameter 2 to be int, array given in %s on line %d - -Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d -bool(false) - Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: wrong display type in %s on line %d bool(false) -Warning: IntlTimeZone::getDisplayName() expects parameter 3 to be string, array given in %s on line %d - -Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getDisplayName() expects at most 3 parameters, 4 given in %s on line %d - -Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_display_name() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_display_name(NULL, 1, false, 'pt_PT') diff --git a/ext/intl/tests/timezone_getEquivalentID_error.phpt b/ext/intl/tests/timezone_getEquivalentID_error.phpt index facb8fe8cfcde..12afaee2fab44 100644 --- a/ext/intl/tests/timezone_getEquivalentID_error.phpt +++ b/ext/intl/tests/timezone_getEquivalentID_error.phpt @@ -8,25 +8,8 @@ if (!extension_loaded('intl')) --EXPECTF-- -Warning: IntlTimeZone::getEquivalentID() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getEquivalentID() expects parameter 2 to be int, string given in %s on line %d - -Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getEquivalentID() expects exactly 2 parameters, 3 given in %s on line %d - -Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: bad arguments in %s on line %d -bool(false) - Warning: IntlTimeZone::getEquivalentID(): intltz_get_equivalent_id: could not convert time zone id to UTF-16 in %s on line %d bool(false) diff --git a/ext/intl/tests/timezone_getErrorCode_error.phpt b/ext/intl/tests/timezone_getErrorCode_error.phpt index f5b06b0757699..657e09b240f63 100644 --- a/ext/intl/tests/timezone_getErrorCode_error.phpt +++ b/ext/intl/tests/timezone_getErrorCode_error.phpt @@ -8,16 +8,9 @@ if (!extension_loaded('intl')) getErrorCode(array())); - var_dump(intltz_get_error_code(null)); +?> --EXPECTF-- -Warning: IntlTimeZone::getErrorCode() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::getErrorCode(): intltz_get_error_code: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_error_code() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_error_code(NULL) diff --git a/ext/intl/tests/timezone_getErrorMessage_error.phpt b/ext/intl/tests/timezone_getErrorMessage_error.phpt index 6b8ce7d5c89a6..3ea812050b85d 100644 --- a/ext/intl/tests/timezone_getErrorMessage_error.phpt +++ b/ext/intl/tests/timezone_getErrorMessage_error.phpt @@ -8,16 +8,9 @@ if (!extension_loaded('intl')) getErrorMessage(array())); - var_dump(intltz_get_error_message(null)); +?> --EXPECTF-- -Warning: IntlTimeZone::getErrorMessage() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::getErrorMessage(): intltz_get_error_message: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_error_message() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_error_message(NULL) diff --git a/ext/intl/tests/timezone_getGMT_error.phpt b/ext/intl/tests/timezone_getGMT_error.phpt deleted file mode 100644 index ca478a10d132b..0000000000000 --- a/ext/intl/tests/timezone_getGMT_error.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -IntlTimeZone::getGMT(): errors ---SKIPIF-- -getID('foo')); intltz_get_id(null); +?> --EXPECTF-- -Warning: IntlTimeZone::getID() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::getID(): intltz_get_id: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_id() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_id(NULL) diff --git a/ext/intl/tests/timezone_getOffset_error.phpt b/ext/intl/tests/timezone_getOffset_error.phpt index d66716e552f2e..3ae06e4ce0065 100644 --- a/ext/intl/tests/timezone_getOffset_error.phpt +++ b/ext/intl/tests/timezone_getOffset_error.phpt @@ -10,24 +10,13 @@ ini_set("intl.error_level", E_WARNING); $tz = IntlTimeZone::createTimeZone('Europe/Lisbon'); var_dump($tz->getOffset(INF, true, $a, $a)); -var_dump($tz->getOffset(time()*1000, true, $a)); -var_dump($tz->getOffset(time()*1000, true, $a, $a, $a)); intltz_get_offset(null, time()*1000, false, $a, $a); +?> --EXPECTF-- Warning: IntlTimeZone::getOffset(): intltz_get_offset: error obtaining offset in %s on line %d bool(false) -Warning: IntlTimeZone::getOffset() expects exactly 4 parameters, 3 given in %s on line %d - -Warning: IntlTimeZone::getOffset(): intltz_get_offset: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getOffset() expects exactly 4 parameters, 5 given in %s on line %d - -Warning: IntlTimeZone::getOffset(): intltz_get_offset: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_offset() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_offset(NULL, %d, false, NULL, NULL) diff --git a/ext/intl/tests/timezone_getRawOffset_error.phpt b/ext/intl/tests/timezone_getRawOffset_error.phpt index dc7df51cca242..9e0691f39d6e7 100644 --- a/ext/intl/tests/timezone_getRawOffset_error.phpt +++ b/ext/intl/tests/timezone_getRawOffset_error.phpt @@ -8,16 +8,9 @@ if (!extension_loaded('intl')) getRawOffset('foo')); - intltz_get_raw_offset(null); +?> --EXPECTF-- -Warning: IntlTimeZone::getRawOffset() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::getRawOffset(): intltz_get_raw_offset: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_get_raw_offset() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_get_raw_offset(NULL) diff --git a/ext/intl/tests/timezone_getRegion_error.phpt b/ext/intl/tests/timezone_getRegion_error.phpt index 7a9e1e1ca7d27..28fd73c1a7015 100644 --- a/ext/intl/tests/timezone_getRegion_error.phpt +++ b/ext/intl/tests/timezone_getRegion_error.phpt @@ -8,27 +8,10 @@ if (!extension_loaded('intl')) --EXPECTF-- -Warning: IntlTimeZone::getRegion() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: IntlTimeZone::getRegion(): intltz_get_region: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getRegion() expects parameter 1 to be string, array given in %s on line %d - -Warning: IntlTimeZone::getRegion(): intltz_get_region: bad arguments in %s on line %d -bool(false) - -Warning: IntlTimeZone::getRegion() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: IntlTimeZone::getRegion(): intltz_get_region: bad arguments in %s on line %d -bool(false) - Warning: IntlTimeZone::getRegion(): intltz_get_region: could not convert time zone id to UTF-16 in %s on line %d bool(false) diff --git a/ext/intl/tests/timezone_getTZDataVersion_error.phpt b/ext/intl/tests/timezone_getTZDataVersion_error.phpt deleted file mode 100644 index eab4573a3608f..0000000000000 --- a/ext/intl/tests/timezone_getTZDataVersion_error.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -IntlTimeZone::getTZDataVersion(): errors ---SKIPIF-- -toDateTimeZone('')); try { var_dump($tz->toDateTimeZone()); } catch (Exception $e) { var_dump($e->getMessage()); } -var_dump(intltz_to_date_time_zone()); var_dump(intltz_to_date_time_zone(1)); --EXPECTF-- -Warning: IntlTimeZone::toDateTimeZone() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: bad arguments in %s on line %d -bool(false) - Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: DateTimeZone constructor threw exception in %s on line %d string(66) "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)" -Warning: intltz_to_date_time_zone() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: intltz_to_date_time_zone(): intltz_to_date_time_zone: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_to_date_time_zone() must be an instance of IntlTimeZone, int given in %s:%d Stack trace: #0 %s(%d): intltz_to_date_time_zone(1) diff --git a/ext/intl/tests/timezone_useDaylightTime_error.phpt b/ext/intl/tests/timezone_useDaylightTime_error.phpt index c6ab2eefe5871..b872dcb18b8db 100644 --- a/ext/intl/tests/timezone_useDaylightTime_error.phpt +++ b/ext/intl/tests/timezone_useDaylightTime_error.phpt @@ -8,15 +8,9 @@ if (!extension_loaded('intl')) useDaylightTime('foo')); intltz_use_daylight_time(null); +?> --EXPECTF-- -Warning: IntlTimeZone::useDaylightTime() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: IntlTimeZone::useDaylightTime(): intltz_use_daylight_time: bad arguments in %s on line %d -bool(false) - Fatal error: Uncaught TypeError: Argument 1 passed to intltz_use_daylight_time() must be an instance of IntlTimeZone, null given in %s:%d Stack trace: #0 %s(%d): intltz_use_daylight_time(NULL) diff --git a/ext/intl/tests/transliterator_create_from_rule_error.phpt b/ext/intl/tests/transliterator_create_from_rule_error.phpt index d1549ec1b684d..64c57da854444 100644 --- a/ext/intl/tests/transliterator_create_from_rule_error.phpt +++ b/ext/intl/tests/transliterator_create_from_rule_error.phpt @@ -6,12 +6,6 @@ Transliterator::createFromRules (error) createInverse(array()); - -$tr = Transliterator::create("Katakana-Latin"); transliterator_create_inverse("jj"); +?> --EXPECTF-- -Warning: Transliterator::createInverse() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: Transliterator::createInverse(): transliterator_create_inverse: bad arguments in %s on line %d - Fatal error: Uncaught TypeError: Argument 1 passed to transliterator_create_inverse() must be an instance of Transliterator, string given in %s:%d Stack trace: #0 %s(%d): transliterator_create_inverse('jj') diff --git a/ext/intl/tests/transliterator_get_error_code_error.phpt b/ext/intl/tests/transliterator_get_error_code_error.phpt index e700d2b172a6f..813c8c480ef05 100644 --- a/ext/intl/tests/transliterator_get_error_code_error.phpt +++ b/ext/intl/tests/transliterator_get_error_code_error.phpt @@ -5,21 +5,9 @@ Transliterator::getErrorCode (error) --FILE-- getErrorCode(null), "\n"; echo transliterator_get_error_code(array()), "\n"; +?> --EXPECTF-- -Warning: transliterator_get_error_code() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: transliterator_get_error_code(): transliterator_get_error_code: unable to parse input params in %s on line %d - - -Warning: Transliterator::getErrorCode() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: Transliterator::getErrorCode(): transliterator_get_error_code: unable to parse input params in %s on line %d - - Fatal error: Uncaught TypeError: Argument 1 passed to transliterator_get_error_code() must be an instance of Transliterator, array given in %s:%d Stack trace: #0 %s(%d): transliterator_get_error_code(Array) diff --git a/ext/intl/tests/transliterator_get_error_message_error.phpt b/ext/intl/tests/transliterator_get_error_message_error.phpt index ec8282447ac5f..7bcc7df169625 100644 --- a/ext/intl/tests/transliterator_get_error_message_error.phpt +++ b/ext/intl/tests/transliterator_get_error_message_error.phpt @@ -5,21 +5,9 @@ Transliterator::getErrorMessage (error) --FILE-- getErrorMessage(null), "\n"; echo transliterator_get_error_message(array()), "\n"; +?> --EXPECTF-- -Warning: transliterator_get_error_message() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: transliterator_get_error_message(): transliterator_get_error_message: unable to parse input params in %s on line %d - - -Warning: Transliterator::getErrorMessage() expects exactly 0 parameters, 1 given in %s on line %d - -Warning: Transliterator::getErrorMessage(): transliterator_get_error_message: unable to parse input params in %s on line %d - - Fatal error: Uncaught TypeError: Argument 1 passed to transliterator_get_error_message() must be an instance of Transliterator, array given in %s:%d Stack trace: #0 %s(%d): transliterator_get_error_message(Array) diff --git a/ext/intl/tests/transliterator_list_ids_error.phpt b/ext/intl/tests/transliterator_list_ids_error.phpt deleted file mode 100644 index fa651387f1a6d..0000000000000 --- a/ext/intl/tests/transliterator_list_ids_error.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Transliterator::listIDs (error) ---SKIPIF-- - ---FILE-- -transliterate()); -var_dump($tr->transliterate(array())); //bad UTF-8 transliterator_transliterate($tr, "\x80\x03"); echo "Done.\n"; --EXPECTF-- -Warning: transliterator_transliterate() expects at least 2 parameters, 0 given in %s on line %d - -Warning: transliterator_transliterate(): transliterator_transliterate: bad arguments in %s on line %d -bool(false) - -Warning: transliterator_transliterate() expects parameter 2 to be string, array given in %s on line %d - -Warning: transliterator_transliterate(): transliterator_transliterate: bad arguments in %s on line %d -bool(false) - Warning: transliterator_transliterate(): transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3) in %s on line %d bool(false) Warning: transliterator_transliterate(): transliterator_transliterate: "start" argument should be non-negative and not bigger than "end" (if defined) in %s on line %d bool(false) -Warning: transliterator_transliterate() expects at most 4 parameters, 5 given in %s on line %d - -Warning: transliterator_transliterate(): transliterator_transliterate: bad arguments in %s on line %d -bool(false) - -Warning: Transliterator::transliterate() expects at least 1 parameter, 0 given in %s on line %d - -Warning: Transliterator::transliterate(): transliterator_transliterate: bad arguments in %s on line %d -bool(false) - -Warning: Transliterator::transliterate() expects parameter 1 to be string, array given in %s on line %d - -Warning: Transliterator::transliterate(): transliterator_transliterate: bad arguments in %s on line %d -bool(false) - Warning: transliterator_transliterate(): String conversion of string to UTF-16 failed in %s on line %d Done. diff --git a/ext/intl/tests/uconverter_getAvailable_wrongparam_001.phpt b/ext/intl/tests/uconverter_getAvailable_wrongparam_001.phpt deleted file mode 100644 index 4e381289b32b2..0000000000000 --- a/ext/intl/tests/uconverter_getAvailable_wrongparam_001.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Check the function UConverter::getAvailable with parameter wrong ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: UConverter::getAvailable() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 3f91db3130da2..e70c9b41951ea 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -55,8 +55,6 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone) intl_error_reset(NULL); if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_time_zone: bad arguments", 0); RETURN_NULL(); } @@ -82,8 +80,6 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone) if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zv_timezone, php_date_get_timezone_ce()) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_from_date_time_zone: bad arguments", 0); RETURN_NULL(); } @@ -109,8 +105,6 @@ U_CFUNC PHP_FUNCTION(intltz_create_default) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_default: bad arguments", 0); RETURN_NULL(); } @@ -123,8 +117,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_gmt) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_gmt: bad arguments", 0); RETURN_NULL(); } @@ -136,8 +128,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_unknown) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_unknown: bad arguments", 0); RETURN_NULL(); } @@ -153,8 +143,6 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration) /* double indirection to have the zend engine destroy the new zval that * results from separation */ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_enumeration: bad arguments", 0); RETURN_FALSE; } @@ -213,8 +201,6 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids) if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_count_equivalent_ids: bad arguments", 0); RETURN_FALSE; } @@ -244,8 +230,6 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l!", &zoneType, ®ion, ®ion_len, &offset_arg, &arg3isnull) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_create_time_zone_id_enumeration: bad arguments", 0); RETURN_FALSE; } @@ -285,8 +269,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id) if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &str_id, &str_id_len, &is_systemid) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_canonical_id: bad arguments", 0); RETURN_FALSE; } @@ -324,8 +306,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_region) if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str_id, &str_id_len) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_region: bad arguments", 0); RETURN_FALSE; } @@ -348,8 +328,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version) intl_error_reset(NULL); if (zend_parse_parameters_none() == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_tz_data_version: bad arguments", 0); RETURN_FALSE; } @@ -371,8 +349,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id) if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &str_id, &str_id_len, &index) == FAILURE || index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_equivalent_id: bad arguments", 0); RETURN_FALSE; } @@ -399,8 +375,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_id) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_id: bad arguments", 0); RETURN_FALSE; } @@ -424,8 +398,6 @@ U_CFUNC PHP_FUNCTION(intltz_use_daylight_time) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_use_daylight_time: bad arguments", 0); RETURN_FALSE; } @@ -447,8 +419,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_offset) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Odbz/z/", &object, TimeZone_ce_ptr, &date, &local, &rawOffsetArg, &dstOffsetArg) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_offset: bad arguments", 0); RETURN_FALSE; } @@ -473,8 +443,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_raw_offset) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_raw_offset: bad arguments", 0); RETURN_FALSE; } @@ -492,8 +460,6 @@ U_CFUNC PHP_FUNCTION(intltz_has_same_rules) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, TimeZone_ce_ptr, &other_object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_has_same_rules: bad arguments", 0); RETURN_FALSE; } TIMEZONE_METHOD_FETCH_OBJECT; @@ -525,8 +491,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|bls!", &object, TimeZone_ce_ptr, &daylight, &display_type, &locale_str, &dummy) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_display_name: bad arguments", 0); RETURN_FALSE; } @@ -564,8 +528,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_dst_savings: bad arguments", 0); RETURN_FALSE; } @@ -581,8 +543,6 @@ U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_to_date_time_zone: bad arguments", 0); RETURN_FALSE; } @@ -604,8 +564,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_code) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_error_code: bad arguments", 0); RETURN_FALSE; } @@ -624,8 +582,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, TimeZone_ce_ptr) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "intltz_get_error_message: bad arguments", 0 ); RETURN_FALSE; } diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c index 25d0b9a4dae21..fb438e2362eff 100644 --- a/ext/intl/transliterator/transliterator_methods.c +++ b/ext/intl/transliterator/transliterator_methods.c @@ -115,8 +115,6 @@ PHP_FUNCTION( transliterator_create ) if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l", &str_id, &str_id_len, &direction ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create: bad arguments", 0 ); RETURN_NULL(); } @@ -149,8 +147,6 @@ PHP_FUNCTION( transliterator_create_from_rules ) if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l", &str_rules, &str_rules_len, &direction ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create_from_rules: bad arguments", 0 ); RETURN_NULL(); } @@ -214,8 +210,6 @@ PHP_FUNCTION( transliterator_create_inverse ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Transliterator_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_create_inverse: bad arguments", 0 ); RETURN_NULL(); } @@ -250,12 +244,7 @@ PHP_FUNCTION( transliterator_list_ids ) if( zend_parse_parameters_none() == FAILURE ) { - /* seems to be the convention in this lib to return false instead of - * null on bad parameter types, except on constructors and factory - * methods */ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_list_ids: bad arguments", 0 ); - RETURN_FALSE; + return; } en = utrans_openIDs( &status ); @@ -317,8 +306,6 @@ PHP_FUNCTION( transliterator_transliterate ) if( zend_parse_parameters( ZEND_NUM_ARGS(), "zs|ll", &arg1, &str, &str_len, &start, &limit ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_transliterate: bad arguments", 0 ); RETURN_FALSE; } @@ -352,8 +339,6 @@ PHP_FUNCTION( transliterator_transliterate ) else if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|ll", &str, &str_len, &start, &limit ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_transliterate: bad arguments", 0 ); RETURN_FALSE; } @@ -480,9 +465,6 @@ PHP_FUNCTION( transliterator_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Transliterator_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_get_error_code: unable to parse input params", 0 ); - RETURN_FALSE; } @@ -508,9 +490,6 @@ PHP_FUNCTION( transliterator_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, Transliterator_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "transliterator_get_error_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/json/tests/001.phpt b/ext/json/tests/001.phpt index e908b44349f6a..63a303998accc 100644 --- a/ext/json/tests/001.phpt +++ b/ext/json/tests/001.phpt @@ -5,7 +5,6 @@ json_decode() tests --FILE-- ===DONE=== --EXPECTF-- -Warning: json_decode() expects at least 1 parameter, 0 given in %s on line %d -NULL NULL NULL NULL diff --git a/ext/json/tests/json_decode_error.phpt b/ext/json/tests/json_decode_error.phpt index 9906a2b0d4d90..4089a7897f578 100644 --- a/ext/json/tests/json_decode_error.phpt +++ b/ext/json/tests/json_decode_error.phpt @@ -6,13 +6,6 @@ Test json_decode() function : error conditions getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- int(0) - -Warning: json_last_error() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: json_last_error() expects exactly 0 parameters, 4 given in %s on line %d -NULL +json_last_error() expects exactly 0 parameters, 1 given diff --git a/ext/json/tests/json_last_error_msg_error.phpt b/ext/json/tests/json_last_error_msg_error.phpt index 719e9fc50c969..75b06f72a2db0 100644 --- a/ext/json/tests/json_last_error_msg_error.phpt +++ b/ext/json/tests/json_last_error_msg_error.phpt @@ -6,15 +6,14 @@ json_last_error_msg() failures getMessage(), "\n"; +} ?> --EXPECTF-- string(8) "No error" - -Warning: json_last_error_msg() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: json_last_error_msg() expects exactly 0 parameters, 4 given in %s on line %d -NULL +json_last_error_msg() expects exactly 0 parameters, 1 given diff --git a/ext/libxml/tests/001.phpt b/ext/libxml/tests/001.phpt index b636ab7adc973..7914ef509b0ad 100644 --- a/ext/libxml/tests/001.phpt +++ b/ext/libxml/tests/001.phpt @@ -8,7 +8,6 @@ libxml_use_internal_errors() var_dump(libxml_use_internal_errors(false)); var_dump(libxml_use_internal_errors(true)); var_dump(libxml_use_internal_errors()); -var_dump(libxml_use_internal_errors(new stdclass)); var_dump(libxml_get_errors()); var_dump(libxml_get_last_error()); @@ -17,13 +16,10 @@ var_dump(libxml_clear_errors()); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- bool(false) bool(false) bool(true) - -Warning: libxml_use_internal_errors() expects parameter 1 to be bool, object given in %s001.php on line 6 -NULL array(0) { } bool(false) diff --git a/ext/libxml/tests/004.phpt b/ext/libxml/tests/004.phpt index 9d5121089d048..9338bc90d417d 100644 --- a/ext/libxml/tests/004.phpt +++ b/ext/libxml/tests/004.phpt @@ -18,7 +18,11 @@ $ctxs = array( foreach ($ctxs as $ctx) { - var_dump(libxml_set_streams_context($ctx)); + try { + var_dump(libxml_set_streams_context($ctx)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $dom = new DOMDocument(); var_dump($dom->load(dirname(__FILE__).'/test.xml')); } @@ -28,25 +32,15 @@ echo "Done\n"; ?> --EXPECTF-- Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line %d - -Warning: libxml_set_streams_context() expects parameter 1 to be resource, null given in %s004.php on line %d -NULL +libxml_set_streams_context() expects parameter 1 to be resource, null given bool(true) - -Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %s004.php on line %d -NULL +libxml_set_streams_context() expects parameter 1 to be resource, string given bool(true) - -Warning: libxml_set_streams_context() expects parameter 1 to be resource, int given in %s004.php on line %d -NULL +libxml_set_streams_context() expects parameter 1 to be resource, int given bool(true) - -Warning: libxml_set_streams_context() expects parameter 1 to be resource, object given in %s004.php on line %d -NULL +libxml_set_streams_context() expects parameter 1 to be resource, object given bool(true) - -Warning: libxml_set_streams_context() expects parameter 1 to be resource, array given in %s004.php on line %d -NULL +libxml_set_streams_context() expects parameter 1 to be resource, array given bool(true) NULL bool(true) diff --git a/ext/libxml/tests/bug63389.phpt b/ext/libxml/tests/bug63389.phpt index e9498aae083c9..df7af1b2b68c1 100644 --- a/ext/libxml/tests/bug63389.phpt +++ b/ext/libxml/tests/bug63389.phpt @@ -6,9 +6,13 @@ Bug #63389 (Missing context check on libxml_set_streams_context() causes memleak getMessage(), "\n"; +} echo "okey"; ?> ---EXPECTF-- -Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %sbug63389.php on line %d +--EXPECT-- +libxml_set_streams_context() expects parameter 1 to be resource, string given okey diff --git a/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt b/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt index 40b31ea85d329..9a6826ca543a5 100644 --- a/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt +++ b/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt @@ -12,10 +12,6 @@ XML; $dd = new DOMDocument; $r = $dd->loadXML($xml); -var_dump(libxml_set_external_entity_loader([])); -var_dump(libxml_set_external_entity_loader()); -var_dump(libxml_set_external_entity_loader(function() {}, 2)); - var_dump(libxml_set_external_entity_loader(function($a, $b, $c, $d) {})); try { var_dump($dd->validate()); @@ -25,14 +21,6 @@ try { echo "Done.\n"; --EXPECTF-- -Warning: libxml_set_external_entity_loader() expects parameter 1 to be a valid callback, array must have exactly two members in %s on line %d -NULL - -Warning: libxml_set_external_entity_loader() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: libxml_set_external_entity_loader() expects exactly 1 parameter, 2 given in %s on line %d -NULL bool(true) Warning: DOMDocument::validate(): Could not load the external subset "http://example.com/foobar" in %s on line %d diff --git a/ext/mbstring/tests/mb_convert_encoding.phpt b/ext/mbstring/tests/mb_convert_encoding.phpt index f2fda35124b91..ac5d0d32a6e00 100644 --- a/ext/mbstring/tests/mb_convert_encoding.phpt +++ b/ext/mbstring/tests/mb_convert_encoding.phpt @@ -99,11 +99,6 @@ $s = $euc_jp; $s = mb_convert_encoding($s, 'BAD'); print("BAD: $s\n"); // BAD -$s = $euc_jp; -$s = mb_convert_encoding($s); -print("MP: $s\n"); // Missing parameter - - ?> --EXPECTF-- == BASIC TEST == @@ -129,6 +124,3 @@ EUC-JP: Warning: mb_convert_encoding(): Unknown encoding "BAD" in %s on line %d BAD: - -Warning: mb_convert_encoding() expects at least 2 parameters, 1 given in %s on line %d -MP: diff --git a/ext/mbstring/tests/mb_detect_encoding.phpt b/ext/mbstring/tests/mb_detect_encoding.phpt index 0c8015d86dc07..9a8f51281b3f5 100644 --- a/ext/mbstring/tests/mb_detect_encoding.phpt +++ b/ext/mbstring/tests/mb_detect_encoding.phpt @@ -87,11 +87,6 @@ $s = $euc_jp; $s = mb_detect_encoding($s, 'BAD'); print("BAD: $s\n"); // BAD -$s = $euc_jp; -$s = mb_detect_encoding(); -print("MP: $s\n"); // Missing parameter - - ?> --EXPECTF-- == BASIC TEST == @@ -113,6 +108,3 @@ EUC-JP: EUC-JP Warning: mb_detect_encoding(): Illegal argument in %s on line %d BAD: EUC-JP - -Warning: mb_detect_encoding() expects at least 1 parameter, 0 given in %s on line %d -MP: diff --git a/ext/mbstring/tests/mb_encoding_aliases.phpt b/ext/mbstring/tests/mb_encoding_aliases.phpt index 8bc0453350fd7..798bdeb5ca4df 100644 --- a/ext/mbstring/tests/mb_encoding_aliases.phpt +++ b/ext/mbstring/tests/mb_encoding_aliases.phpt @@ -4,7 +4,6 @@ mb_encoding_aliases() --FILE-- --EXPECTF-- -Warning: mb_encoding_aliases() expects exactly 1 parameter, 0 given in %s on line 2 array(11) { [0]=> string(14) "ANSI_X3.4-1968" diff --git a/ext/mbstring/tests/mb_ereg1.phpt b/ext/mbstring/tests/mb_ereg1.phpt index 85db1d1c98a36..05b348654506d 100644 --- a/ext/mbstring/tests/mb_ereg1.phpt +++ b/ext/mbstring/tests/mb_ereg1.phpt @@ -14,7 +14,11 @@ $a = array( ); foreach ($a as $args) { - var_dump(mb_ereg($args[0], $args[1], $args[2])); + try { + var_dump(mb_ereg($args[0], $args[1], $args[2])); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } var_dump($args); } ?> @@ -42,9 +46,7 @@ array(3) { array(0) { } } - -Warning: mb_ereg() expects parameter 1 to be string, array given in %s on line %d -bool(false) +mb_ereg() expects parameter 1 to be string, array given array(3) { [0]=> array(0) { @@ -52,11 +54,9 @@ array(3) { [1]=> int(1) [2]=> - string(0) "" + &string(0) "" } - -Warning: mb_ereg() expects parameter 2 to be string, array given in %s on line %d -bool(false) +mb_ereg() expects parameter 2 to be string, array given array(3) { [0]=> int(1) @@ -64,7 +64,7 @@ array(3) { array(0) { } [2]=> - string(0) "" + &string(0) "" } bool(false) array(3) { diff --git a/ext/mbstring/tests/mb_ereg2.phpt b/ext/mbstring/tests/mb_ereg2.phpt index 30e857eed70b1..22e3cd36c5a3e 100644 --- a/ext/mbstring/tests/mb_ereg2.phpt +++ b/ext/mbstring/tests/mb_ereg2.phpt @@ -15,12 +15,9 @@ var_dump($a, $b, $c); mb_eregi($a, $b, $c); var_dump($a, $b, $c); -mb_ereg_search_init($a, $b, $c); -var_dump($a, $b, $c); - echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- int(-1) int(-1) array(1) { @@ -33,12 +30,4 @@ array(1) { [0]=> string(2) "-1" } - -Warning: mb_ereg_search_init() expects parameter 3 to be string, array given in %s on line %d -int(-1) -int(-1) -array(1) { - [0]=> - string(2) "-1" -} Done diff --git a/ext/mbstring/tests/mb_ereg_variation1.phpt b/ext/mbstring/tests/mb_ereg_variation1.phpt deleted file mode 100644 index 2ee33c9e803bd..0000000000000 --- a/ext/mbstring/tests/mb_ereg_variation1.phpt +++ /dev/null @@ -1,179 +0,0 @@ ---TEST-- -Test mb_ereg() function : usage variations - pass different data types to $pattern argument ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -*** Testing mb_ereg() : usage variations *** - --- Iteration 1 -- -bool(false) -array(0) { -} - --- Iteration 2 -- -bool(false) -array(0) { -} - --- Iteration 3 -- -bool(false) -array(0) { -} - --- Iteration 4 -- -bool(false) -array(0) { -} - --- Iteration 5 -- -bool(false) -array(0) { -} - --- Iteration 6 -- -bool(false) -array(0) { -} - --- Iteration 7 -- -bool(false) -array(0) { -} - --- Iteration 8 -- -bool(false) -array(0) { -} - --- Iteration 9 -- -bool(false) -array(0) { -} - --- Iteration 10 -- -bool(false) -array(0) { -} - --- Iteration 11 -- -bool(false) -array(0) { -} - --- Iteration 12 -- -int(6) -array(1) { - [0]=> - string(6) "string" -} - --- Iteration 13 -- -int(6) -array(1) { - [0]=> - string(6) "string" -} - --- Iteration 14 -- -bool(false) -array(0) { -} - --- Iteration 15 -- -bool(false) -array(0) { -} - --- Iteration 16 -- - -Warning: mb_ereg() expects parameter 1 to be string, resource given in %s on line %d -bool(false) -NULL -Done diff --git a/ext/mbstring/tests/mb_http_output.phpt b/ext/mbstring/tests/mb_http_output.phpt index 71af8b094d07b..c3dab5e35f180 100644 --- a/ext/mbstring/tests/mb_http_output.phpt +++ b/ext/mbstring/tests/mb_http_output.phpt @@ -47,16 +47,6 @@ $r = mb_http_output('BAD_NAME'); $enc = mb_http_output(); print "$enc\n"; -$r = mb_http_output($t_ary); -($r === NULL) ? print "OK_BAD_ARY_SET\n" : print "NG_BAD_ARY_SET\n"; -$enc = mb_http_output(); -print "$enc\n"; - -$r = mb_http_output($t_obj); -($r === NULL) ? print "OK_BAD_OBJ_SET\n" : print "NG_BAD_OBJ_SET\n"; -$enc = mb_http_output(); -print "$enc\n"; - ?> --EXPECTF-- OK_ASCII_SET @@ -74,11 +64,3 @@ EUC-JP Warning: mb_http_output(): Unknown encoding "BAD_NAME" in %s on line %d OK_BAD_SET EUC-JP - -Warning: mb_http_output() expects parameter 1 to be string, array given in %s on line %d -OK_BAD_ARY_SET -EUC-JP - -Warning: mb_http_output() expects parameter 1 to be string, object given in %s on line %d -OK_BAD_OBJ_SET -EUC-JP diff --git a/ext/mbstring/tests/mb_internal_encoding.phpt b/ext/mbstring/tests/mb_internal_encoding.phpt index 8b332b0594a98..22fe919cbc4c4 100644 --- a/ext/mbstring/tests/mb_internal_encoding.phpt +++ b/ext/mbstring/tests/mb_internal_encoding.phpt @@ -35,16 +35,6 @@ $r = mb_internal_encoding('BAD'); $enc = mb_internal_encoding(); print "$enc\n"; -$r = mb_internal_encoding($t_ary); -($r === NULL) ? print "OK_BAD_ARY_SET\n" : print "NG_BAD_ARY_SET\n"; -$enc = mb_internal_encoding(); -print "$enc\n"; - -$r = mb_internal_encoding($t_obj); -($r === NULL) ? print "OK_BAD_OBJ_SET\n" : print "NG_BAD_OBJ_SET\n"; -$enc = mb_internal_encoding(); -print "$enc\n"; - ?> --EXPECTF-- OK_EUC-JP_SET @@ -58,11 +48,3 @@ ASCII Warning: mb_internal_encoding(): Unknown encoding "BAD" in %s on line %d OK_BAD_SET ASCII - -Warning: mb_internal_encoding() expects parameter 1 to be string, array given in %s on line %d -OK_BAD_ARY_SET -ASCII - -Warning: mb_internal_encoding() expects parameter 1 to be string, object given in %s on line %d -OK_BAD_OBJ_SET -ASCII diff --git a/ext/mbstring/tests/mb_stripos.phpt b/ext/mbstring/tests/mb_stripos.phpt index 9da6456992a45..067c3f282633e 100644 --- a/ext/mbstring/tests/mb_stripos.phpt +++ b/ext/mbstring/tests/mb_stripos.phpt @@ -125,18 +125,6 @@ $r = mb_stripos($euc_jp, ' $r = mb_stripos($euc_jp, "\n"); ($r === FALSE) ? print "OK_NEWLINE\n" : print "NG_NEWLINE\n"; - -// Invalid Parameters -echo "== INVALID PARAMETER TEST ==\n"; - -$r = mb_stripos($euc_jp,'','EUC-JP'); -($r === NULL) ? print("OK_NULL\n") : print("NG_NULL\n"); -$r = mb_stripos($euc_jp, $t_ary, 'EUC-JP'); -($r === NULL) ? print("OK_ARRAY\n") : print("NG_ARRAY\n"); -$r = mb_stripos($euc_jp, $t_obj, 'EUC-JP'); -($r === NULL) ? print("OK_OBJECT\n") : print("NG_OBJECT\n"); -$r = mb_stripos($euc_jp, $t_obj, 'BAD_ENCODING'); -($r === NULL) ? print("OK_BAD_ENCODING\n") : print("NG_BAD_ENCODING\n"); ?> ==DONE== --EXPECTF-- @@ -213,17 +201,4 @@ OK_NEWLINE 0 OK_STR OK_NEWLINE -== INVALID PARAMETER TEST == - -Warning: mb_stripos() expects parameter 3 to be int, string given in %s on line %d -OK_NULL - -Warning: mb_stripos() expects parameter 2 to be string, array given in %s on line %d -OK_ARRAY - -Warning: mb_stripos() expects parameter 2 to be string, object given in %s on line %d -OK_OBJECT - -Warning: mb_stripos() expects parameter 2 to be string, object given in %s on line %d -OK_BAD_ENCODING ==DONE== diff --git a/ext/mbstring/tests/mb_strlen.phpt b/ext/mbstring/tests/mb_strlen.phpt index 3ea9ae12e6dfd..2decf18fca6e7 100644 --- a/ext/mbstring/tests/mb_strlen.phpt +++ b/ext/mbstring/tests/mb_strlen.phpt @@ -53,14 +53,6 @@ print strlen($utf8) . "\n"; // Wrong Parameters echo "== WRONG PARAMETERS ==\n"; -// Array -// Note: PHP Warning, strlen() expects parameter 1 to be string, array given -$r = strlen($t_ary); -echo $r."\n"; -// Object -// Note: PHP Warning, strlen() expects parameter 1 to be string, object given -$r = strlen($t_obj); -echo $r."\n"; // Wrong encoding mb_internal_encoding('EUC-JP'); $r = mb_strlen($euc_jp, 'BAD_NAME'); @@ -86,10 +78,4 @@ echo $r."\n"; 101 == WRONG PARAMETERS == -Warning: strlen() expects parameter 1 to be string, array given in %s on line %d - - -Warning: strlen() expects parameter 1 to be string, object given in %s on line %d - - Warning: mb_strlen(): Unknown encoding "BAD_NAME" in %s on line %d diff --git a/ext/mbstring/tests/mb_strpos.phpt b/ext/mbstring/tests/mb_strpos.phpt index 9bca0ba3906ad..c86b77e7de609 100644 --- a/ext/mbstring/tests/mb_strpos.phpt +++ b/ext/mbstring/tests/mb_strpos.phpt @@ -125,18 +125,6 @@ $r = mb_strpos($euc_jp, ' $r = mb_strpos($euc_jp, "\n"); ($r === FALSE) ? print "OK_NEWLINE\n" : print "NG_NEWLINE\n"; - -// Invalid Parameters -echo "== INVALID PARAMETER TEST ==\n"; - -$r = mb_strpos($euc_jp,'','EUC-JP'); -($r === NULL) ? print("OK_NULL\n") : print("NG_NULL\n"); -$r = mb_strpos($euc_jp, $t_ary, 'EUC-JP'); -($r === NULL) ? print("OK_ARRAY\n") : print("NG_ARRAY\n"); -$r = mb_strpos($euc_jp, $t_obj, 'EUC-JP'); -($r === NULL) ? print("OK_OBJECT\n") : print("NG_OBJECT\n"); -$r = mb_strpos($euc_jp, $t_obj, 'BAD_ENCODING'); -($r === NULL) ? print("OK_BAD_ENCODING\n") : print("NG_BAD_ENCODING\n"); ?> ==DONE== --EXPECTF-- @@ -213,17 +201,4 @@ OK_NEWLINE 0 OK_STR OK_NEWLINE -== INVALID PARAMETER TEST == - -Warning: mb_strpos() expects parameter 3 to be int, string given in %s on line %d -OK_NULL - -Warning: mb_strpos() expects parameter 2 to be string, array given in %s on line %d -OK_ARRAY - -Warning: mb_strpos() expects parameter 2 to be string, object given in %s on line %d -OK_OBJECT - -Warning: mb_strpos() expects parameter 2 to be string, object given in %s on line %d -OK_BAD_ENCODING ==DONE== diff --git a/ext/mysqli/tests/057.phpt b/ext/mysqli/tests/057.phpt index dab3dfa78dc3b..e0dd351d4cc8f 100644 --- a/ext/mysqli/tests/057.phpt +++ b/ext/mysqli/tests/057.phpt @@ -40,7 +40,6 @@ require_once('skipifconnectfailure.inc'); var_dump(mysqli_stmt_execute($stmt)); var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link)); - var_dump(mysqli_stmt_reset($stmt)); $stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"); mysqli_stmt_execute($stmt); @@ -102,9 +101,6 @@ object(mysqli_stmt)#%d (%d) { bool(true) bool(false) string(0) "" - -Warning: mysqli_stmt_reset() expects parameter 1 to be mysqli_stmt, bool given in %s on line %d -NULL Rows: 3 array(1) { [0]=> diff --git a/ext/mysqli/tests/mysqli_affected_rows.phpt b/ext/mysqli/tests/mysqli_affected_rows.phpt index 95c3bb342633a..81a7f5b6deef8 100644 --- a/ext/mysqli/tests/mysqli_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows.phpt @@ -10,18 +10,6 @@ mysqli_affected_rows() --EXPECT-- diff --git a/ext/mysqli/tests/mysqli_character_set_name_oo.phpt b/ext/mysqli/tests/mysqli_character_set_name_oo.phpt index 5d303fd503dda..4b760ec5bb638 100644 --- a/ext/mysqli/tests/mysqli_character_set_name_oo.phpt +++ b/ext/mysqli/tests/mysqli_character_set_name_oo.phpt @@ -18,9 +18,6 @@ mysqli_chararcter_set_name(), mysql_client_encoding() [alias] printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket); - if (!is_null($tmp = @$mysqli->character_set_name($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (!$res = $mysqli->query('SELECT version() AS server_version')) printf("[003] [%d] %s\n", $mysqli->errno, $mysqli->error); $tmp = $res->fetch_assoc(); diff --git a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt index 7367a5cd7c1f5..b8ab4a4af535d 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt @@ -128,9 +128,6 @@ require_once('skipifconnectfailure.inc'); if (!is_object($res = new mysqli_result($link, MYSQLI_USE_RESULT))) printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (!is_object($res = new mysqli_result($link, 'invalid'))) - printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - $valid = array(MYSQLI_STORE_RESULT, MYSQLI_USE_RESULT); do { $mode = mt_rand(-1000, 1000); @@ -146,12 +143,6 @@ require_once('skipifconnectfailure.inc'); printf("[009] Expecting warning because of invalid resultmode\n"); } - if (!is_object($res = new mysqli_result('foo'))) - printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - if (!is_object($res = @new mysqli_result($link, MYSQLI_STORE_RESULT, 1))) - printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - print "done!"; ?> --EXPECTF-- @@ -186,8 +177,4 @@ Access to undefined properties: mysqli_result->unknown = '' Constructor: - -Warning: mysqli_result::__construct() expects parameter 2 to be int, string given in %s on line %d - -Warning: mysqli_result::__construct() expects parameter 1 to be mysqli, string given in %s on line %d done! diff --git a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt index 8fc4583a4c9c1..3e3301361dc9c 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt @@ -123,16 +123,6 @@ printf("stmt->unknown = '%s'\n", @$stmt->unknown); @$stmt->unknown = 13; printf("stmt->unknown = '%s'\n", @$stmt->unknown); -printf("\nPrepare using the constructor:\n"); -$stmt = new mysqli_stmt($link, 'SELECT id FROM test ORDER BY id'); -if (!$stmt->execute()) -printf("[002] [%d] %s\n", $stmt->errno, $stmt->error); -$stmt->close(); - -$obj = new stdClass(); -if (!is_object($stmt = new mysqli_stmt($link, $obj))) -printf("[003] Expecting NULL got %s/%s\n", gettype($stmt), $stmt); - print "done!"; ?> --EXPECTF-- @@ -191,8 +181,4 @@ stmt->sqlstate = '00000' Access to undefined properties: stmt->unknown = '' stmt->unknown = '13' - -Prepare using the constructor: - -Warning: mysqli_stmt::__construct() expects parameter 2 to be string, object given in %s on line %d done! diff --git a/ext/mysqli/tests/mysqli_close.phpt b/ext/mysqli/tests/mysqli_close.phpt index a300fb8314900..0110847334c77 100644 --- a/ext/mysqli/tests/mysqli_close.phpt +++ b/ext/mysqli/tests/mysqli_close.phpt @@ -10,23 +10,10 @@ require_once('skipifconnectfailure.inc'); close($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - $tmp = $mysqli->close(); if (true !== $tmp) printf("[003] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); diff --git a/ext/mysqli/tests/mysqli_commit.phpt b/ext/mysqli/tests/mysqli_commit.phpt index 27ae3a928a530..73a9cdf25dd0d 100644 --- a/ext/mysqli/tests/mysqli_commit.phpt +++ b/ext/mysqli/tests/mysqli_commit.phpt @@ -17,18 +17,6 @@ if (!have_innodb($link)) query('SELECT * FROM test ORDER BY id LIMIT 4', MYSQLI_STORE_RESULT)) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (NULL !== ($tmp = @$res->data_seek())) - printf("[004] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (NULL !== ($tmp = @$res->data_seek($link))) - printf("[005] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (NULL !== ($tmp = @$res->data_seek($link, $link))) - printf("[006] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp); - if (true !== ($tmp = $res->data_seek(3))) printf("[007] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); diff --git a/ext/mysqli/tests/mysqli_debug.phpt b/ext/mysqli/tests/mysqli_debug.phpt index aa455d7f6ec37..478dcf7d08097 100644 --- a/ext/mysqli/tests/mysqli_debug.phpt +++ b/ext/mysqli/tests/mysqli_debug.phpt @@ -19,9 +19,6 @@ if (defined('MYSQLI_DEBUG_TRACE_ENABLED') && !MYSQLI_DEBUG_TRACE_ENABLED) dump_debug_info($link))) - printf("[002] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp); - if (!is_bool($tmp = $mysqli->dump_debug_info())) printf("[003] Expecting boolean/[true|false] value, got %s/%s, [%d] %s\n", gettype($tmp), $tmp, diff --git a/ext/mysqli/tests/mysqli_errno.phpt b/ext/mysqli/tests/mysqli_errno.phpt index 0a9c2453410a9..f26a30e089dd7 100644 --- a/ext/mysqli/tests/mysqli_errno.phpt +++ b/ext/mysqli/tests/mysqli_errno.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); fetch_assoc($link))) - printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (!$res = $mysqli->query("SELECT id, label FROM test ORDER BY id LIMIT 1")) { printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error); } diff --git a/ext/mysqli/tests/mysqli_fetch_field.phpt b/ext/mysqli/tests/mysqli_fetch_field.phpt index 684795a48ef63..5035cf70d2c2b 100644 --- a/ext/mysqli/tests/mysqli_fetch_field.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field.phpt @@ -10,15 +10,7 @@ require_once('skipifconnectfailure.inc'); fetch_field_direct())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); require('table.inc'); @@ -28,15 +23,6 @@ require_once('skipifconnectfailure.inc'); printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); } - if (!is_null($tmp = @$res->fetch_field_direct())) - printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @$res->fetch_field_direct($link))) - printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @$res->fetch_field_direct($link, $link))) - printf("[006] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - var_dump($res->fetch_field_direct(-1)); var_dump($res->fetch_field_direct(0)); var_dump($res->fetch_field_direct(2)); diff --git a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt index 2293c9581a8f5..35fdbb050e5a2 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_oo.phpt @@ -10,23 +10,15 @@ require_once('skipifconnectfailure.inc'); fetch_field())) - printf("[001] Expecting false, got %s/%s\n", gettype($tmp), $tmp); require('table.inc'); if (!$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket)) printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket); - if (!is_null($tmp = @$res->fetch_field($link))) - printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - // Make sure that client, connection and result charsets are all the // same. Not sure whether this is strictly necessary. if (!$mysqli->set_charset('utf8')) diff --git a/ext/mysqli/tests/mysqli_fetch_fields.phpt b/ext/mysqli/tests/mysqli_fetch_fields.phpt index c79555c3a15d4..6dee8108f9047 100644 --- a/ext/mysqli/tests/mysqli_fetch_fields.phpt +++ b/ext/mysqli/tests/mysqli_fetch_fields.phpt @@ -10,15 +10,7 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- -[E_WARNING] mysqli_fetch_object() expects at least 1 parameter, 0 given in %s on line %d -[E_WARNING] mysqli_fetch_object() expects parameter 1 to be mysqli_result, null given in %s on line %d Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 0 passed and exactly 2 expected Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected NULL diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index d8c8cc70fdb6b..2688f050fac49 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -11,9 +11,6 @@ require_once('skipifconnectfailure.inc'); require_once("connect.inc"); set_error_handler('handle_catchable_fatal'); - $tmp = NULL; - $link = NULL; - $mysqli = new mysqli(); $res = @new mysqli_result($mysqli); if (false !== ($tmp = @$res->fetch_object())) @@ -28,9 +25,6 @@ require_once('skipifconnectfailure.inc'); printf("[003] [%d] %s\n", $mysqli->errno, $mysqli->error); } - if (!is_null($tmp = @$res->fetch_object($link))) - printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - try { if (!is_null($tmp = @$res->fetch_object($link, $link))) printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); @@ -132,7 +126,6 @@ require_once('skipifconnectfailure.inc'); [E_WARNING] mysqli_result::__construct(): invalid object or resource mysql%s %s on line %d [E_WARNING] mysqli_result::fetch_object(): Couldn't fetch mysqli_result in %s on line %d -[E_WARNING] mysqli_result::fetch_object() expects parameter 1 to be string, object given in %s on line %d [0] Argument 2 passed to mysqli_result::fetch_object() must be of the type array, object given in %s on line %d [0] Argument 2 passed to mysqli_result::fetch_object() must be of the type array, object given in %s on line %d [0] Argument 2 passed to mysqli_result::fetch_object() must be of the type array, null given in %s on line %d diff --git a/ext/mysqli/tests/mysqli_fetch_row.phpt b/ext/mysqli/tests/mysqli_fetch_row.phpt index 7ca1b9a132caa..c16ca1da77684 100644 --- a/ext/mysqli/tests/mysqli_fetch_row.phpt +++ b/ext/mysqli/tests/mysqli_fetch_row.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); diff --git a/ext/mysqli/tests/mysqli_field_tell.phpt b/ext/mysqli/tests/mysqli_field_tell.phpt index 9885c1d9d8692..0b1d3bd0c1da4 100644 --- a/ext/mysqli/tests/mysqli_field_tell.phpt +++ b/ext/mysqli/tests/mysqli_field_tell.phpt @@ -10,31 +10,17 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- int(0) - -Warning: mysqli_field_seek() expects exactly 2 parameters, 1 given in %s on line %d -NULL int(0) object(stdClass)#%d (13) { ["name"]=> diff --git a/ext/mysqli/tests/mysqli_free_result.phpt b/ext/mysqli/tests/mysqli_free_result.phpt index 6cd7778319fde..be377a88175d2 100644 --- a/ext/mysqli/tests/mysqli_free_result.phpt +++ b/ext/mysqli/tests/mysqli_free_result.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); --FILE-- --EXPECT-- diff --git a/ext/mysqli/tests/mysqli_get_server_info.phpt b/ext/mysqli/tests/mysqli_get_server_info.phpt index 3ea1b4a70d34d..25278528a6057 100644 --- a/ext/mysqli/tests/mysqli_get_server_info.phpt +++ b/ext/mysqli/tests/mysqli_get_server_info.phpt @@ -10,19 +10,10 @@ require_once('skipifconnectfailure.inc'); --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_get_server_version.phpt b/ext/mysqli/tests/mysqli_get_server_version.phpt index ddbf4e73bb622..6589e335b4695 100644 --- a/ext/mysqli/tests/mysqli_get_server_version.phpt +++ b/ext/mysqli/tests/mysqli_get_server_version.phpt @@ -10,12 +10,6 @@ require_once('skipifconnectfailure.inc'); 50105 -- major_version*10000 + minor_version *100 + sub_version */ /* < 30000 = pre 3.2.3, very unlikely! */ diff --git a/ext/mysqli/tests/mysqli_info.phpt b/ext/mysqli/tests/mysqli_info.phpt index 56ee2cce05135..b3a090b6e81ee 100644 --- a/ext/mysqli/tests/mysqli_info.phpt +++ b/ext/mysqli/tests/mysqli_info.phpt @@ -12,12 +12,6 @@ mysqli.allow_local_infile=1 @@ -53,24 +45,4 @@ Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d - -Warning: mysqli_query() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_close() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_query() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_close() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_query() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_close() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_query() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_close() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_query() expects parameter 1 to be mysqli, bool given in %s on line %d - -Warning: mysqli_close() expects parameter 1 to be mysqli, bool given in %s on line %d done! diff --git a/ext/mysqli/tests/mysqli_more_results.phpt b/ext/mysqli/tests/mysqli_more_results.phpt index 4ce6a19c79284..50a09c0fef03c 100644 --- a/ext/mysqli/tests/mysqli_more_results.phpt +++ b/ext/mysqli/tests/mysqli_more_results.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- -Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in %s on line %d - -Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, bool given in %s on line %d - Warning: mysqli_num_rows(): Couldn't fetch mysqli_result in %s on line %d run_tests.php don't fool me with your 'ungreedy' expression '.+?'! diff --git a/ext/mysqli/tests/mysqli_options.phpt b/ext/mysqli/tests/mysqli_options.phpt index 6d5247943b21e..13590bf5a9571 100644 --- a/ext/mysqli/tests/mysqli_options.phpt +++ b/ext/mysqli/tests/mysqli_options.phpt @@ -27,30 +27,12 @@ require_once('skipifconnectfailure.inc'); if ($IS_MYSQLND && defined('MYSQLI_OPT_INT_AND_FLOAT_NATIVE')) $valid_options[] = constant('MYSQLI_OPT_INT_AND_FLOAT_NATIVE'); - $tmp = NULL; - $link = NULL; - - if (!is_null($tmp = @mysqli_options())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_options($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - $link = mysqli_init(); /* set it twice, checking if memory for the previous one is correctly freed */ mysqli_options($link, MYSQLI_SET_CHARSET_NAME, "utf8"); mysqli_options($link, MYSQLI_SET_CHARSET_NAME, "latin1"); - if (!is_null($tmp = @mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT))) - printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_options($link, "s", 'extra_my.cnf'))) - printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_options($link, MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT=0', 'foo'))) - printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - // print "run_tests.php don't fool me with your 'ungreedy' expression '.+?'!\n"; var_dump("MYSQLI_READ_DEFAULT_GROUP", mysqli_options($link, MYSQLI_READ_DEFAULT_GROUP, 'extra_my.cnf')); var_dump("MYSQLI_READ_DEFAULT_FILE", mysqli_options($link, MYSQLI_READ_DEFAULT_FILE, 'extra_my.cnf')); diff --git a/ext/mysqli/tests/mysqli_ping.phpt b/ext/mysqli/tests/mysqli_ping.phpt index 6ddb29efefc77..93deeebfa32d6 100644 --- a/ext/mysqli/tests/mysqli_ping.phpt +++ b/ext/mysqli/tests/mysqli_ping.phpt @@ -10,17 +10,8 @@ require_once('skipifconnectfailure.inc'); --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index bfa703bb010e8..cf6d282c638f7 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -10,23 +10,11 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- diff --git a/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt b/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt index b3465ad2b10e8..3db0ecce62ec5 100644 --- a/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt +++ b/ext/mysqli/tests/mysqli_real_escape_string_unicode.phpt @@ -10,20 +10,8 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- -NULL %s(5) "00000" %s(5) "42S22" %s(5) "00000" diff --git a/ext/mysqli/tests/mysqli_ssl_set.phpt b/ext/mysqli/tests/mysqli_ssl_set.phpt index 8463cc58b8f3d..4f28350ef57a7 100644 --- a/ext/mysqli/tests/mysqli_ssl_set.phpt +++ b/ext/mysqli/tests/mysqli_ssl_set.phpt @@ -12,27 +12,6 @@ if (!function_exists('mysqli_ssl_set')) MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH); if (mysqli_get_client_version() > 50003) $valid_attr["cursor_type"] = MYSQLI_STMT_ATTR_CURSOR_TYPE; diff --git a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt index b3d60380cb4a5..6e5710a0fc641 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt @@ -8,22 +8,7 @@ require_once('skipifconnectfailure.inc'); ?> --FILE-- --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt index dcd05e5f68fb4..c166d91c48c13 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result.phpt @@ -9,25 +9,12 @@ require_once('skipifconnectfailure.inc'); --FILE-- = 50600) func_mysqli_stmt_bind_result($link, $engine, "s", "TIME", "13:31:34.123456", 1770, "13:31:34"); - /* Check that the function alias exists. It's a deprecated function, - but we have not announce the removal so far, therefore we need to check for it */ - if (!is_null($tmp = @mysqli_stmt_bind_result())) - printf("[3000] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - $stmt = mysqli_stmt_init($link); if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1000, 'z')")) printf("[3001] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); @@ -318,8 +300,6 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Warning: mysqli_stmt_bind_result() expects at least 2 parameters, 1 given in %s on line %d - Warning: mysqli_stmt_bind_result(): invalid object or resource mysqli_stmt in %s on line %d diff --git a/ext/mysqli/tests/mysqli_stmt_close.phpt b/ext/mysqli/tests/mysqli_stmt_close.phpt index 6ea64e815a19f..dfeab7075d383 100644 --- a/ext/mysqli/tests/mysqli_stmt_close.phpt +++ b/ext/mysqli/tests/mysqli_stmt_close.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_stmt_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_field_count.phpt index 847fe04a3b9bf..2fa8a8ac80336 100644 --- a/ext/mysqli/tests/mysqli_stmt_field_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_field_count.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); data_seek($res->num_rows + 1))) printf("[012] Expecting boolean/false got %s/%s\n", gettype($tmp), $tmp); - if (NULL !== ($tmp = $res->data_seek(PHP_INT_MAX + 1))) - printf("[013] Expecting NULL got %s/%s\n", gettype($tmp), $tmp); - for ($i = 0; $i < 100; $i++) { /* intentionally out of range! */ $pos = mt_rand(-1, 4); @@ -118,8 +115,6 @@ if (!function_exists('mysqli_stmt_get_result')) require_once("clean_table.inc"); ?> --EXPECTF-- -Warning: mysqli_result::data_seek() expects parameter 1 to be int, float given in %s on line %d - Warning: mysqli_data_seek(): Couldn't fetch mysqli_result in %s on line %d Warning: mysqli_result::fetch_array(): Couldn't fetch mysqli_result in %s on line %d diff --git a/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt b/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt index 1ebe6d051f213..958a27855451f 100644 --- a/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt +++ b/ext/mysqli/tests/mysqli_stmt_get_warnings.phpt @@ -26,15 +26,6 @@ mysqli_query($link, "DROP TABLE IF EXISTS test"); --CLEAN-- diff --git a/ext/mysqli/tests/mysqli_stmt_prepare.phpt b/ext/mysqli/tests/mysqli_stmt_prepare.phpt index d0e38075d9e3f..52c7597ef6ff0 100644 --- a/ext/mysqli/tests/mysqli_stmt_prepare.phpt +++ b/ext/mysqli/tests/mysqli_stmt_prepare.phpt @@ -16,23 +16,11 @@ require_once('skipifconnectfailure.inc'); // fetch tests, because the fetch tests would have to call prepare/execute etc. // anyway. - $tmp = NULL; - $link = NULL; - - if (!is_null($tmp = @mysqli_stmt_prepare())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_stmt_prepare($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - require('table.inc'); if (!$stmt = mysqli_stmt_init($link)) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (NULL !== ($tmp = @mysqli_stmt_prepare($stmt))) - printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (false !== ($tmp = mysqli_stmt_prepare($stmt, ''))) printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); diff --git a/ext/mysqli/tests/mysqli_stmt_reset.phpt b/ext/mysqli/tests/mysqli_stmt_reset.phpt index b7ec4e3ed7427..339b885b726bc 100644 --- a/ext/mysqli/tests/mysqli_stmt_reset.phpt +++ b/ext/mysqli/tests/mysqli_stmt_reset.phpt @@ -16,15 +16,6 @@ require_once('skipifconnectfailure.inc'); // fetch tests, because the fetch tests would have to call prepare/execute etc. // anyway. - $tmp = NULL; - $link = NULL; - - if (!is_null($tmp = @mysqli_stmt_reset())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_stmt_reset($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - require('table.inc'); if (!$stmt = mysqli_stmt_init($link)) diff --git a/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt b/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt index 8f4e13ef39469..adb7f6f72668b 100644 --- a/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt +++ b/ext/mysqli/tests/mysqli_stmt_result_metadata.phpt @@ -10,15 +10,6 @@ require_once('skipifconnectfailure.inc'); diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index 1fc27455115a9..b42e393503d6a 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt @@ -10,23 +10,11 @@ require_once('skipifconnectfailure.inc'); diff --git a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt index 1784106162808..2740195931b39 100644 --- a/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt +++ b/ext/mysqli/tests/mysqli_stmt_sqlstate.phpt @@ -10,20 +10,8 @@ require_once('skipifconnectfailure.inc'); getMessage(), "\n"; +} var_dump(openssl_csr_export($privkey, $output)); -var_dump(openssl_csr_export(array(), $output)); var_dump(openssl_csr_export($csr, $output, false)); ?> --EXPECTF-- bool(true) - -Warning: openssl_csr_export() expects parameter 1 to be resource, string given in %s on line %d -NULL +openssl_csr_export() expects parameter 1 to be resource, string given Warning: openssl_csr_export(): supplied resource is not a valid OpenSSL X.509 CSR resource in %s on line %d Warning: openssl_csr_export(): cannot get CSR from parameter 1 in %s on line %d bool(false) - -Warning: openssl_csr_export() expects parameter 1 to be resource, array given in %s on line %d -NULL bool(true) diff --git a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt index ccbd00f49ad56..a0c50fc5a16d1 100644 --- a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt @@ -36,9 +36,12 @@ $privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; $csr = openssl_csr_new($dn, $privkey_file, $args); var_dump(openssl_csr_export_to_file($csr, $csrfile)); var_dump(file_get_contents($csrfile)); -var_dump(openssl_csr_export_to_file($wrong, $csrfile)); +try { + var_dump(openssl_csr_export_to_file($wrong, $csrfile)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(openssl_csr_export_to_file($dh, $csrfile)); -var_dump(openssl_csr_export_to_file(array(), $csrfile)); var_dump(openssl_csr_export_to_file($csr, $csrfile, false)); ?> --CLEAN-- @@ -69,15 +72,10 @@ sfBgVeqg0P4SWez5fHXqBNcjMdMI5f0bikcDZSIfTHS8FX+PMurLBC8UPB0YNIOl JViHkCA9x6m8RJXAFvqmgLlWlUzbDv/cRrDfjWjR -----END CERTIFICATE REQUEST----- " - -Warning: openssl_csr_export_to_file() expects parameter 1 to be resource, string given in %s on line %d -NULL +openssl_csr_export_to_file() expects parameter 1 to be resource, string given Warning: openssl_csr_export_to_file(): supplied resource is not a valid OpenSSL X.509 CSR resource in %s on line %d Warning: openssl_csr_export_to_file(): cannot get CSR from parameter 1 in %s on line %d bool(false) - -Warning: openssl_csr_export_to_file() expects parameter 1 to be resource, array given in %s on line %d -NULL bool(true) diff --git a/ext/openssl/tests/openssl_csr_new_basic.phpt b/ext/openssl/tests/openssl_csr_new_basic.phpt index 816c6f9d9046a..1fadc00f27532 100644 --- a/ext/openssl/tests/openssl_csr_new_basic.phpt +++ b/ext/openssl/tests/openssl_csr_new_basic.phpt @@ -5,9 +5,6 @@ openssl_csr_new() tests --FILE-- dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf'); @@ -26,12 +23,6 @@ var_dump(openssl_csr_new(["countryName" => "DE"], $x, $conf + ["x509_extensions" echo "Done\n"; ?> --EXPECTF-- -Warning: openssl_csr_new() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: openssl_csr_new() expects parameter 1 to be array, int given in %s on line %d -NULL - Warning: openssl_csr_new(): key array must be of the form array(0 => key, 1 => phrase) in %s on line %d Warning: openssl_csr_new(): add1_attr_by_txt challengePassword_min -> 4 (failed; check error queue and value of string_mask OpenSSL option if illegal characters are reported) in %s on line %d diff --git a/ext/openssl/tests/openssl_csr_sign_basic.phpt b/ext/openssl/tests/openssl_csr_sign_basic.phpt index 57c9e75c0ee47..c585eb14f6d16 100644 --- a/ext/openssl/tests/openssl_csr_sign_basic.phpt +++ b/ext/openssl/tests/openssl_csr_sign_basic.phpt @@ -35,13 +35,10 @@ var_dump(openssl_csr_sign($csr, $cert, $priv, 365, $config_arg)); var_dump(openssl_csr_sign($csr, openssl_x509_read($cert), $priv, 365, $config_arg)); var_dump(openssl_csr_sign($csr, $wrong, $privkey, 365)); var_dump(openssl_csr_sign($csr, null, $wrong, 365)); -var_dump(openssl_csr_sign($csr, null, $privkey, $wrong)); -var_dump(openssl_csr_sign($csr, null, $privkey, 365, $wrong)); var_dump(openssl_csr_sign($wrong, null, $privkey, 365)); var_dump(openssl_csr_sign(array(), null, $privkey, 365)); var_dump(openssl_csr_sign($csr, array(), $privkey, 365)); var_dump(openssl_csr_sign($csr, null, array(), 365)); -var_dump(openssl_csr_sign($csr, null, $privkey, array())); var_dump(openssl_csr_sign($csr, null, $privkey, 365, $config_arg)); ?> --EXPECTF-- @@ -56,12 +53,6 @@ bool(false) Warning: openssl_csr_sign(): cannot get private key from parameter 3 in %s on line %d bool(false) -Warning: openssl_csr_sign() expects parameter 4 to be int, string given in %s on line %d -NULL - -Warning: openssl_csr_sign() expects parameter 5 to be array, string given in %s on line %d -NULL - Warning: openssl_csr_sign(): cannot get CSR from parameter 1 in %s on line %d bool(false) @@ -75,7 +66,4 @@ Warning: openssl_csr_sign(): key array must be of the form array(0 => key, 1 => Warning: openssl_csr_sign(): cannot get private key from parameter 3 in %s on line %d bool(false) - -Warning: openssl_csr_sign() expects parameter 4 to be int, array given in %s on line %d -NULL resource(%d) of type (OpenSSL X.509) diff --git a/ext/openssl/tests/openssl_decrypt_error.phpt b/ext/openssl/tests/openssl_decrypt_error.phpt index be40f8080f315..5f79cd86c2e5d 100644 --- a/ext/openssl/tests/openssl_decrypt_error.phpt +++ b/ext/openssl/tests/openssl_decrypt_error.phpt @@ -19,9 +19,6 @@ var_dump(openssl_decrypt($wrong, $method, $password)); var_dump(openssl_decrypt($wrong, $wrong, $password)); var_dump(openssl_decrypt($encrypted, $wrong, $wrong)); var_dump(openssl_decrypt($wrong, $wrong, $wrong)); -var_dump(openssl_decrypt(array(), $method, $password)); -var_dump(openssl_decrypt($encrypted, array(), $password)); -var_dump(openssl_decrypt($encrypted, $method, array())); // invalid using of an authentication tag var_dump(openssl_encrypt($data, $method, $password, 0, $iv, $wrong)); @@ -45,14 +42,5 @@ bool(false) Warning: openssl_decrypt(): Unknown cipher algorithm in %s on line %d bool(false) -Warning: openssl_decrypt() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: openssl_decrypt() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: openssl_decrypt() expects parameter 3 to be string, array given in %s on line %d -NULL - Warning: openssl_encrypt(): The authenticated tag cannot be provided for cipher that doesn not support AEAD in %s on line %d string(44) "yof6cPPH4mLee6TOc0YQSrh4dvywMqxGUyjp0lV6+aM=" diff --git a/ext/openssl/tests/openssl_encrypt_error.phpt b/ext/openssl/tests/openssl_encrypt_error.phpt index ea39bff604cf2..53bc371f4606f 100644 --- a/ext/openssl/tests/openssl_encrypt_error.phpt +++ b/ext/openssl/tests/openssl_encrypt_error.phpt @@ -14,12 +14,6 @@ $arr = array(1); // wrong parameters tests var_dump(openssl_encrypt($data, $wrong, $password)); -var_dump(openssl_encrypt($object, $method, $password)); -var_dump(openssl_encrypt($data, $object, $password)); -var_dump(openssl_encrypt($data, $method, $object)); -var_dump(openssl_encrypt($arr, $method, $object)); -var_dump(openssl_encrypt($data, $arr, $object)); -var_dump(openssl_encrypt($data, $method, $arr)); // invalid using of an authentication tag var_dump(openssl_encrypt($data, $method, $password, 0, $iv, $wrong)); @@ -31,24 +25,6 @@ var_dump(openssl_encrypt($data, $method, $password, OPENSSL_DONT_ZERO_PAD_KEY, $ Warning: openssl_encrypt(): Unknown cipher algorithm in %s on line %d bool(false) -Warning: openssl_encrypt() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: openssl_encrypt() expects parameter 2 to be string, object given in %s on line %d -NULL - -Warning: openssl_encrypt() expects parameter 3 to be string, object given in %s on line %d -NULL - -Warning: openssl_encrypt() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: openssl_encrypt() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: openssl_encrypt() expects parameter 3 to be string, array given in %s on line %d -NULL - Warning: openssl_encrypt(): The authenticated tag cannot be provided for cipher that doesn not support AEAD in %s on line %d string(44) "iPR4HulskuaP5Z6me5uImk6BqVyJG73+63tkPauVZYk=" diff --git a/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt b/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt index 2132b402aa4b7..099596c033454 100644 --- a/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt @@ -26,13 +26,11 @@ var_dump(openssl_pkcs7_encrypt($infile, $outfile, openssl_x509_read($single_cert var_dump(openssl_pkcs7_decrypt($outfile, $outfile2, $single_cert, $privkey)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $assoc_headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $empty_headers)); -var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $wrong)); var_dump(openssl_pkcs7_encrypt($wrong, $outfile, $single_cert, $headers)); var_dump(openssl_pkcs7_encrypt($empty, $outfile, $single_cert, $headers)); var_dump(openssl_pkcs7_encrypt($infile, $empty, $single_cert, $headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $wrong, $headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $empty, $headers)); -var_dump(openssl_pkcs7_encrypt($infile, $outfile, $single_cert, $empty)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, $multi_certs, $headers)); var_dump(openssl_pkcs7_encrypt($infile, $outfile, array_map('openssl_x509_read', $multi_certs) , $headers)); @@ -45,23 +43,17 @@ if (file_exists($outfile2)) { unlink($outfile2); } ?> ---EXPECTF-- +--EXPECT-- bool(true) bool(true) bool(true) bool(true) bool(true) - -Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, string given in %s on line %d -bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) - -Warning: openssl_pkcs7_encrypt() expects parameter 4 to be array, string given in %s on line %d -bool(false) bool(true) bool(true) true diff --git a/ext/openssl/tests/openssl_pkcs7_read_basic.phpt b/ext/openssl/tests/openssl_pkcs7_read_basic.phpt index 64c7c2c130f3e..9ee745434dd1e 100644 --- a/ext/openssl/tests/openssl_pkcs7_read_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_read_basic.phpt @@ -8,19 +8,12 @@ $infile = file_get_contents(dirname(__FILE__) . "/cert.p7b"); $certfile = file_get_contents(dirname(__FILE__) . "/cert.crt"); $result = []; -var_dump(openssl_pkcs7_read()); -var_dump(openssl_pkcs7_read("")); var_dump(openssl_pkcs7_read("", $result)); var_dump(openssl_pkcs7_read($certfile, $result)); var_dump(openssl_pkcs7_read($infile, $result)); var_dump($result); ?> ---EXPECTF-- -Warning: openssl_pkcs7_read() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: openssl_pkcs7_read() expects exactly 2 parameters, 1 given in %s on line %d -NULL +--EXPECT-- bool(false) bool(false) bool(true) diff --git a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt index 0e29901c7e7ac..bd8bb484642c7 100644 --- a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt @@ -22,13 +22,11 @@ var_dump(openssl_pkcs7_sign($infile, $outfile, openssl_x509_read($single_cert), var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $assoc_headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $empty_headers)); -var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $wrong)); var_dump(openssl_pkcs7_sign($wrong, $outfile, $single_cert, $privkey, $headers)); var_dump(openssl_pkcs7_sign($empty, $outfile, $single_cert, $privkey, $headers)); var_dump(openssl_pkcs7_sign($infile, $empty, $single_cert, $privkey, $headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $wrong, $privkey, $headers)); var_dump(openssl_pkcs7_sign($infile, $outfile, $empty, $privkey, $headers)); -var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $empty)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $wrong, $headers)); if (file_exists($outfile)) { @@ -42,9 +40,6 @@ bool(true) bool(true) bool(true) -Warning: openssl_pkcs7_sign() expects parameter 5 to be array, string given in %s on line %d -NULL - Warning: openssl_pkcs7_sign(): error opening input file %s in %s on line %d bool(false) @@ -60,9 +55,6 @@ bool(false) Warning: openssl_pkcs7_sign(): error getting cert in %s on line %d bool(false) -Warning: openssl_pkcs7_sign() expects parameter 5 to be array, string given in %s on line %d -NULL - Warning: openssl_pkcs7_sign(): error getting private key in %s on line %d bool(false) true diff --git a/ext/openssl/tests/openssl_pkey_new_error.phpt b/ext/openssl/tests/openssl_pkey_new_error.phpt index c7dc193d53e46..9249f252d8068 100644 --- a/ext/openssl/tests/openssl_pkey_new_error.phpt +++ b/ext/openssl/tests/openssl_pkey_new_error.phpt @@ -11,13 +11,23 @@ $rsa = array("rsa" => array()); $dsa = array("dsa" => array()); $dh = array("dh" => array()); -openssl_pkey_get_details(openssl_pkey_new($rsa)); -openssl_pkey_get_details(openssl_pkey_new($dsa)); -openssl_pkey_get_details(openssl_pkey_new($dh)); +try { + openssl_pkey_get_details(openssl_pkey_new($rsa)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + openssl_pkey_get_details(openssl_pkey_new($dsa)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + openssl_pkey_get_details(openssl_pkey_new($dh)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: openssl_pkey_get_details() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: openssl_pkey_get_details() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: openssl_pkey_get_details() expects parameter 1 to be resource, bool given in %s on line %d +--EXPECT-- +openssl_pkey_get_details() expects parameter 1 to be resource, bool given +openssl_pkey_get_details() expects parameter 1 to be resource, bool given +openssl_pkey_get_details() expects parameter 1 to be resource, bool given diff --git a/ext/openssl/tests/openssl_seal_basic.phpt b/ext/openssl/tests/openssl_seal_basic.phpt index 1899ebac3bb68..c3c79214fe342 100644 --- a/ext/openssl/tests/openssl_seal_basic.phpt +++ b/ext/openssl/tests/openssl_seal_basic.phpt @@ -12,8 +12,6 @@ $d = array(1); var_dump(openssl_seal($a, $b, $c, $d)); var_dump(openssl_seal($a, $a, $a, array())); -var_dump(openssl_seal($c, $c, $c, 1)); -var_dump(openssl_seal($b, $b, $b, "")); // tests with cert $data = "openssl_open() test"; @@ -23,7 +21,6 @@ $wrong = "wrong"; var_dump(openssl_seal($data, $sealed, $ekeys, array($pub_key))); // no output var_dump(openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key))); // no output var_dump(openssl_seal($data, $sealed, $ekeys, array($pub_key, $wrong))); -var_dump(openssl_seal($data, $sealed, $ekeys, $pub_key)); var_dump(openssl_seal($data, $sealed, $ekeys, array())); var_dump(openssl_seal($data, $sealed, $ekeys, array($wrong))); @@ -35,21 +32,12 @@ bool(false) Warning: openssl_seal(): Fourth argument to openssl_seal() must be a non-empty array in %s on line %d bool(false) - -Warning: openssl_seal() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: openssl_seal() expects parameter 1 to be string, array given in %s on line %d -NULL int(19) int(19) Warning: openssl_seal(): not a public key (2th member of pubkeys) in %s on line %d bool(false) -Warning: openssl_seal() expects parameter 4 to be array, string given in %s on line %d -NULL - Warning: openssl_seal(): Fourth argument to openssl_seal() must be a non-empty array in %s on line %d bool(false) diff --git a/ext/openssl/tests/openssl_sign_basic.phpt b/ext/openssl/tests/openssl_sign_basic.phpt index 0200e5ba6ec21..36655dd61a5df 100644 --- a/ext/openssl/tests/openssl_sign_basic.phpt +++ b/ext/openssl/tests/openssl_sign_basic.phpt @@ -10,13 +10,9 @@ $wrong = "wrong"; var_dump(openssl_sign($data, $sign, $privkey)); // no output var_dump(openssl_sign($data, $sign, $wrong)); -var_dump(openssl_sign(array(), $sign, $privkey)); ?> --EXPECTF-- bool(true) Warning: openssl_sign(): supplied key param cannot be coerced into a private key in %s on line %d bool(false) - -Warning: openssl_sign() expects parameter 1 to be string, array given in %s on line %d -NULL diff --git a/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt b/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt index ceaafc2234c16..fa3fce36ab32e 100644 --- a/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt +++ b/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt @@ -7,9 +7,6 @@ openssl_x509_fingerprint() tests $cert = "file://" . dirname(__FILE__) . "/cert.crt"; -echo "** Testing with no parameters **\n"; -var_dump(openssl_x509_fingerprint()); - echo "** Testing default functionality **\n"; var_dump(openssl_x509_fingerprint($cert)); @@ -29,10 +26,6 @@ echo "** Testing bad hash method **\n"; var_dump(openssl_x509_fingerprint($cert, 'xx45')); ?> --EXPECTF-- -** Testing with no parameters ** - -Warning: openssl_x509_fingerprint() expects at least 1 parameter, 0 given in %s on line %d -NULL ** Testing default functionality ** string(40) "6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c" ** Testing hash method md5 ** diff --git a/ext/openssl/tests/openssl_x509_free_basic.phpt b/ext/openssl/tests/openssl_x509_free_basic.phpt index 663adccc2c39e..59acb090c360e 100644 --- a/ext/openssl/tests/openssl_x509_free_basic.phpt +++ b/ext/openssl/tests/openssl_x509_free_basic.phpt @@ -7,10 +7,7 @@ openssl_x509_free() tests var_dump($res = openssl_x509_read("file://" . dirname(__FILE__) . "/cert.crt")); openssl_x509_free($res); var_dump($res); -openssl_x509_free(false); ?> --EXPECTF-- resource(%d) of type (OpenSSL X.509) resource(%d) of type (Unknown) - -Warning: openssl_x509_free() expects parameter 1 to be resource, bool given in %s on line %d diff --git a/ext/pcntl/tests/pcntl_alarm.phpt b/ext/pcntl/tests/pcntl_alarm.phpt index a9cae1616b7f8..337ba3ad4b26a 100644 --- a/ext/pcntl/tests/pcntl_alarm.phpt +++ b/ext/pcntl/tests/pcntl_alarm.phpt @@ -8,7 +8,6 @@ max_execution_time=0 0); @@ -16,8 +15,6 @@ $siginfo = array(); var_dump(pcntl_sigtimedwait(array(SIGALRM),$siginfo,2) === SIGALRM); ?> --EXPECTF-- -Warning: pcntl_alarm() expects exactly 1 parameter, 0 given in %s -NULL int(0) bool(true) bool(true) diff --git a/ext/pcntl/tests/pcntl_exec_3.phpt b/ext/pcntl/tests/pcntl_exec_3.phpt index 5349381d92b89..7d7f6b5271ba8 100644 --- a/ext/pcntl/tests/pcntl_exec_3.phpt +++ b/ext/pcntl/tests/pcntl_exec_3.phpt @@ -4,14 +4,10 @@ pcntl_exec() 3 --FILE-- "bar"))); unlink($file); ?> --EXPECTF-- -Warning: pcntl_exec() expects at least 1 parameter, 0 given %s -NULL - Warning: pcntl_exec(): Error has occurred: (errno %d) %s bool(false) diff --git a/ext/pcntl/tests/pcntl_signal.phpt b/ext/pcntl/tests/pcntl_signal.phpt index a6441935c1101..5bba18c2a03f9 100644 --- a/ext/pcntl/tests/pcntl_signal.phpt +++ b/ext/pcntl/tests/pcntl_signal.phpt @@ -17,7 +17,6 @@ pcntl_signal(SIGUSR1, function($signo, $siginfo){ posix_kill(posix_getpid(), SIGUSR1); pcntl_signal_dispatch(); -var_dump(pcntl_signal()); var_dump(pcntl_signal(SIGALRM, SIG_IGN)); var_dump(pcntl_signal(-1, -1)); var_dump(pcntl_signal(-1, function(){})); @@ -31,9 +30,6 @@ echo "ok\n"; --EXPECTF-- signal dispatched got signal from %r\d+|nobody%r - -Warning: pcntl_signal() expects at least 2 parameters, 0 given in %s -NULL bool(true) Warning: pcntl_signal(): Invalid signal %s diff --git a/ext/pcntl/tests/pcntl_wait.phpt b/ext/pcntl/tests/pcntl_wait.phpt index d5ab709b764d1..c745a21dc714e 100644 --- a/ext/pcntl/tests/pcntl_wait.phpt +++ b/ext/pcntl/tests/pcntl_wait.phpt @@ -20,15 +20,6 @@ if ($pid == -1) { var_dump(pcntl_wexitstatus($status)); var_dump(pcntl_wait($status, WNOHANG | WUNTRACED)); - var_dump(pcntl_wait()); - var_dump(pcntl_waitpid()); - - var_dump(pcntl_wifexited()); - var_dump(pcntl_wifstopped()); - var_dump(pcntl_wifsignaled()); - var_dump(pcntl_wexitstatus()); - var_dump(pcntl_wtermsig()); - var_dump(pcntl_wstopsig()); } else { posix_kill(posix_getpid(), SIGSTOP); exit(42); @@ -40,27 +31,3 @@ bool(false) bool(false) int(42) int(-1) - -Warning: pcntl_wait() expects at least 1 parameter, 0 given in %s -NULL - -Warning: pcntl_waitpid() expects at least 2 parameters, 0 given in %s -NULL - -Warning: pcntl_wifexited() expects exactly 1 parameter, 0 given in %s -NULL - -Warning: pcntl_wifstopped() expects exactly 1 parameter, 0 given in %s -NULL - -Warning: pcntl_wifsignaled() expects exactly 1 parameter, 0 given in %s -NULL - -Warning: pcntl_wexitstatus() expects exactly 1 parameter, 0 given in %s -NULL - -Warning: pcntl_wtermsig() expects exactly 1 parameter, 0 given in %s -NULL - -Warning: pcntl_wstopsig() expects exactly 1 parameter, 0 given in %s -NULL diff --git a/ext/pcre/tests/002.phpt b/ext/pcre/tests/002.phpt index d4780447bce41..073a7a8d566ef 100644 --- a/ext/pcre/tests/002.phpt +++ b/ext/pcre/tests/002.phpt @@ -3,11 +3,8 @@ preg_* with bogus vals --FILE-- --EXPECTF-- -Warning: preg_match() expects at least 2 parameters, 0 given in %s002.php on line 3 -bool(false) - -Warning: preg_match_all() expects at least 2 parameters, 0 given in %s002.php on line 4 -bool(false) - -Warning: preg_match_all(): Invalid flags specified in %s002.php on line 5 -NULL - -Warning: preg_quote() expects at least 1 parameter, 0 given in %s002.php on line 7 +Warning: preg_match_all(): Invalid flags specified in %s002.php on line %d NULL string(0) "" string(12) "a${1b${1c${1" -Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 8 in %s002.php on line 11 +Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 8 in %s002.php on line %d NULL -Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in %s on line 12 +Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in %s on line %d NULL diff --git a/ext/pcre/tests/grep2.phpt b/ext/pcre/tests/grep2.phpt index a739cb60ac3bf..5aee98b9e4d6a 100644 --- a/ext/pcre/tests/grep2.phpt +++ b/ext/pcre/tests/grep2.phpt @@ -5,8 +5,6 @@ preg_grep() 2nd test --FILE-- 'a', 'x' => '1', 'xyz'=>'q6', 'h20'); @@ -21,13 +19,7 @@ var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR); ?> --EXPECTF-- -Warning: preg_grep() expects at most 3 parameters, 4 given in %sgrep2.php on line 3 -NULL - -Warning: preg_grep() expects parameter 2 to be array, int given in %sgrep2.php on line 4 -NULL - -Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %sgrep2.php on line 5 +Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %sgrep2.php on line %d bool(false) array(3) { [5]=> diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt index fcc36e7d91005..79fcb98897da7 100644 --- a/ext/pcre/tests/preg_grep_error1.phpt +++ b/ext/pcre/tests/preg_grep_error1.phpt @@ -20,10 +20,18 @@ $values = array('abcdef', //Regex without delimiter $array = array(123, 'abc', 'test'); foreach($values as $value) { print "\nArg value is $value\n"; - var_dump(preg_grep($value, $array)); + try { + var_dump(preg_grep($value, $array)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } $value = new stdclass(); //Object -var_dump(preg_grep($value, $array)); +try { + var_dump(preg_grep($value, $array)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done" ?> --EXPECTF-- @@ -50,9 +58,7 @@ Warning: preg_grep(): Unknown modifier 'F' in %spreg_grep_error1.php on line %d bool(false) Arg value is Array - -Warning: preg_grep() expects parameter 1 to be string, array given in %spreg_grep_error1.php on line %d -NULL +preg_grep() expects parameter 1 to be string, array given Arg value is /[a-zA-Z]/ array(2) { @@ -61,7 +67,5 @@ array(2) { [2]=> string(4) "test" } - -Warning: preg_grep() expects parameter 1 to be string, object given in %spreg_grep_error1.php on line %d -NULL +preg_grep() expects parameter 1 to be string, object given Done diff --git a/ext/pcre/tests/preg_match_all_error1.phpt b/ext/pcre/tests/preg_match_all_error1.phpt index 95ab905d7d4cb..bd0f28c8c4b4e 100644 --- a/ext/pcre/tests/preg_match_all_error1.phpt +++ b/ext/pcre/tests/preg_match_all_error1.phpt @@ -20,11 +20,19 @@ $regex_array = array('abcdef', //Regex without delimiter $subject = 'test'; foreach($regex_array as $regex_value) { print "\nArg value is $regex_value\n"; - var_dump(preg_match_all($regex_value, $subject, $matches1)); + try { + var_dump(preg_match_all($regex_value, $subject, $matches1)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } var_dump($matches1); } $regex_value = new stdclass(); //Object -var_dump(preg_match_all($regex_value, $subject, $matches)); +try { + var_dump(preg_match_all($regex_value, $subject, $matches)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($matches); ?> --EXPECTF-- @@ -55,9 +63,7 @@ bool(false) NULL Arg value is Array - -Warning: preg_match_all() expects parameter 1 to be string, array given in %spreg_match_all_error1.php on line %d -bool(false) +preg_match_all() expects parameter 1 to be string, array given NULL Arg value is /[a-zA-Z]/ @@ -75,7 +81,5 @@ array(1) { string(1) "t" } } - -Warning: preg_match_all() expects parameter 1 to be string, object given in %spreg_match_all_error1.php on line %d -bool(false) +preg_match_all() expects parameter 1 to be string, object given NULL diff --git a/ext/pcre/tests/preg_match_all_error2.phpt b/ext/pcre/tests/preg_match_all_error2.phpt index 1c55cce64ebb7..8c52b73076cca 100644 --- a/ext/pcre/tests/preg_match_all_error2.phpt +++ b/ext/pcre/tests/preg_match_all_error2.phpt @@ -12,13 +12,14 @@ error_reporting(E_ALL&~E_NOTICE); */ echo "*** Testing preg_match_all() : error conditions ***\n"; $regex = '/[a-zA-Z]/'; -$value = new stdclass(); //Object -var_dump(preg_match_all($regex, $value, $matches)); -var_dump($matches); $input = array(array('this is', 'a subarray'), 'test',); foreach($input as $value) { print "\nArg value is: $value\n"; - var_dump(preg_match_all($regex, $value, $matches)); + try { + var_dump(preg_match_all($regex, $value, $matches)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } var_dump($matches); } echo "Done"; @@ -26,14 +27,8 @@ echo "Done"; --EXPECTF-- *** Testing preg_match_all() : error conditions *** -Warning: preg_match_all() expects parameter 2 to be string, object given in %spreg_match_all_error2.php on line %d -bool(false) -NULL - Arg value is: Array - -Warning: preg_match_all() expects parameter 2 to be string, array given in %spreg_match_all_error2.php on line %d -bool(false) +preg_match_all() expects parameter 2 to be string, array given NULL Arg value is: test diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt index 42bb5abd27073..23d6829c48435 100644 --- a/ext/pcre/tests/preg_match_error1.phpt +++ b/ext/pcre/tests/preg_match_error1.phpt @@ -20,10 +20,18 @@ $regex_array = array('abcdef', //Regex without delimiter $subject = 'this is a test'; foreach($regex_array as $regex_value) { print "\nArg value is $regex_value\n"; - var_dump(preg_match($regex_value, $subject)); + try { + var_dump(preg_match($regex_value, $subject)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } $regex_value = new stdclass(); //Object -var_dump(preg_match($regex_value, $subject)); +try { + var_dump(preg_match($regex_value, $subject)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- *** Testing preg_match() : error conditions *** @@ -49,12 +57,8 @@ Warning: preg_match(): Unknown modifier 'F' in %spreg_match_error1.php on line % bool(false) Arg value is Array - -Warning: preg_match() expects parameter 1 to be string, array given in %spreg_match_error1.php on line %d -bool(false) +preg_match() expects parameter 1 to be string, array given Arg value is /[a-zA-Z]/ int(1) - -Warning: preg_match() expects parameter 1 to be string, object given in %spreg_match_error1.php on line %d -bool(false) +preg_match() expects parameter 1 to be string, object given diff --git a/ext/pcre/tests/preg_match_error2.phpt b/ext/pcre/tests/preg_match_error2.phpt index cb0917a228762..9530983e81950 100644 --- a/ext/pcre/tests/preg_match_error2.phpt +++ b/ext/pcre/tests/preg_match_error2.phpt @@ -15,10 +15,18 @@ $regex = '/[a-zA-Z]/'; $input = array('this is a string', array('this is', 'a subarray'),); foreach($input as $value) { print "\nArg value is: $value\n"; - var_dump(preg_match($regex, $value)); + try { + var_dump(preg_match($regex, $value)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } $value = new stdclass(); //Object -var_dump(preg_match($regex, $value)); +try { + var_dump(preg_match($regex, $value)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> --EXPECTF-- @@ -28,10 +36,6 @@ Arg value is: this is a string int(1) Arg value is: Array - -Warning: preg_match() expects parameter 2 to be string, array given in %spreg_match_error2.php on line %d -bool(false) - -Warning: preg_match() expects parameter 2 to be string, object given in %spreg_match_error2.php on line %d -bool(false) +preg_match() expects parameter 2 to be string, array given +preg_match() expects parameter 2 to be string, object given Done diff --git a/ext/pcre/tests/preg_replace_callback3.phpt b/ext/pcre/tests/preg_replace_callback3.phpt index f5c87176f9b9f..842dfacb391a2 100644 --- a/ext/pcre/tests/preg_replace_callback3.phpt +++ b/ext/pcre/tests/preg_replace_callback3.phpt @@ -3,30 +3,14 @@ preg_replace_callback() 3 --FILE-- --EXPECTF-- -Warning: preg_replace_callback() expects at least 3 parameters, 0 given in %s on line %d -NULL - -Warning: preg_replace_callback() expects at least 3 parameters, 1 given in %s on line %d -NULL - -Warning: preg_replace_callback() expects at least 3 parameters, 2 given in %s on line %d -NULL - Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d string(1) "3" @@ -35,10 +19,4 @@ string(1) "3" Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d string(1) "3" - -Warning: preg_replace_callback() expects parameter 4 to be int, string given in %s on line %d -NULL - -Warning: preg_replace_callback() expects parameter 4 to be int, array given in %s on line %d -NULL Done diff --git a/ext/pcre/tests/preg_replace_callback_array2.phpt b/ext/pcre/tests/preg_replace_callback_array2.phpt index f2f20ef64532e..03d7a60eee833 100644 --- a/ext/pcre/tests/preg_replace_callback_array2.phpt +++ b/ext/pcre/tests/preg_replace_callback_array2.phpt @@ -3,19 +3,8 @@ preg_replace_callback_array() errors --FILE-- ""),"","",$a)); $a = array(); $b = ""; -var_dump(preg_replace_callback($a, $a, $a, $a, $b)); -var_dump($b); -$b = ""; var_dump(preg_replace_callback_array(array("xx" => "s"), $a, -1, $b)); var_dump($b); function f() { @@ -34,28 +23,6 @@ try { echo "Done\n"; ?> --EXPECTF-- -Warning: preg_replace_callback_array() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: preg_replace_callback_array() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: preg_replace_callback_array() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: preg_replace_callback_array() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: preg_replace_callback_array() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: preg_replace_callback_array() expects parameter 3 to be int, string given in %s on line %d -NULL - -Warning: preg_replace_callback() expects parameter 4 to be int, array given in %s on line %d -NULL -string(0) "" - Warning: preg_replace_callback_array(): 's' is not a valid callback in %spreg_replace_callback_array2.php on line %d array(0) { } diff --git a/ext/pcre/tests/preg_split_error1.phpt b/ext/pcre/tests/preg_split_error1.phpt index 79942a948047b..1c1e3ec646aa4 100644 --- a/ext/pcre/tests/preg_split_error1.phpt +++ b/ext/pcre/tests/preg_split_error1.phpt @@ -20,10 +20,18 @@ $regex_array = array('abcdef', //Regex without delimiter $subject = '1 2 a 3 4 b 5 6'; foreach($regex_array as $regex_value) { print "\nArg value is $regex_value\n"; - var_dump(preg_split($regex_value, $subject)); + try { + var_dump(preg_split($regex_value, $subject)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } $regex_value = new stdclass(); //Object -var_dump(preg_split($regex_value, $subject)); +try { + var_dump(preg_split($regex_value, $subject)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- *** Testing preg_split() : error conditions *** @@ -49,9 +57,7 @@ Warning: preg_split(): Unknown modifier 'F' in %spreg_split_error1.php on line % bool(false) Arg value is Array - -Warning: preg_split() expects parameter 1 to be string, array given in %spreg_split_error1.php on line %d -bool(false) +preg_split() expects parameter 1 to be string, array given Arg value is /[a-zA-Z]/ array(3) { @@ -62,6 +68,4 @@ array(3) { [2]=> string(4) " 5 6" } - -Warning: preg_split() expects parameter 1 to be string, object given in %spreg_split_error1.php on line %d -bool(false) +preg_split() expects parameter 1 to be string, object given diff --git a/ext/pcre/tests/split.phpt b/ext/pcre/tests/split.phpt index c87d1b03a9137..df4b9af92f2f9 100644 --- a/ext/pcre/tests/split.phpt +++ b/ext/pcre/tests/split.phpt @@ -3,7 +3,6 @@ preg_split() --FILE-- --EXPECTF-- -Warning: preg_split() expects at least 2 parameters, 0 given in %ssplit.php on line 3 -bool(false) - -Warning: preg_split(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %ssplit.php on line 4 +Warning: preg_split(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %ssplit.php on line %d bool(false) array(3) { [0]=> diff --git a/ext/pcre/tests/split2.phpt b/ext/pcre/tests/split2.phpt index b0411e6df2dc1..f4fd60022e1ed 100644 --- a/ext/pcre/tests/split2.phpt +++ b/ext/pcre/tests/split2.phpt @@ -13,7 +13,6 @@ var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPL var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE)); -var_dump(preg_last_error(1)); ini_set('pcre.recursion_limit', 1); var_dump(preg_last_error() == PREG_NO_ERROR); var_dump(preg_split('/(\d*)/', 'ab2c3u')); @@ -306,9 +305,6 @@ array(6) { int(5) } } - -Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d -NULL bool(true) array(1) { [0]=> diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 5805a05686500..41d7df817dae7 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -209,7 +209,7 @@ static PHP_METHOD(PDO, dbh_constructor) int call_factory = 1; zend_error_handling zeh; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 4) + ZEND_PARSE_PARAMETERS_START(1, 4) Z_PARAM_STRING(data_source, data_source_len) Z_PARAM_OPTIONAL Z_PARAM_STRING_EX(username, usernamelen, 1, 0) diff --git a/ext/pdo/tests/bug_44173.phpt b/ext/pdo/tests/bug_44173.phpt index aab73d87a6e21..7d4111144f641 100644 --- a/ext/pdo/tests/bug_44173.phpt +++ b/ext/pdo/tests/bug_44173.phpt @@ -18,11 +18,6 @@ $db->exec("CREATE TABLE test (x int)"); $db->exec("INSERT INTO test VALUES (1)"); -// Bug entry [1] -$stmt = $db->query(); -var_dump($stmt); - - // Bug entry [2] -- 1 is PDO::FETCH_LAZY $stmt = $db->query("SELECT * FROM test", PDO::FETCH_LAZY, 0, 0); var_dump($stmt); @@ -55,9 +50,6 @@ var_dump($stmt); ?> --EXPECTF-- -Warning: PDO::query() expects at least 1 parameter, 0 given in %s -bool(false) - Warning: PDO::query(): SQLSTATE[HY000]: General error: fetch mode doesn't allow any extra arguments in %s bool(false) diff --git a/ext/pdo/tests/pdo_drivers_error.phpt b/ext/pdo/tests/pdo_drivers_error.phpt deleted file mode 100644 index 5a371f02bc811..0000000000000 --- a/ext/pdo/tests/pdo_drivers_error.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Test that PDO::getAvailableDrivers / pdo_drivers does not accept any parameters ---CREDITS-- -Amo Chohan ---SKIPIF-- -getAttribute(PDO::ATTR_STATEMENT_CLASS); var_dump($default); - if (false !== ($tmp = @$db->setAttribute(PDO::ATTR_STATEMENT_CLASS))) - printf("[001] Expecting boolean/false got %s\n", var_export($tmp, true)); - if (false !== ($tmp = @$db->setAttribute(PDO::ATTR_STATEMENT_CLASS, 'foo'))) printf("[002] Expecting boolean/false got %s\n", var_export($tmp, true)); diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt index 10ccba22911bc..07ad3d9d33a4b 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt @@ -30,22 +30,11 @@ try { printf("[002] Expecting false got %s\n", var_export($tmp, true)); $stmt->execute(); - // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 0 given in - if (false !== ($tmp = @$stmt->getColumnMeta())) - printf("[003] Expecting false got %s\n", var_export($tmp, true)); // invalid offset if (false !== ($tmp = @$stmt->getColumnMeta(-1))) printf("[004] Expecting false got %s\n", var_export($tmp, true)); - // Warning: PDOStatement::getColumnMeta() expects parameter 1 to be int, array given in - if (false !== ($tmp = @$stmt->getColumnMeta(array()))) - printf("[005] Expecting false got %s\n", var_export($tmp, true)); - - // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 2 given in - if (false !== ($tmp = @$stmt->getColumnMeta(1, 1))) - printf("[006] Expecting false got %s\n", var_export($tmp, true)); - $emulated = $stmt->getColumnMeta(0); printf("Testing native PS...\n"); diff --git a/ext/pgsql/tests/01createdb.phpt b/ext/pgsql/tests/01createdb.phpt index aa2e43748fae9..45062c3b49302 100644 --- a/ext/pgsql/tests/01createdb.phpt +++ b/ext/pgsql/tests/01createdb.phpt @@ -9,7 +9,7 @@ PostgreSQL create db include('config.inc'); $db = pg_connect($conn_str); -if (!@pg_num_rows(@pg_query($db, "SELECT * FROM ".$table_name))) +if (!($q = @pg_query($db, "SELECT * FROM ".$table_name)) || !@pg_num_rows($q)) { pg_query($db,$table_def); // Create table here for ($i=0; $i < $num_test_record; $i++) { @@ -21,7 +21,7 @@ else { } $v = pg_version(); -if (version_compare($v['server'], '9.2', '>=') && !@pg_num_rows(@pg_query($db, "SELECT * FROM ".$table_name_92))) +if (version_compare($v['server'], '9.2', '>=') && (!($q = @pg_query($db, "SELECT * FROM ".$table_name_92)) || !@pg_num_rows($q))) { pg_query($db,$table_def_92); // Create table here } diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt index 41cb9be716d68..cfd8cc5e66eea 100644 --- a/ext/phar/tests/002.phpt +++ b/ext/phar/tests/002.phpt @@ -5,13 +5,17 @@ Phar::mapPhar truncated manifest/improper params --FILE-- getMessage(), "\n"; +} -Phar::mapPhar(); +try { + Phar::mapPhar(); } catch (Exception $e) { - echo $e->getMessage(); + echo $e->getMessage(), "\n"; } __HALT_COMPILER(); ?> --EXPECTF-- -Warning: Phar::mapPhar() expects at most 2 parameters, 3 given in %s002.php on line %d +Phar::mapPhar() expects at most 2 parameters, 3 given internal corruption of phar "%s002.php" (truncated manifest at manifest length) diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index e8ddb1f62a894..bf9c5d5696869 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -8,200 +8,263 @@ phar.readonly=0 getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n"; +try { + Phar::mungServer('hi'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + Phar::createDefaultStub(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + Phar::loadPhar(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + Phar::canCompress('hi'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } - -Phar::mungServer('hi'); -Phar::createDefaultStub(array()); -Phar::loadPhar(array()); -Phar::canCompress('hi'); try { $a = new Phar(array()); } catch (TypeError $e) { - print_exception($e); + echo $e->getMessage(), "\n"; } try { $a = new Phar(dirname(__FILE__) . '/files/frontcontroller10.phar'); } catch (PharException $e) { - print_exception($e); + echo $e->getMessage(), "\n"; +} +try { + $a->convertToExecutable(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->convertToData(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->convertToExecutable(array()); -$a->convertToData(array()); try { $b = new PharData(dirname(__FILE__) . '/whatever.tar'); } catch (PharException $e) { - print_exception($e); + echo $e->getMessage(), "\n"; } try { $c = new PharData(dirname(__FILE__) . '/whatever.zip'); } catch (PharException $e) { - print_exception($e); + echo $e->getMessage(), "\n"; } -$b->delete(array()); try { -$a->delete('oops'); + $b->delete(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->delete('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$b->delete('oops'); + $b->delete('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + echo $a->getPath() . "\n"; +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -echo $a->getPath() . "\n"; try { -$a->setAlias('oops'); + $a->setAlias('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$b->setAlias('oops'); + $b->setAlias('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ini_set('phar.readonly', 0); -$a->setAlias(array()); +try { + $a->setAlias(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); try { -$b->stopBuffering(); + $b->stopBuffering(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$a->setStub('oops'); + $a->setStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$b->setStub('oops'); + $b->setStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ini_set('phar.readonly', 0); -$a->setStub(array()); +try { + $a->setStub(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); try { -$b->setDefaultStub('oops'); + $b->setDefaultStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->setDefaultStub(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->setDefaultStub(array()); try { -$a->setDefaultStub('oops'); + $a->setDefaultStub('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$a->setSignatureAlgorithm(Phar::MD5); + $a->setSignatureAlgorithm(Phar::MD5); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } -$a->compress(array()); try { -$a->compress(1); + $a->compress(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->compress(1); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->compressFiles(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->compressFiles(array()); try { -$a->decompressFiles(); + $a->decompressFiles(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } -$a->copy(array()); try { -$a->copy('a', 'b'); + $a->copy(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->copy('a', 'b'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->offsetExists(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->offsetGet(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->offsetExists(array()); -$a->offsetGet(array()); ini_set('phar.readonly', 0); -$a->offsetSet(array()); +try { + $a->offsetSet(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); -$b->offsetUnset(array()); try { -$a->offsetUnset('a'); + $b->offsetUnset(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->offsetUnset('a'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; +} +try { + $a->addEmptyDir(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->addFile(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -$a->addEmptyDir(array()); -$a->addFile(array()); -$a->addFromString(array()); try { -$a->setMetadata('a'); + $a->addFromString(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $a->setMetadata('a'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ini_set('phar.readonly', 0); -$a->setMetadata(1,2); +try { + $a->setMetadata(1,2); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ini_set('phar.readonly', 1); try { -$a->delMetadata(); + $a->delMetadata(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> ===DONE=== --EXPECTF-- -Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d - -Warning: Phar::createDefaultStub() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::loadPhar() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::canCompress() expects parameter 1 to be int, string given in %sbadparameters.php on line %d - -Exception: Phar::__construct() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::convertToExecutable() expects parameter 1 to be int, array given in %sbadparameters.php on line %d - -Warning: Phar::convertToData() expects parameter 1 to be int, array given in %sbadparameters.php on line %d - -Warning: PharData::delete() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d +Phar::mungServer() expects parameter 1 to be array, string given +Phar::createDefaultStub() expects parameter 1 to be a valid path, array given +Phar::loadPhar() expects parameter 1 to be a valid path, array given +Phar::canCompress() expects parameter 1 to be int, string given +Phar::__construct() expects parameter 1 to be a valid path, array given +Phar::convertToExecutable() expects parameter 1 to be int, array given +Phar::convertToData() expects parameter 1 to be int, array given +PharData::delete() expects parameter 1 to be a valid path, array given Cannot write out phar archive, phar is read-only Entry oops does not exist and cannot be deleted -%sfiles/frontcontroller10.phar +%sfrontcontroller10.phar Cannot write out phar archive, phar is read-only A Phar alias cannot be set in a plain tar archive - -Warning: Phar::setAlias() expects parameter 1 to be %string, array given in %sbadparameters.php on line %d +Phar::setAlias() expects parameter 1 to be string, array given Cannot change stub, phar is read-only A Phar stub cannot be set in a plain tar archive - -Warning: Phar::setStub() expects parameter 1 to be %string, array given in %sbadparameters.php on line %d +Phar::setStub() expects parameter 1 to be string, array given A Phar stub cannot be set in a plain tar archive - -Warning: Phar::setDefaultStub() expects parameter 1 to be %string, array given in %sbadparameters.php on line %d +Phar::setDefaultStub() expects parameter 1 to be string, array given Cannot change stub: phar.readonly=1 Cannot set signature algorithm, phar is read-only - -Warning: Phar::compress() expects parameter 1 to be int, array given in %sbadparameters.php on line %d +Phar::compress() expects parameter 1 to be int, array given Cannot compress phar archive, phar is read-only - -Warning: Phar::compressFiles() expects parameter 1 to be int, array given in %sbadparameters.php on line %d +Phar::compressFiles() expects parameter 1 to be int, array given Phar is readonly, cannot change compression - -Warning: Phar::copy() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d +Phar::copy() expects exactly 2 parameters, 1 given Cannot copy "a" to "b", phar is read-only - -Warning: Phar::offsetExists() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::offsetGet() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::offsetSet() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d - -Warning: PharData::offsetUnset() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d +Phar::offsetExists() expects parameter 1 to be a valid path, array given +Phar::offsetGet() expects parameter 1 to be a valid path, array given +Phar::offsetSet() expects exactly 2 parameters, 1 given +PharData::offsetUnset() expects parameter 1 to be a valid path, array given Write operations disabled by the php.ini setting phar.readonly - -Warning: Phar::addEmptyDir() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::addFile() expects parameter 1 to be a valid path, array given in %sbadparameters.php on line %d - -Warning: Phar::addFromString() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d +Phar::addEmptyDir() expects parameter 1 to be a valid path, array given +Phar::addFile() expects parameter 1 to be a valid path, array given +Phar::addFromString() expects exactly 2 parameters, 1 given Write operations disabled by the php.ini setting phar.readonly - -Warning: Phar::setMetadata() expects exactly 1 parameter, 2 given in %sbadparameters.php on line %d +Phar::setMetadata() expects exactly 1 parameter, 2 given Write operations disabled by the php.ini setting phar.readonly ===DONE=== diff --git a/ext/phar/tests/bug64931/bug64931.phpt b/ext/phar/tests/bug64931/bug64931.phpt index 4439fcf792f65..aa2d17182cbe9 100644 --- a/ext/phar/tests/bug64931/bug64931.phpt +++ b/ext/phar/tests/bug64931/bug64931.phpt @@ -38,7 +38,7 @@ try { try { $phar->addFromString(".phar\0", "gotcha"); -} catch (Exception $e) { +} catch (TypeError $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } @@ -54,6 +54,5 @@ CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory - -Warning: Phar::addFromString() expects parameter 1 to be a valid path, string given in %s%ebug64931.php on line %d +CAUGHT: Phar::addFromString() expects parameter 1 to be a valid path, string given ===DONE=== diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt index fd200d8613d64..c10d19c711663 100644 --- a/ext/phar/tests/create_path_error.phpt +++ b/ext/phar/tests/create_path_error.phpt @@ -53,7 +53,7 @@ foreach($checks as $check) { $phar[$check] = 'error'; } - catch(Exception $e) + catch (TypeError $e) { echo 'Exception: ' . $e->getMessage() . "\n"; } @@ -79,4 +79,5 @@ string(5) "query" 11:Error: file_put_contents(phar://%s): failed to open stream: phar error: invalid path "%s" contains illegal character 12:Error: file_put_contents(phar://%s): failed to open stream: phar error: invalid path "%s" contains illegal character 13:Error: file_put_contents(phar://%s): failed to open stream: phar error: invalid path "%s" contains illegal character -Error: Phar::offsetSet() expects parameter 1 to be a valid path, string given===DONE=== +Exception: Phar::offsetSet() expects parameter 1 to be a valid path, string given +===DONE=== diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt index b75601a07b64c..d061cf3c91842 100644 --- a/ext/phar/tests/fgc_edgecases.phpt +++ b/ext/phar/tests/fgc_edgecases.phpt @@ -14,7 +14,11 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -file_get_contents(array()); +try { + file_get_contents(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} chdir(dirname(__FILE__)); file_put_contents($fname, "blah\n"); file_put_contents("foob", "test\n"); @@ -46,7 +50,7 @@ include $pname . '/foo/hi'; --EXPECTF-- -Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %sfgc_edgecases.php on line %d +file_get_contents() expects parameter 1 to be a valid path, array given blah --EXPECTF-- -Warning: fopen() expects at least 2 parameters, 0 given in %sfopen.php on line %d hihi Warning: fopen(notfound.txt): failed to open stream: No such file or directory in phar://%sfopen.phar.php/index.php on line %d ===DONE=== diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt index 4ac529a4e00f0..2c70e17352d45 100644 --- a/ext/phar/tests/fopen_edgecases2.phpt +++ b/ext/phar/tests/fopen_edgecases2.phpt @@ -10,7 +10,11 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -fopen(array(), 'r'); +try { + fopen(array(), 'r'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} chdir(dirname(__FILE__)); file_put_contents($fname, "blah\n"); file_put_contents("foob", "test\n"); @@ -35,7 +39,7 @@ include $pname . '/foo/hi'; --EXPECTF-- -Warning: fopen() expects parameter 1 to be a valid path, array given in %sfopen_edgecases2.php on line %d +fopen() expects parameter 1 to be a valid path, array given blah test diff --git a/ext/phar/tests/open_for_write_existing_b.phpt b/ext/phar/tests/open_for_write_existing_b.phpt index ce59d9824f943..edd5a65048e9d 100644 --- a/ext/phar/tests/open_for_write_existing_b.phpt +++ b/ext/phar/tests/open_for_write_existing_b.phpt @@ -19,9 +19,7 @@ $files['b.php'] = ''; $files['b/c.php'] = ''; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/c.php', 'wb')); include $pname . '/b/c.php'; ?> ===DONE=== @@ -29,9 +27,6 @@ include $pname . '/b/c.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/open_for_write_existing_c.phpt b/ext/phar/tests/open_for_write_existing_c.phpt index eb0c27bf64815..5c389956fa7e5 100644 --- a/ext/phar/tests/open_for_write_existing_c.phpt +++ b/ext/phar/tests/open_for_write_existing_c.phpt @@ -19,9 +19,7 @@ $files['b.php'] = ''; $files['b/c.php'] = ''; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/c.php', 'wb')); include $pname . '/b/c.php'; ?> ===DONE=== @@ -29,9 +27,6 @@ include $pname . '/b/c.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 53b31e03d504b..775b90b1bbc8b 100644 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt @@ -19,9 +19,7 @@ $files['b.php'] = ''; $files['b/c.php'] = ''; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/new.php', 'wb')); include $pname . '/b/c.php'; include $pname . '/b/new.php'; ?> @@ -31,10 +29,7 @@ include $pname . '/b/new.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index 8275c02baa73c..2b313ebf90fe3 100644 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt @@ -19,9 +19,7 @@ $files['b.php'] = ''; $files['b/c.php'] = ''; include 'files/phar_test.inc'; -$fp = fopen($pname . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($pname . '/b/new.php', 'wb')); include $pname . '/b/c.php'; include $pname . '/b/new.php'; ?> @@ -31,10 +29,7 @@ include $pname . '/b/new.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt index be899df81b7a6..68ea62d3c3b68 100644 --- a/ext/phar/tests/opendir_edgecases.phpt +++ b/ext/phar/tests/opendir_edgecases.phpt @@ -12,7 +12,11 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -opendir(array()); +try { + opendir(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} mkdir(dirname(__FILE__) . '/poo'); chdir(dirname(__FILE__)); @@ -52,7 +56,7 @@ include $pname . '/foo'; isFileFormat(Phar::PHAR)); var_dump($b->isCompressed() == Phar::BZ2); // additional code coverage -$b->isFileFormat(array()); try { $b->isFileFormat(25); } catch (Exception $e) { @@ -58,7 +57,5 @@ string(9) "it worked" string(%d) "phar://%sphar_bz2.phar/tar_004.php" bool(true) bool(true) - -Warning: Phar::isFileFormat() expects parameter 1 to be int, array given in %sphar_bz2.php on line %d Unknown file format specified ===DONE=== diff --git a/ext/phar/tests/phar_decompress.phpt b/ext/phar/tests/phar_decompress.phpt index 3344d9bbbd4ac..3a76fb12e895b 100644 --- a/ext/phar/tests/phar_decompress.phpt +++ b/ext/phar/tests/phar_decompress.phpt @@ -32,18 +32,17 @@ $unc2 = $gz->decompress(); echo $unc2->getPath() . "\n"; $unc3 = $gz->decompress('hooba.phar'); echo $unc3->getPath() . "\n"; -$gz->decompress(array()); $zip = $phar->convertToData(Phar::ZIP); ini_set('phar.readonly', 1); try { -$gz->decompress(); + $gz->decompress(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { -$zip->decompress(); + $zip->decompress(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> ===DONE=== @@ -62,8 +61,6 @@ int(4096) %sphar_decompress2.phar %sphar_decompress.phar %sphar_decompress.hooba.phar - -Warning: Phar::decompress() expects parameter 1 to be %string, array given in %sphar_decompress.php on line %d Cannot decompress phar archive, phar is read-only Cannot decompress zip-based archives with whole-archive compression ===DONE=== diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index f7d1403d599a3..2d1091dbac708 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -48,7 +48,11 @@ try { echo $e->getMessage(), "\n"; } -$a->extractTo(array()); +try { + $a->extractTo(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} try { $a->extractTo(''); @@ -137,8 +141,7 @@ string(3) "hi3" string(3) "hi2" bool(false) Invalid argument, expected a filename (string) or array of filenames - -Warning: Phar::extractTo() expects parameter 1 to be a valid path, array given in %sphar_extract.php on line %d +Phar::extractTo() expects parameter 1 to be a valid path, array given Invalid argument, extraction path must be non-zero length Unable to use path "%soops" for extraction, it is a file, must be a directory Invalid argument, array of filenames to extract contains non-string value diff --git a/ext/phar/tests/phar_isvalidpharfilename.phpt b/ext/phar/tests/phar_isvalidpharfilename.phpt index a59f498b95979..84d2e757e9b9c 100644 --- a/ext/phar/tests/phar_isvalidpharfilename.phpt +++ b/ext/phar/tests/phar_isvalidpharfilename.phpt @@ -7,8 +7,6 @@ phar.readonly=1 --FILE-- setFileClass('SplFileInfo'); } -catch (UnexpectedValueException $e) +catch (TypeError $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/phar/tests/phar_running.phpt b/ext/phar/tests/phar_running.phpt index 25acf82285f6e..194946b498fbb 100644 --- a/ext/phar/tests/phar_running.phpt +++ b/ext/phar/tests/phar_running.phpt @@ -11,7 +11,6 @@ $pname = 'phar://' . $fname; $phar = new Phar($fname); $phar['index.php'] = ''; @@ -22,7 +21,6 @@ var_dump(Phar::running()); --CLEAN-- --EXPECTF-- -Warning: Phar::running() expects parameter 1 to be bool, array given in phar://%sphar_running.phar.php/index.php on line 2 string(%d) "phar://%sphar_running.phar.php" string(%d) "%sphar_running.phar.php" string(0) "" diff --git a/ext/phar/tests/phar_unlinkarchive.phpt b/ext/phar/tests/phar_unlinkarchive.phpt index 98001fcbf08b5..9e7d0f2383401 100644 --- a/ext/phar/tests/phar_unlinkarchive.phpt +++ b/ext/phar/tests/phar_unlinkarchive.phpt @@ -28,7 +28,11 @@ Phar::unlinkArchive($pdname); } catch (Exception $e) { echo $e->getMessage(),"\n"; } -Phar::unlinkArchive(array()); +try { + Phar::unlinkArchive(array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} $pname = 'phar://' . $fname; $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip'; @@ -89,8 +93,7 @@ __HALT_COMPILER(); Unknown phar archive "" Unknown phar archive "%sphar_unlinkarchive.phar" Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry) - -Warning: Phar::unlinkArchive() expects parameter 1 to be a valid path, array given in %sphar_unlinkarchive.php on line %d +Phar::unlinkArchive() expects parameter 1 to be a valid path, array given bool(false) string(48) "" phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive() diff --git a/ext/phar/tests/pharfileinfo_chmod.phpt b/ext/phar/tests/pharfileinfo_chmod.phpt index 23ce5c914ae0e..6a6b07b4d1d66 100644 --- a/ext/phar/tests/pharfileinfo_chmod.phpt +++ b/ext/phar/tests/pharfileinfo_chmod.phpt @@ -19,7 +19,6 @@ $phar['a']->chmod(066); } catch (Exception $e) { echo $e->getMessage(), "\n"; } -$b->chmod(array()); lstat($pname . '/a/b'); // sets BG(CurrentLStatFile) $b->chmod(0666); ?> @@ -28,6 +27,4 @@ $b->chmod(0666); --EXPECTF-- Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod - -Warning: PharFileInfo::chmod() expects parameter 1 to be int, array given in %spharfileinfo_chmod.php on line %d ===DONE=== diff --git a/ext/phar/tests/pharfileinfo_compression.phpt b/ext/phar/tests/pharfileinfo_compression.phpt index 9f5480be4f79e..dbf9e8fa389a9 100644 --- a/ext/phar/tests/pharfileinfo_compression.phpt +++ b/ext/phar/tests/pharfileinfo_compression.phpt @@ -17,7 +17,6 @@ $phar['a/b'] = 'hi there'; $b = $phar['a/b']; -$b->isCompressed(array()); try { $b->isCompressed(25); } catch (Exception $e) { @@ -76,7 +75,6 @@ var_dump($b->decompress()); --EXPECTF-- -Warning: PharFileInfo::isCompressed() expects parameter 1 to be int, array given in %spharfileinfo_compression.php on line 11 Unknown compression type specified Unknown compression type specified Cannot compress with Gzip compression, not possible with tar-based phar archives diff --git a/ext/phar/tests/pharfileinfo_setmetadata.phpt b/ext/phar/tests/pharfileinfo_setmetadata.phpt index 8fb6935f2679e..1dc3ab911837b 100644 --- a/ext/phar/tests/pharfileinfo_setmetadata.phpt +++ b/ext/phar/tests/pharfileinfo_setmetadata.phpt @@ -36,8 +36,6 @@ $b->delMetadata(); } catch (Exception $e) { echo $e->getMessage(), "\n"; } -ini_set('phar.readonly', 0); -$b->setMetadata(1,2,3); ?> ===DONE=== --CLEAN-- @@ -48,6 +46,4 @@ Phar entry is a temporary directory (not an actual entry in the archive), cannot Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata Write operations disabled by the php.ini setting phar.readonly Write operations disabled by the php.ini setting phar.readonly - -Warning: PharFileInfo::setMetadata() expects exactly 1 parameter, 3 given in %spharfileinfo_setmetadata.php on line %d ===DONE=== diff --git a/ext/phar/tests/readfile_edgecases.phpt b/ext/phar/tests/readfile_edgecases.phpt index f6a0dc65b94a3..20617c6b280b4 100644 --- a/ext/phar/tests/readfile_edgecases.phpt +++ b/ext/phar/tests/readfile_edgecases.phpt @@ -10,7 +10,6 @@ Phar::interceptFileFuncs(); $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; $pname = 'phar://' . $fname; -readfile(array()); chdir(dirname(__FILE__)); file_put_contents($fname, "blah\n"); file_put_contents("foob", "test\n"); @@ -35,7 +34,6 @@ include $pname . '/foo/hi'; --EXPECTF-- -Warning: readfile() expects parameter 1 to be a valid path, array given in %sreadfile_edgecases.php on line %d blah --EXPECTF-- -Warning: is_file() expects exactly 1 parameter, 0 given in %sstat2_5.3.php on line %d - -Warning: is_link() expects exactly 1 parameter, 0 given in %sstat2_5.3.php on line %d bool(true) is_link bool(false) diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index 4c67def631e8f..0bd97d55ba5db 100644 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; @@ -42,10 +40,7 @@ include $alias . '/b/c.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_b.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_existing_b.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index 9e73f1e8997d2..d3c12b8e05a73 100644 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; @@ -42,10 +40,7 @@ include $alias . '/b/c.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_c.phar.tar/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index 5c57587234228..657782fb389c6 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -43,10 +41,7 @@ include $alias . '/b/new.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index b5078426fe2d0..0a65086cc7c8d 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt @@ -29,9 +29,7 @@ foreach ($files as $n => $file) { $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -42,10 +40,7 @@ include $alias . '/b/new.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/zip/open_for_write_existing_b.phpt b/ext/phar/tests/zip/open_for_write_existing_b.phpt index 789067eb29a33..9527583b193b5 100644 --- a/ext/phar/tests/zip/open_for_write_existing_b.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_b.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; ?> ===DONE=== @@ -39,9 +37,6 @@ include $alias . '/b/c.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_b.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_b.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_existing_c.phpt b/ext/phar/tests/zip/open_for_write_existing_c.phpt index adcb50ff93837..a115985ca345c 100644 --- a/ext/phar/tests/zip/open_for_write_existing_c.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_c.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/c.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/c.php', 'wb')); include $alias . '/b/c.php'; ?> ===DONE=== @@ -39,9 +37,6 @@ include $alias . '/b/c.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_existing_c.phar.zip/b/c.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %spen_for_write_existing_c.php on line %d +bool(false) This is b/c ===DONE=== diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt index 134bb4f0dd007..30e33293afbd6 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -42,10 +40,7 @@ include $alias . '/b/new.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_b.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.zip" in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt index 86e33da7c9607..415547d5a1619 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt @@ -29,9 +29,7 @@ $phar->stopBuffering(); ini_set('phar.readonly', 1); -$fp = fopen($alias . '/b/new.php', 'wb'); -fwrite($fp, 'extra'); -fclose($fp); +var_dump(fopen($alias . '/b/new.php', 'wb')); include $alias . '/b/c.php'; include $alias . '/b/new.php'; @@ -42,10 +40,7 @@ include $alias . '/b/new.php'; --EXPECTF-- Warning: fopen(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d - -Warning: fwrite() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d - -Warning: fclose() expects parameter 1 to be resource, bool given in %sopen_for_write_newfile_c.php on line %d +bool(false) This is b/c Warning: include(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.zip" in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/posix/tests/posix_errno_error.phpt b/ext/posix/tests/posix_errno_error.phpt deleted file mode 100644 index 0a77fb0009e81..0000000000000 --- a/ext/posix/tests/posix_errno_error.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test function posix_errno() by calling it with its expected arguments ---SKIPIF-- - ---CREDITS-- -Morten Amundsen mor10am@gmail.com -Francesco Fullone ff@ideato.it -#PHPTestFest Cesena Italia on 2009-06-20 ---FILE-- - ---EXPECTF-- -*** Test by calling method or function with more than expected arguments *** - -Warning: posix_errno() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/posix/tests/posix_getcwd.phpt b/ext/posix/tests/posix_getcwd.phpt index 20f7b0372e7a2..f6f180925a17b 100644 --- a/ext/posix/tests/posix_getcwd.phpt +++ b/ext/posix/tests/posix_getcwd.phpt @@ -9,11 +9,7 @@ if (!function_exists('posix_getcwd')) die('skip posix_getcwd() not found'); --EXPECTF-- string(%d) "%s" - -Warning: posix_getcwd() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/posix/tests/posix_getgrgid_error.phpt b/ext/posix/tests/posix_getgrgid_error.phpt index ef7fa57a9dbfc..e9dbe2a6ce6f3 100644 --- a/ext/posix/tests/posix_getgrgid_error.phpt +++ b/ext/posix/tests/posix_getgrgid_error.phpt @@ -14,17 +14,6 @@ Test posix_getgrgid() function : error conditions echo "*** Testing posix_getgrgid() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing posix_getgrgid() function with Zero arguments --\n"; -var_dump( posix_getgrgid() ); - -//Test posix_getgrgid with one more than the expected number of arguments -echo "\n-- Testing posix_getgrgid() function with more than expected no. of arguments --\n"; - -$extra_arg = 10; -$gid = 0; -var_dump( posix_getgrgid($gid, $extra_arg) ); - echo "\n-- Testing posix_getgrgid() function with a negative group id --\n"; $gid = -999; var_dump( posix_getgrgid($gid)); @@ -34,16 +23,6 @@ echo "Done"; --EXPECTF-- *** Testing posix_getgrgid() : error conditions *** --- Testing posix_getgrgid() function with Zero arguments -- - -Warning: posix_getgrgid() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing posix_getgrgid() function with more than expected no. of arguments -- - -Warning: posix_getgrgid() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing posix_getgrgid() function with a negative group id -- bool(false) Done diff --git a/ext/posix/tests/posix_getpgid_error.phpt b/ext/posix/tests/posix_getpgid_error.phpt index 88d68554ee72d..19e306b2eeb15 100644 --- a/ext/posix/tests/posix_getpgid_error.phpt +++ b/ext/posix/tests/posix_getpgid_error.phpt @@ -16,14 +16,6 @@ if((!extension_loaded("posix")) || (!function_exists("posix_getpgid"))) { echo "*** Testing posix_getpgid() : error conditions ***\n"; -echo "\n-- Testing posix_getpgid() function no arguments --\n"; -var_dump( posix_getpgid() ); - -echo "\n-- Testing posix_getpgid() with one extra argument --\n"; -$pid = 10; -$extra_arg = 20; -var_dump( posix_getpgid($pid, $extra_arg) ); - echo "\n-- Testing posix_getpgid() with negative pid --\n"; $pid = -99; var_dump( posix_getpgid($pid) ); @@ -33,16 +25,6 @@ echo "Done"; --EXPECTF-- *** Testing posix_getpgid() : error conditions *** --- Testing posix_getpgid() function no arguments -- - -Warning: posix_getpgid() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing posix_getpgid() with one extra argument -- - -Warning: posix_getpgid() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing posix_getpgid() with negative pid -- bool(false) Done diff --git a/ext/posix/tests/posix_getpwuid_error.phpt b/ext/posix/tests/posix_getpwuid_error.phpt index 440edf6a769d6..365033b6897f4 100644 --- a/ext/posix/tests/posix_getpwuid_error.phpt +++ b/ext/posix/tests/posix_getpwuid_error.phpt @@ -14,14 +14,6 @@ Test posix_getpwuid() function : error conditions echo "*** Testing posix_getpwuid() : error conditions ***\n"; -echo "\n-- Testing posix_getpwuid() function with Zero arguments --\n"; -var_dump( posix_getpwuid() ); - -echo "\n-- Testing posix_getpwuid() function with more than expected no. of arguments --\n"; -$uid = posix_getuid(); -$extra_arg = 10; -var_dump( posix_getpwuid($uid, $extra_arg) ); - echo "\n-- Testing posix_getpwuid() function negative uid --\n"; $uid = -99; var_dump( posix_getpwuid($uid) ); @@ -31,16 +23,6 @@ echo "Done"; --EXPECTF-- *** Testing posix_getpwuid() : error conditions *** --- Testing posix_getpwuid() function with Zero arguments -- - -Warning: posix_getpwuid() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing posix_getpwuid() function with more than expected no. of arguments -- - -Warning: posix_getpwuid() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing posix_getpwuid() function negative uid -- bool(false) Done diff --git a/ext/posix/tests/posix_getsid_error.phpt b/ext/posix/tests/posix_getsid_error.phpt index 6013a40b9637a..833ae9a0dbcde 100644 --- a/ext/posix/tests/posix_getsid_error.phpt +++ b/ext/posix/tests/posix_getsid_error.phpt @@ -13,16 +13,9 @@ PHP Testfest Berlin 2009-05-10 ?> --FILE-- ===DONE=== --EXPECTF-- -Warning: posix_getsid() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: posix_getsid() expects parameter 1 to be int, array given in %s on line %d -bool(false) bool(false) ===DONE=== diff --git a/ext/posix/tests/posix_initgroups.phpt b/ext/posix/tests/posix_initgroups.phpt index 5b0ec8adadde4..20cf8cef8b336 100644 --- a/ext/posix/tests/posix_initgroups.phpt +++ b/ext/posix/tests/posix_initgroups.phpt @@ -8,11 +8,8 @@ if (!function_exists('posix_initgroups')) die('skip posix_initgroups() not found --FILE-- --EXPECTF-- -Warning: posix_initgroups() expects parameter 2 to be int, string given in %s on line %d -bool(false) bool(false) diff --git a/ext/posix/tests/posix_kill_error.phpt b/ext/posix/tests/posix_kill_error.phpt index 0c8f6ef642d46..89474c4994266 100644 --- a/ext/posix/tests/posix_kill_error.phpt +++ b/ext/posix/tests/posix_kill_error.phpt @@ -16,16 +16,6 @@ Test posix_kill() function : error conditions echo "*** Testing posix_kill() : error conditions ***\n"; -echo "\n-- Testing posix_kill() function with more than expected no. of arguments --\n"; -$pid = posix_getpid(); -$sig = 9; -$extra_arg = 10; -var_dump( posix_kill($pid, $sig, $extra_arg) ); - -echo "\n-- Testing posix_kill() function with less than expected no. of arguments --\n"; -$pid = posix_getpid(); -var_dump( posix_kill($pid) ); - echo "\n-- Testing posix_kill() function with invalid signal --\n"; $pid = posix_getpid(); $sig = 999; @@ -41,16 +31,6 @@ echo "Done"; --EXPECTF-- *** Testing posix_kill() : error conditions *** --- Testing posix_kill() function with more than expected no. of arguments -- - -Warning: posix_kill() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) - --- Testing posix_kill() function with less than expected no. of arguments -- - -Warning: posix_kill() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) - -- Testing posix_kill() function with invalid signal -- bool(false) diff --git a/ext/posix/tests/posix_seteuid_variation4.phpt b/ext/posix/tests/posix_seteuid_variation4.phpt deleted file mode 100644 index 4224bafa821e6..0000000000000 --- a/ext/posix/tests/posix_seteuid_variation4.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test function posix_seteuid() by substituting argument 1 with float values. ---SKIPIF-- - ---CREDITS-- -Marco Fabbri mrfabbri@gmail.com -Francesco Fullone ff@ideato.it -#PHPTestFest Cesena Italia on 2009-06-20 ---FILE-- - $myUid, - 'float -'.$myUid => -$myUid, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - ); - - -foreach ( $variation_array as $var ) { - var_dump(posix_seteuid( $var ) ); -} -?> ---EXPECTF-- -*** Test substituting argument 1 with float values *** -bool(false) -bool(false) - -Warning: posix_seteuid() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: posix_seteuid() expects parameter 1 to be int, float given in %s on line %d -bool(false) -bool(false) diff --git a/ext/posix/tests/posix_setgid_variation4.phpt b/ext/posix/tests/posix_setgid_variation4.phpt deleted file mode 100644 index d85b5a900a83d..0000000000000 --- a/ext/posix/tests/posix_setgid_variation4.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test function posix_setgid() by substituting argument 1 with float values. ---SKIPIF-- - ---CREDITS-- -Marco Fabbri mrfabbri@gmail.com -Francesco Fullone ff@ideato.it -#PHPTestFest Cesena Italia on 2009-06-20 ---FILE-- - 10.5, - 'float -10.5' => -10.5, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - ); - - -foreach ( $variation_array as $var ) { - var_dump(posix_setgid( $var ) ); -} -?> -===DONE=== ---EXPECTF-- -*** Test substituting argument 1 with float values *** -bool(false) -bool(false) - -Warning: posix_setgid() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: posix_setgid() expects parameter 1 to be int, float given in %s on line %d -bool(false) -bool(false) -===DONE=== diff --git a/ext/posix/tests/posix_setuid_variation4.phpt b/ext/posix/tests/posix_setuid_variation4.phpt deleted file mode 100644 index 7423ba324eb0b..0000000000000 --- a/ext/posix/tests/posix_setuid_variation4.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test function posix_setuid() by substituting argument 1 with float values. ---SKIPIF-- - ---CREDITS-- -Marco Fabbri mrfabbri@gmail.com -Francesco Fullone ff@ideato.it -#PHPTestFest Cesena Italia on 2009-06-20 ---FILE-- - $myUid, - 'float -'.$myUid => -$myUid, - 'float 12.3456789000e10' => 12.3456789000e10, - 'float -12.3456789000e10' => -12.3456789000e10, - 'float .5' => .5, - ); - - -foreach ( $variation_array as $var ) { - var_dump(posix_setuid( $var ) ); -} -?> ---EXPECTF-- -*** Test substituting argument 1 with float values *** -bool(false) -bool(false) - -Warning: posix_setuid() expects parameter 1 to be int, float given in %s on line %d -bool(false) - -Warning: posix_setuid() expects parameter 1 to be int, float given in %s on line %d -bool(false) -bool(false) diff --git a/ext/posix/tests/posix_strerror_error.phpt b/ext/posix/tests/posix_strerror_error.phpt index 3007f976c6377..60b096656a2c4 100644 --- a/ext/posix/tests/posix_strerror_error.phpt +++ b/ext/posix/tests/posix_strerror_error.phpt @@ -14,14 +14,6 @@ Test posix_strerror() function : error conditions echo "*** Testing posix_strerror() : error conditions ***\n"; -echo "\n-- Testing posix_strerror() function with Zero arguments --\n"; -var_dump( posix_strerror() ); - -echo "\n-- Testing posix_strerror() function with more than expected no. of arguments --\n"; -$errno = posix_get_last_error(); -$extra_arg = 10; -var_dump( posix_strerror($errno, $extra_arg) ); - echo "\n-- Testing posix_strerror() function with invalid error number --\n"; $errno = -999; echo gettype( posix_strerror($errno) )."\n"; @@ -31,16 +23,6 @@ echo "Done"; --EXPECTF-- *** Testing posix_strerror() : error conditions *** --- Testing posix_strerror() function with Zero arguments -- - -Warning: posix_strerror() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing posix_strerror() function with more than expected no. of arguments -- - -Warning: posix_strerror() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing posix_strerror() function with invalid error number -- string Done diff --git a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt index 158a2d0ca7d0c..ba340db3001a8 100644 --- a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt +++ b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt @@ -20,14 +20,11 @@ PHP Testfest Berlin 2009-05-10 ?> --FILE-- ===DONE=== --EXPECTF-- -Warning: posix_ttyname() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) bool(false) Warning: posix_ttyname(): supplied resource is not a valid stream resource in %s on line %d diff --git a/ext/pspell/tests/002.phpt b/ext/pspell/tests/002.phpt index 1b0dc2cdfa151..538775d01344f 100644 --- a/ext/pspell/tests/002.phpt +++ b/ext/pspell/tests/002.phpt @@ -10,15 +10,12 @@ if (!@pspell_new('en')) die('skip English dictionary is not available'); $p = pspell_new('en'); -var_dump(pspell_check('a')); var_dump(pspell_check($p, 'somebogusword')); var_dump(pspell_add_to_session($p, '')); var_dump(pspell_add_to_session($p, 'somebogusword')); var_dump(pspell_check($p, 'somebogusword')); -var_dump(pspell_clear_session(new stdclass)); - $res = @pspell_clear_session($p); if ($res) { var_dump($res); @@ -29,14 +26,9 @@ if ($res) { } ?> --EXPECTF-- -Warning: pspell_check() expects exactly 2 parameters, 1 given in %s on line %d -NULL bool(false) bool(false) bool(true) bool(true) - -Warning: pspell_clear_session() expects parameter 1 to be int, object given in %s on line %d -NULL bool(true) bool(false) diff --git a/ext/readline/tests/libedit_callback_handler_install_001.phpt b/ext/readline/tests/libedit_callback_handler_install_001.phpt index b5d921e279621..fb69ba5cb0276 100644 --- a/ext/readline/tests/libedit_callback_handler_install_001.phpt +++ b/ext/readline/tests/libedit_callback_handler_install_001.phpt @@ -13,7 +13,6 @@ function foo() { var_dump(readline_callback_handler_install('testing: ', 'foo')); var_dump(readline_callback_handler_install('testing: ', 'foobar!')); -var_dump(readline_callback_handler_install('testing: ')); ?> --EXPECTF-- @@ -21,6 +20,3 @@ bool(true) Warning: readline_callback_handler_install(): foobar! is not callable in %s on line %d bool(false) - -Warning: readline_callback_handler_install() expects exactly 2 parameters, 1 given in %s on line %d -NULL diff --git a/ext/readline/tests/readline_add_history_001.phpt b/ext/readline/tests/readline_add_history_001.phpt index a4bd524736296..fe7c8c406e018 100644 --- a/ext/readline/tests/readline_add_history_001.phpt +++ b/ext/readline/tests/readline_add_history_001.phpt @@ -10,7 +10,6 @@ var_dump(readline_list_history()); var_dump(readline_add_history(NULL)); var_dump(readline_list_history()); var_dump(readline_clear_history()); -var_dump(readline_add_history()); ?> --EXPECTF-- @@ -27,6 +26,3 @@ array(2) { string(0) "" } bool(true) - -Warning: readline_add_history() expects exactly 1 parameter, 0 given in %s on line %d -NULL diff --git a/ext/readline/tests/readline_callback_handler_install_001.phpt b/ext/readline/tests/readline_callback_handler_install_001.phpt index cc054b0aa66fb..9dd13b4de15f1 100644 --- a/ext/readline/tests/readline_callback_handler_install_001.phpt +++ b/ext/readline/tests/readline_callback_handler_install_001.phpt @@ -13,7 +13,6 @@ function foo() { var_dump(readline_callback_handler_install('testing: ', 'foo')); var_dump(readline_callback_handler_install('testing: ', 'foobar!')); -var_dump(readline_callback_handler_install('testing: ')); ?> --EXPECTF-- @@ -21,6 +20,3 @@ var_dump(readline_callback_handler_install('testing: ')); Warning: readline_callback_handler_install(): foobar! is not callable in %s on line %d bool(false) - -Warning: readline_callback_handler_install() expects exactly 2 parameters, 1 given in %s on line %d -NULL diff --git a/ext/readline/tests/readline_clear_history_001.phpt b/ext/readline/tests/readline_clear_history_001.phpt index 5df1ae77a0066..8dea376ccf839 100644 --- a/ext/readline/tests/readline_clear_history_001.phpt +++ b/ext/readline/tests/readline_clear_history_001.phpt @@ -6,11 +6,7 @@ readline_clear_history(): Basic test --EXPECTF-- bool(true) - -Warning: readline_clear_history() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/readline/tests/readline_list_history_001.phpt b/ext/readline/tests/readline_list_history_001.phpt index 2f6f9525d2ac0..37e1b0af1752a 100644 --- a/ext/readline/tests/readline_list_history_001.phpt +++ b/ext/readline/tests/readline_list_history_001.phpt @@ -6,12 +6,8 @@ readline_list_history(): Basic test --EXPECTF-- array(0) { } - -Warning: readline_list_history() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/reflection/tests/ReflectionClass_constructor_002.phpt b/ext/reflection/tests/ReflectionClass_constructor_002.phpt index c463bb72c1bf5..05825ba97efe9 100644 --- a/ext/reflection/tests/ReflectionClass_constructor_002.phpt +++ b/ext/reflection/tests/ReflectionClass_constructor_002.phpt @@ -4,7 +4,7 @@ ReflectionClass::__constructor() - bad arguments getMessage() . "\n"; } @@ -34,7 +34,7 @@ try { try { var_dump(new ReflectionClass("stdClass", 1)); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } @@ -46,21 +46,12 @@ try { ?> --EXPECTF-- -Warning: ReflectionClass::__construct() expects exactly 1 parameter, 0 given in %s on line 3 -object(ReflectionClass)#%d (1) { - ["name"]=> - string(0) "" -} +ReflectionClass::__construct() expects exactly 1 parameter, 0 given Class does not exist Class 1 does not exist Class 1 does not exist Notice: Array to string conversion in %s on line 27 Class Array does not exist - -Warning: ReflectionClass::__construct() expects exactly 1 parameter, 2 given in %s on line 33 -object(ReflectionClass)#%d (1) { - ["name"]=> - string(0) "" -} +ReflectionClass::__construct() expects exactly 1 parameter, 2 given Class X does not exist diff --git a/ext/reflection/tests/ReflectionClass_getConstant_error.phpt b/ext/reflection/tests/ReflectionClass_getConstant_error.phpt index 5260e719a3325..020ac6f7f5fb7 100644 --- a/ext/reflection/tests/ReflectionClass_getConstant_error.phpt +++ b/ext/reflection/tests/ReflectionClass_getConstant_error.phpt @@ -8,30 +8,14 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->getConstant()); -var_dump($rc->getConstant("myConst", "myConst")); var_dump($rc->getConstant(null)); var_dump($rc->getConstant(1)); var_dump($rc->getConstant(1.5)); var_dump($rc->getConstant(true)); -var_dump($rc->getConstant(array(1,2,3))); -var_dump($rc->getConstant(new C)); ?> ---EXPECTF-- +--EXPECT-- Check invalid params: - -Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 0 given in %s on line 8 -NULL - -Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 2 given in %s on line 9 -NULL bool(false) bool(false) bool(false) bool(false) - -Warning: ReflectionClass::getConstant() expects parameter 1 to be string, array given in %s on line 14 -NULL - -Warning: ReflectionClass::getConstant() expects parameter 1 to be string, object given in %s on line 15 -NULL diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index 1eb084214b4f5..424550f67a0fe 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -13,12 +13,12 @@ $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; try { var_dump($rc->getMethod()); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->getMethod("f", "f")); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -43,32 +43,24 @@ try { } try { var_dump($rc->getMethod(array(1,2,3))); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->getMethod(new C)); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } ?> ---EXPECTF-- +--EXPECT-- Check invalid params: - -Warning: ReflectionClass::getMethod() expects exactly 1 parameter, 0 given in %s on line 9 -NULL - -Warning: ReflectionClass::getMethod() expects exactly 1 parameter, 2 given in %s on line 14 -NULL +ReflectionClass::getMethod() expects exactly 1 parameter, 0 given +ReflectionClass::getMethod() expects exactly 1 parameter, 2 given Method does not exist Method 1 does not exist Method 1.5 does not exist Method 1 does not exist - -Warning: ReflectionClass::getMethod() expects parameter 1 to be string, array given in %s on line 39 -NULL - -Warning: ReflectionClass::getMethod() expects parameter 1 to be string, object given in %s on line 44 -NULL +ReflectionClass::getMethod() expects parameter 1 to be string, array given +ReflectionClass::getMethod() expects parameter 1 to be string, object given diff --git a/ext/reflection/tests/ReflectionClass_getParentClass.phpt b/ext/reflection/tests/ReflectionClass_getParentClass.phpt index 382948d3d37ff..ef64de5ecb030 100644 --- a/ext/reflection/tests/ReflectionClass_getParentClass.phpt +++ b/ext/reflection/tests/ReflectionClass_getParentClass.phpt @@ -10,11 +10,14 @@ class Foo {} class Bar extends Foo {} -$rc1 = new ReflectionClass("Bar"); -var_dump($rc1->getParentClass()); +$rc = new ReflectionClass("Bar"); +$parent = $rc->getParentClass(); +$grandParent = $parent->getParentClass(); +var_dump($parent, $grandParent); ?> --EXPECTF-- object(ReflectionClass)#%d (1) { ["name"]=> string(3) "Foo" } +bool(false) diff --git a/ext/reflection/tests/ReflectionClass_getParentClass_001.phpt b/ext/reflection/tests/ReflectionClass_getParentClass_001.phpt deleted file mode 100644 index be50dbb730778..0000000000000 --- a/ext/reflection/tests/ReflectionClass_getParentClass_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -ReflectionClass::getParentClass() ---CREDITS-- -Robin Fernandes -Steve Seear ---FILE-- -getParentClass(); -$grandParent = $parent->getParentClass(); -var_dump($parent, $grandParent); - -echo "\nTest bad params:\n"; -var_dump($rc->getParentClass(null)); -var_dump($rc->getParentClass('x')); -var_dump($rc->getParentClass('x', 123)); - -?> ---EXPECTF-- -object(ReflectionClass)#%d (1) { - ["name"]=> - string(1) "A" -} -bool(false) - -Test bad params: - -Warning: ReflectionClass::getParentClass() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionClass::getParentClass() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionClass::getParentClass() expects exactly 0 parameters, 2 given in %s on line %d -NULL diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 68522e097ae3b..d9a2ebcd711e3 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -13,12 +13,12 @@ $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; try { var_dump($rc->getProperty()); -} catch (exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->getProperty("a", "a")); -} catch (exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -43,30 +43,22 @@ try { } try { var_dump($rc->getProperty(array(1,2,3))); -} catch (exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->getProperty(new C)); -} catch (exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } ?> ---EXPECTF-- +--EXPECT-- Check invalid params: - -Warning: ReflectionClass::getProperty() expects exactly 1 parameter, 0 given in %s on line 9 -NULL - -Warning: ReflectionClass::getProperty() expects exactly 1 parameter, 2 given in %s on line 14 -NULL +ReflectionClass::getProperty() expects exactly 1 parameter, 0 given +ReflectionClass::getProperty() expects exactly 1 parameter, 2 given Property does not exist Property 1 does not exist Property 1.5 does not exist Property 1 does not exist - -Warning: ReflectionClass::getProperty() expects parameter 1 to be string, array given in %s on line 39 -NULL - -Warning: ReflectionClass::getProperty() expects parameter 1 to be string, object given in %s on line 44 -NULL +ReflectionClass::getProperty() expects parameter 1 to be string, array given +ReflectionClass::getProperty() expects parameter 1 to be string, object given diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt index 52fa378eb6579..7c071e5ba0fed 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt @@ -12,12 +12,12 @@ class C { $rc = new ReflectionClass('C'); try { var_dump($rc->getStaticPropertyValue("x", "default value", 'blah')); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->getStaticPropertyValue()); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -32,20 +32,15 @@ try { } try { var_dump($rc->getStaticPropertyValue(array(1,2,3))); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } ?> ---EXPECTF-- -Warning: ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given in %s on line 8 -NULL - -Warning: ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given in %s on line 13 -NULL +--EXPECT-- +ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given +ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given Class C does not have a property named string(3) "def" - -Warning: ReflectionClass::getStaticPropertyValue() expects parameter 1 to be string, array given in %s on line 28 -NULL +ReflectionClass::getStaticPropertyValue() expects parameter 1 to be string, array given diff --git a/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt b/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt index 14c847401d10b..257d9aa9daab7 100644 --- a/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt +++ b/ext/reflection/tests/ReflectionClass_hasConstant_002.phpt @@ -11,30 +11,14 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->hasConstant()); -var_dump($rc->hasConstant("myConst", "myConst")); var_dump($rc->hasConstant(null)); var_dump($rc->hasConstant(1)); var_dump($rc->hasConstant(1.5)); var_dump($rc->hasConstant(true)); -var_dump($rc->hasConstant(array(1,2,3))); -var_dump($rc->hasConstant(new C)); ?> ---EXPECTF-- +--EXPECT-- Check invalid params: - -Warning: ReflectionClass::hasConstant() expects exactly 1 parameter, 0 given in %s on line 8 -NULL - -Warning: ReflectionClass::hasConstant() expects exactly 1 parameter, 2 given in %s on line 9 -NULL bool(false) bool(false) bool(false) bool(false) - -Warning: ReflectionClass::hasConstant() expects parameter 1 to be string, array given in %s on line 14 -NULL - -Warning: ReflectionClass::hasConstant() expects parameter 1 to be string, object given in %s on line 15 -NULL diff --git a/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt b/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt index 63fe8791fc3f6..77f2865a31ac3 100644 --- a/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_hasMethod_002.phpt @@ -11,30 +11,14 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->hasMethod()); -var_dump($rc->hasMethod("f", "f")); var_dump($rc->hasMethod(null)); var_dump($rc->hasMethod(1)); var_dump($rc->hasMethod(1.5)); var_dump($rc->hasMethod(true)); -var_dump($rc->hasMethod(array(1,2,3))); -var_dump($rc->hasMethod(new C)); ?> ---EXPECTF-- +--EXPECT-- Check invalid params: - -Warning: ReflectionClass::hasMethod() expects exactly 1 parameter, 0 given in %s on line 8 -NULL - -Warning: ReflectionClass::hasMethod() expects exactly 1 parameter, 2 given in %s on line 9 -NULL bool(false) bool(false) bool(false) bool(false) - -Warning: ReflectionClass::hasMethod() expects parameter 1 to be string, array given in %s on line 14 -NULL - -Warning: ReflectionClass::hasMethod() expects parameter 1 to be string, object given in %s on line 15 -NULL diff --git a/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt b/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt index 753890394f12d..a1bbb9e73cb69 100644 --- a/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_hasProperty_002.phpt @@ -11,30 +11,14 @@ class C { $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; -var_dump($rc->hasProperty()); -var_dump($rc->hasProperty("a", "a")); var_dump($rc->hasProperty(null)); var_dump($rc->hasProperty(1)); var_dump($rc->hasProperty(1.5)); var_dump($rc->hasProperty(true)); -var_dump($rc->hasProperty(array(1,2,3))); -var_dump($rc->hasProperty(new C)); ?> --EXPECTF-- Check invalid params: - -Warning: ReflectionClass::hasProperty() expects exactly 1 parameter, 0 given in %s on line 8 -NULL - -Warning: ReflectionClass::hasProperty() expects exactly 1 parameter, 2 given in %s on line 9 -NULL bool(false) bool(false) bool(false) bool(false) - -Warning: ReflectionClass::hasProperty() expects parameter 1 to be string, array given in %s on line 14 -NULL - -Warning: ReflectionClass::hasProperty() expects parameter 1 to be string, object given in %s on line 15 -NULL diff --git a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt index 91398867ecd83..b0deab33dad21 100644 --- a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt +++ b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt @@ -41,12 +41,12 @@ foreach ($rcs as $childName => $child) { echo "\n\nTest bad arguments:\n"; try { var_dump($rcs['A']->implementsInterface()); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rcs['A']->implementsInterface('C', 'C')); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -144,12 +144,8 @@ Does I2 implement I2? Test bad arguments: - -Warning: ReflectionClass::implementsInterface() expects exactly 1 parameter, 0 given in %s on line 37 -NULL - -Warning: ReflectionClass::implementsInterface() expects exactly 1 parameter, 2 given in %s on line 42 -NULL +ReflectionClass::implementsInterface() expects exactly 1 parameter, 0 given +ReflectionClass::implementsInterface() expects exactly 1 parameter, 2 given Parameter one must either be a string or a ReflectionClass object Interface ThisClassDoesNotExist does not exist Parameter one must either be a string or a ReflectionClass object diff --git a/ext/reflection/tests/ReflectionClass_isIterateable_001.phpt b/ext/reflection/tests/ReflectionClass_isIterateable_001.phpt index 10a86d9136ed9..af4ce9d2f4c17 100644 --- a/ext/reflection/tests/ReflectionClass_isIterateable_001.phpt +++ b/ext/reflection/tests/ReflectionClass_isIterateable_001.phpt @@ -35,16 +35,6 @@ foreach($classes as $class) { var_dump($rc->isIterateable()); } -echo "\nTest invalid params:\n"; -$rc = new ReflectionClass('IteratorImpl'); -var_dump($rc->isIterateable(null)); -var_dump($rc->isIterateable(null, null)); -var_dump($rc->isIterateable(1)); -var_dump($rc->isIterateable(1.5)); -var_dump($rc->isIterateable(true)); -var_dump($rc->isIterateable('X')); -var_dump($rc->isIterateable(null)); - echo "\nTest static invocation:\n"; ReflectionClass::isIterateable(); @@ -61,32 +51,9 @@ Is ExtendsIteratorImpl iterable? bool(true) Is ExtendsIteratorAggregateImpl iterable? bool(true) Is A iterable? bool(false) -Test invalid params: - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 1 given in %s on line 34 -NULL - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 2 given in %s on line 35 -NULL - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 1 given in %s on line 36 -NULL - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 1 given in %s on line 37 -NULL - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 1 given in %s on line 38 -NULL - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 1 given in %s on line 39 -NULL - -Warning: ReflectionClass::isIterateable() expects exactly 0 parameters, 1 given in %s on line 40 -NULL - Test static invocation: -Fatal error: Uncaught Error: Non-static method ReflectionClass::isIterateable() cannot be called statically in %s:43 +Fatal error: Uncaught Error: Non-static method ReflectionClass::isIterateable() cannot be called statically in %s:%d Stack trace: #0 {main} - thrown in %s on line 43 + thrown in %s on line %d diff --git a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt index 368ea7d7ec795..03d17e223efd7 100644 --- a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt +++ b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt @@ -11,12 +11,12 @@ $rc = new ReflectionClass('A'); echo "\n\nTest bad arguments:\n"; try { var_dump($rc->isSubclassOf()); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->isSubclassOf('C', 'C')); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -35,14 +35,10 @@ try { echo $e->getMessage() . "\n"; } ?> ---EXPECTF-- +--EXPECT-- Test bad arguments: - -Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given in %s on line 7 -NULL - -Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given in %s on line 12 -NULL +ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given +ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given Parameter one must either be a string or a ReflectionClass object Class ThisClassDoesNotExist does not exist Parameter one must either be a string or a ReflectionClass object diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index fb472681ca4da..6d3cf3a44f262 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -12,17 +12,17 @@ class C { $rc = new ReflectionClass('C'); try { var_dump($rc->setStaticPropertyValue("x", "default value", 'blah')); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->setStaticPropertyValue()); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($rc->setStaticPropertyValue(null)); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -37,23 +37,16 @@ try { } try { var_dump($rc->setStaticPropertyValue(array(1,2,3), 'blah')); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } ?> ---EXPECTF-- -Warning: ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 3 given in %s on line 8 -NULL - -Warning: ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 0 given in %s on line 13 -NULL - -Warning: ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 1 given in %s on line 18 -NULL +--EXPECT-- +ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 3 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 0 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 1 given Class C does not have a property named Class C does not have a property named 1.5 - -Warning: ReflectionClass::setStaticPropertyValue() expects parameter 1 to be string, array given in %s on line 33 -NULL +ReflectionClass::setStaticPropertyValue() expects parameter 1 to be string, array given diff --git a/ext/reflection/tests/ReflectionMethod_006.phpt b/ext/reflection/tests/ReflectionMethod_006.phpt index 627dc96f32ee6..81f8116d77c3f 100644 --- a/ext/reflection/tests/ReflectionMethod_006.phpt +++ b/ext/reflection/tests/ReflectionMethod_006.phpt @@ -17,79 +17,7 @@ try { echo "Ok - ".$re->getMessage().PHP_EOL; } -class C { - public function f() {} -} - -$rm = new ReflectionMethod('C', 'f'); - -var_dump($rm->isFinal(1)); -var_dump($rm->isAbstract(1)); -var_dump($rm->isPrivate(1)); -var_dump($rm->isProtected(1)); -var_dump($rm->isPublic(1)); -var_dump($rm->isStatic(1)); -var_dump($rm->isConstructor(1)); -var_dump($rm->isDestructor(1)); -var_dump($rm->getModifiers(1)); -var_dump($rm->isInternal(1)); -var_dump($rm->isUserDefined(1)); -var_dump($rm->getFileName(1)); -var_dump($rm->getStartLine(1)); -var_dump($rm->getEndLine(1)); -var_dump($rm->getStaticVariables(1)); -var_dump($rm->getName(1)); - - ?> ---EXPECTF-- +--EXPECT-- Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given - -Warning: ReflectionMethod::isFinal() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isAbstract() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isPrivate() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isProtected() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isPublic() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isStatic() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isConstructor() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::isDestructor() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::isInternal() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::isUserDefined() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::getFileName() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::getStartLine() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::getEndLine() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::getStaticVariables() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionFunctionAbstract::getName() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt b/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt index d3b9ca3c81b3b..d1e7ee68fbdd2 100644 --- a/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt +++ b/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt @@ -35,15 +35,7 @@ $staticmethod = $staticclass->getMethod( 'foo' ); $object = new Example(); $fakeobj = new StdClass(); -echo "\n-- Testing ReflectionMethod::getClosure() function with more than expected no. of arguments --\n"; -var_dump( $staticmethod->getClosure( 'foobar' ) ); -var_dump( $staticmethod->getClosure( 'foo', 'bar' ) ); -var_dump( $method->getClosure( $object, 'foobar' ) ); - -echo "\n-- Testing ReflectionMethod::getClosure() function with Zero arguments --\n"; -$closure = $method->getClosure(); - -echo "\n-- Testing ReflectionMethod::getClosure() function with Zero arguments --\n"; +echo "\n-- Testing ReflectionMethod::getClosure() function with invalid object --\n"; try { var_dump( $method->getClosure( $fakeobj ) ); } catch( Exception $e ) { @@ -55,19 +47,6 @@ try { --EXPECTF-- *** Testing ReflectionMethod::getClosure() : error conditions *** --- Testing ReflectionMethod::getClosure() function with more than expected no. of arguments -- -object(Closure)#%d (0) { -} -object(Closure)#%d (0) { -} - -Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 2 given in %s on line %d -NULL - --- Testing ReflectionMethod::getClosure() function with Zero arguments -- - -Warning: ReflectionMethod::getClosure() expects exactly 1 parameter, 0 given in %s on line %d - --- Testing ReflectionMethod::getClosure() function with Zero arguments -- +-- Testing ReflectionMethod::getClosure() function with invalid object -- string(72) "Given object is not an instance of the class this method was declared in" ===DONE=== diff --git a/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt b/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt index d1a19c7116191..d867993599bbc 100644 --- a/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_getModifiers_basic.phpt @@ -75,13 +75,9 @@ reflectMethodModifiers("DerivedClass"); reflectMethodModifiers("TestInterface"); reflectMethodModifiers("AbstractClass"); -echo "Wrong number of params:\n"; -$a = new ReflectionMethod('TestClass::foo'); -$a->getModifiers(1); - $a = new ReflectionMethod('ReflectionMethod::getModifiers'); -echo "\nReflectionMethod::getModifiers() modifiers:\n"; +echo "ReflectionMethod::getModifiers() modifiers:\n"; printf("0x%08x\n", $a->getModifiers()); ?> @@ -234,9 +230,5 @@ Modifiers for method AbstractClass::foo(): 0x00000041 -Wrong number of params: - -Warning: ReflectionMethod::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d - ReflectionMethod::getModifiers() modifiers: 0x00000001 diff --git a/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt b/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt index 0c87a66153394..156cc9db52657 100644 --- a/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt +++ b/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt @@ -37,10 +37,6 @@ $foo = new ReflectionMethod($testClassInstance, 'foo'); $staticMethod = new ReflectionMethod('TestClass::staticMethod'); $privateMethod = new ReflectionMethod("TestClass::privateMethod"); -echo "Wrong number of parameters:\n"; -var_dump($foo->invokeArgs()); -var_dump($foo->invokeArgs(true)); - echo "\nNon-instance:\n"; try { var_dump($foo->invokeArgs(new stdClass(), array())); @@ -48,14 +44,8 @@ try { var_dump($e->getMessage()); } -echo "\nNon-object:\n"; -var_dump($foo->invokeArgs(true, array())); - echo "\nStatic method:\n"; -var_dump($staticMethod->invokeArgs()); -var_dump($staticMethod->invokeArgs(true)); -var_dump($staticMethod->invokeArgs(true, array())); var_dump($staticMethod->invokeArgs(null, array())); echo "\nPrivate method:\n"; @@ -80,32 +70,10 @@ try { ?> --EXPECTF-- -Wrong number of parameters: - -Warning: ReflectionMethod::invokeArgs() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: ReflectionMethod::invokeArgs() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Non-instance: string(72) "Given object is not an instance of the class this method was declared in" -Non-object: - -Warning: ReflectionMethod::invokeArgs() expects parameter 1 to be object, bool given in %s on line %d -NULL - Static method: - -Warning: ReflectionMethod::invokeArgs() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: ReflectionMethod::invokeArgs() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionMethod::invokeArgs() expects parameter 1 to be object, bool given in %s on line %d -NULL Called staticMethod() Exception: Using $this when not in object context NULL diff --git a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt index 0a2b15fb83936..6711feb4ac924 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt @@ -60,8 +60,16 @@ var_dump($methodWithArgs->invoke($testClassInstance, 1, "arg2", 3)); echo "\nStatic method:\n"; -var_dump($staticMethod->invoke()); -var_dump($staticMethod->invoke(true)); +try { + var_dump($staticMethod->invoke()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump($staticMethod->invoke(true)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($staticMethod->invoke(new stdClass())); echo "\nMethod that throws an exception:\n"; @@ -94,12 +102,8 @@ Called methodWithArgs(1, arg2) NULL Static method: - -Warning: ReflectionMethod::invoke() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: ReflectionMethod::invoke() expects parameter 1 to be object, bool given in %s on line %d -NULL +ReflectionMethod::invoke() expects at least 1 parameter, 0 given +ReflectionMethod::invoke() expects parameter 1 to be object, bool given Called staticMethod() Exception: Using $this when not in object context NULL diff --git a/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt b/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt index 411299f0c75f9..4fa86eb363948 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt @@ -30,7 +30,7 @@ $testClassInstance->prop = "Hello"; echo "invoke() on a non-object:\n"; try { var_dump($foo->invoke(true)); -} catch (ReflectionException $e) { +} catch (TypeError $e) { var_dump($e->getMessage()); } @@ -59,9 +59,7 @@ try { ?> --EXPECTF-- invoke() on a non-object: - -Warning: ReflectionMethod::invoke() expects parameter 1 to be object, bool given in %s%eReflectionMethod_invoke_error1.php on line %d -NULL +string(71) "ReflectionMethod::invoke() expects parameter 1 to be object, bool given" invoke() on a non-instance: string(72) "Given object is not an instance of the class this method was declared in" diff --git a/ext/reflection/tests/ReflectionObject_getName_basic.phpt b/ext/reflection/tests/ReflectionObject_getName_basic.phpt index 68cea6a1cde1a..1885695cb1911 100644 --- a/ext/reflection/tests/ReflectionObject_getName_basic.phpt +++ b/ext/reflection/tests/ReflectionObject_getName_basic.phpt @@ -2,8 +2,6 @@ ReflectionObject::getName() - basic function test --FILE-- getName()); $r1 = new ReflectionObject(new stdClass); var_dump($r1->getName()); @@ -18,8 +16,6 @@ var_dump($r3->getName()); ?> --EXPECTF-- -Warning: ReflectionObject::__construct() expects exactly 1 parameter, 0 given in %s on line 2 -string(0) "" string(8) "stdClass" string(1) "C" string(16) "ReflectionObject" diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt index f05197ebafafc..a2484f9dc237c 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt @@ -11,12 +11,12 @@ $ro = new ReflectionObject(new C); echo "\n\nTest bad arguments:\n"; try { var_dump($ro->isSubclassOf()); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { var_dump($ro->isSubclassOf('C', 'C')); -} catch (Exception $e) { +} catch (TypeError $e) { echo $e->getMessage() . "\n"; } try { @@ -35,14 +35,10 @@ try { echo $e->getMessage() . "\n"; } ?> ---EXPECTF-- +--EXPECT-- Test bad arguments: - -Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given in %s on line 7 -NULL - -Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given in %s on line 12 -NULL +ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given +ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given Parameter one must either be a string or a ReflectionClass object Class ThisClassDoesNotExist does not exist Parameter one must either be a string or a ReflectionClass object diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf_error.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf_error.phpt index 11994ed7057cf..582bcffe65f13 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf_error.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf_error.phpt @@ -5,20 +5,12 @@ ReflectionObject::isSubclassOf() - invalid params class A {} $ro = new ReflectionObject(new A); -var_dump($ro->isSubclassOf()); -var_dump($ro->isSubclassOf('A',5)); var_dump($ro->isSubclassOf('X')); ?> --EXPECTF-- -Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given in %s on line 5 -NULL - -Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given in %s on line 6 -NULL - -Fatal error: Uncaught ReflectionException: Class X does not exist in %s:7 +Fatal error: Uncaught ReflectionException: Class X does not exist in %s:%d Stack trace: -#0 %s(7): ReflectionClass->isSubclassOf('X') +#0 %s(%d): ReflectionClass->isSubclassOf('X') #1 {main} - thrown in %s on line 7 + thrown in %s on line %d diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt index c8a2f11ee1d3c..a7fdff5000f3c 100644 --- a/ext/reflection/tests/ReflectionProperty_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_error.phpt @@ -24,39 +24,8 @@ try { echo "Ok - ".$re->getMessage().PHP_EOL; } - -$rp = new ReflectionProperty('C', 'p'); -var_dump($rp->getName(1)); -var_dump($rp->isPrivate(1)); -var_dump($rp->isProtected(1)); -var_dump($rp->isPublic(1)); -var_dump($rp->isStatic(1)); -var_dump($rp->getModifiers(1)); -var_dump($rp->isDefault(1)); - ?> ---EXPECTF-- +--EXPECT-- Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 0 given Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 1 given Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 3 given - -Warning: ReflectionProperty::getName() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionProperty::isPrivate() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionProperty::isProtected() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionProperty::isPublic() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionProperty::isStatic() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionProperty::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: ReflectionProperty::isDefault() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/reflection/tests/ReflectionProperty_export_error.phpt b/ext/reflection/tests/ReflectionProperty_export_error.phpt index ab09ed01f0d4d..5acf9de6c3d1d 100644 --- a/ext/reflection/tests/ReflectionProperty_export_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_export_error.phpt @@ -32,10 +32,6 @@ catch(Exception $e) { echo $e->getMessage(); } -echo "\n\nIncorrect number of args:\n"; -ReflectionProperty::export(); -ReflectionProperty::export('TestClass', "nonExistentProperty", true, false); - ?> --EXPECTF-- Non-existent class: @@ -46,9 +42,3 @@ The parameter class is expected to be either a string or an object Non-existent property: Property TestClass::$nonExistentProperty does not exist - -Incorrect number of args: - -Warning: ReflectionProperty::export() expects at least 2 parameters, 0 given in %s on line %d - -Warning: ReflectionProperty::export() expects at most 3 parameters, 4 given in %s on line %d diff --git a/ext/reflection/tests/ReflectionProperty_getDeclaringClass_variation1.phpt b/ext/reflection/tests/ReflectionProperty_getDeclaringClass_variation1.phpt index c7c9366471c46..7ee787a348302 100644 --- a/ext/reflection/tests/ReflectionProperty_getDeclaringClass_variation1.phpt +++ b/ext/reflection/tests/ReflectionProperty_getDeclaringClass_variation1.phpt @@ -13,15 +13,9 @@ class B extends A { $propInfo = new ReflectionProperty('B', 'prop'); var_dump($propInfo->getDeclaringClass()); -echo "Wrong number of params:\n"; -$propInfo->getDeclaringClass(1); - ?> --EXPECTF-- object(ReflectionClass)#%d (1) { ["name"]=> string(1) "A" } -Wrong number of params: - -Warning: ReflectionProperty::getDeclaringClass() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt index 3bca85e4b63fd..52e9d1d2ef79b 100644 --- a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt @@ -18,15 +18,6 @@ $instance = new TestClass(); $invalidInstance = new AnotherClass(); $propInfo = new ReflectionProperty('TestClass', 'pub2'); -echo "Too few args:\n"; -var_dump($propInfo->getValue()); - -echo "\nToo many args:\n"; -var_dump($propInfo->getValue($instance, true)); - -echo "\nWrong type of arg:\n"; -var_dump($propInfo->getValue(true)); - echo "\nInstance without property:\n"; $propInfo = new ReflectionProperty('TestClass', 'stat'); @@ -51,21 +42,6 @@ var_dump($propInfo->getValue($invalidInstance)); ?> --EXPECTF-- -Too few args: - -Warning: ReflectionProperty::getValue() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Too many args: - -Warning: ReflectionProperty::getValue() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Wrong type of arg: - -Warning: ReflectionProperty::getValue() expects parameter 1 to be object, bool given in %s on line %d -NULL - Instance without property: Static property / too many args: @@ -79,8 +55,8 @@ Cannot access non-public member TestClass::$prot Invalid instance: -Fatal error: Uncaught ReflectionException: Given object is not an instance of the class this property was declared in in %s:47 +Fatal error: Uncaught ReflectionException: Given object is not an instance of the class this property was declared in in %s:%d Stack trace: -#0 %s(47): ReflectionProperty->getValue(Object(AnotherClass)) +#0 %s(%d): ReflectionProperty->getValue(Object(AnotherClass)) #1 {main} - thrown in %s on line 47 + thrown in %s on line %d diff --git a/ext/reflection/tests/ReflectionProperty_isDefault_basic.phpt b/ext/reflection/tests/ReflectionProperty_isDefault_basic.phpt index 2aa630d9d039f..14726151781aa 100644 --- a/ext/reflection/tests/ReflectionProperty_isDefault_basic.phpt +++ b/ext/reflection/tests/ReflectionProperty_isDefault_basic.phpt @@ -24,10 +24,6 @@ reflectProperty("TestClass", "stat"); reflectProperty("TestClass", "prot"); reflectProperty("TestClass", "priv"); -echo "Wrong number of params:\n"; -$propInfo = new ReflectionProperty('TestClass', 'pub'); -$propInfo->isDefault(1); - ?> --EXPECTF-- ********************************** @@ -58,6 +54,3 @@ isDefault(): bool(true) ********************************** -Wrong number of params: - -Warning: ReflectionProperty::isDefault() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/reflection/tests/ReflectionProperty_setValue_error.phpt b/ext/reflection/tests/ReflectionProperty_setValue_error.phpt index 0bf223daa7f9d..f58590b3eab44 100644 --- a/ext/reflection/tests/ReflectionProperty_setValue_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_setValue_error.phpt @@ -18,30 +18,6 @@ $instance = new TestClass(); $instanceWithNoProperties = new AnotherClass(); $propInfo = new ReflectionProperty('TestClass', 'pub2'); -echo "Too few args:\n"; -var_dump($propInfo->setValue()); -var_dump($propInfo->setValue($instance)); - -echo "\nToo many args:\n"; -var_dump($propInfo->setValue($instance, "NewValue", true)); - -echo "\nWrong type of arg:\n"; -var_dump($propInfo->setValue(true, "NewValue")); -$propInfo = new ReflectionProperty('TestClass', 'stat'); - -echo "\nStatic property / too many args:\n"; -var_dump($propInfo->setValue($instance, "NewValue", true)); - -echo "\nStatic property / too few args:\n"; -var_dump($propInfo->setValue("A new value")); -var_dump(TestClass::$stat); -var_dump($propInfo->setValue()); -var_dump(TestClass::$stat); - -echo "\nStatic property / wrong type of arg:\n"; -var_dump($propInfo->setValue(true, "Another new value")); -var_dump(TestClass::$stat); - echo "\nProtected property:\n"; try { $propInfo = new ReflectionProperty('TestClass', 'prot'); @@ -57,41 +33,6 @@ var_dump($propInfo->setValue($instanceWithNoProperties, "NewValue")); var_dump($instanceWithNoProperties->pub2); ?> --EXPECTF-- -Too few args: - -Warning: ReflectionProperty::setValue() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: ReflectionProperty::setValue() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Too many args: - -Warning: ReflectionProperty::setValue() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Wrong type of arg: - -Warning: ReflectionProperty::setValue() expects parameter 1 to be object, bool given in %s on line %d -NULL - -Static property / too many args: - -Warning: ReflectionProperty::setValue() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Static property / too few args: -NULL -string(11) "A new value" - -Warning: ReflectionProperty::setValue() expects exactly 2 parameters, 0 given in %s on line %d -NULL -string(11) "A new value" - -Static property / wrong type of arg: -NULL -string(17) "Another new value" - Protected property: Cannot access non-public member TestClass::$prot diff --git a/ext/reflection/tests/request38992.phpt b/ext/reflection/tests/request38992.phpt index 8c0052fd851f1..e6eab834157e5 100644 --- a/ext/reflection/tests/request38992.phpt +++ b/ext/reflection/tests/request38992.phpt @@ -11,12 +11,17 @@ class MyClass } $r = new ReflectionMethod('MyClass', 'doSomething'); -$r->invoke('WTF?'); -$r->invokeArgs('WTF?', array()); +try { + $r->invoke('WTF?'); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $r->invokeArgs('WTF?', array()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> -===DONE=== ---EXPECTF-- -Warning: ReflectionMethod::invoke() expects parameter 1 to be object, string given in %s%erequest38992.php on line %d - -Warning: ReflectionMethod::invokeArgs() expects parameter 1 to be object, string given in %s%erequest38992.php on line %d -===DONE=== +--EXPECT-- +ReflectionMethod::invoke() expects parameter 1 to be object, string given +ReflectionMethod::invokeArgs() expects parameter 1 to be object, string given diff --git a/ext/session/tests/session_cache_limiter_error.phpt b/ext/session/tests/session_cache_limiter_error.phpt index 42b2cb069469d..284649e277760 100644 --- a/ext/session/tests/session_cache_limiter_error.phpt +++ b/ext/session/tests/session_cache_limiter_error.phpt @@ -75,9 +75,6 @@ $inputs = array( // Unset data /*23*/ @$unset_var, - - // Resource variable -/*24*/ $fp ); @@ -163,9 +160,4 @@ string(12) "Hello World!" -- Iteration 23 -- string(0) "" - --- Iteration 24 -- - -Warning: session_cache_limiter() expects parameter 1 to be string, resource given in %s on line %d -NULL Done diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt index b7bcc3fca65a0..f0a9139ade830 100644 --- a/ext/session/tests/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/session_set_save_handler_class_012.phpt @@ -38,25 +38,23 @@ class MySession extends SessionHandler { $oldHandler = ini_get('session.save_handler'); $handler = new MySession; session_set_save_handler($handler); -var_dump(session_start()); +try { + var_dump(session_start()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION); --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler open *** Open -Warning: SessionHandler::open() expects exactly 2 parameters, 0 given in %s on line %d -Read %s - -Warning: SessionHandler::read(): Parent session handler is not open in %s on line %d +Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d +SessionHandler::open() expects exactly 2 parameters, 0 given -Warning: SessionHandler::close(): Parent session handler is not open in %s on line %d - -Warning: session_start(): Failed to read session data: user (%s) in %s on line %d -bool(false) +Notice: Undefined variable: _SESSION in %s on line %d string(0) "" string(5) "files" string(4) "user" -int(2) -array(0) { -} +int(1) +NULL diff --git a/ext/session/tests/session_set_save_handler_class_013.phpt b/ext/session/tests/session_set_save_handler_class_013.phpt index 28e49c9f98d53..79c732f30ce42 100644 --- a/ext/session/tests/session_set_save_handler_class_013.phpt +++ b/ext/session/tests/session_set_save_handler_class_013.phpt @@ -41,6 +41,7 @@ session_set_save_handler($handler); session_start(); var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION); +?> --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler close *** Open @@ -52,4 +53,10 @@ int(2) array(0) { } -Warning: SessionHandler::close() expects exactly 0 parameters, 1 given in %s on line %d +Fatal error: Uncaught ArgumentCountError: SessionHandler::close() expects exactly 0 parameters, 1 given in %s:%d +Stack trace: +#0 %s(%d): SessionHandler->close(false) +#1 [internal function]: MySession->close() +#2 [internal function]: session_write_close() +#3 {main} + thrown in %s on line %d diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt index bc9f801a5ebe7..cf01d8badb269 100644 --- a/ext/session/tests/session_set_save_handler_iface_002.phpt +++ b/ext/session/tests/session_set_save_handler_iface_002.phpt @@ -76,14 +76,15 @@ $ret = session_set_save_handler(array($handler, 'open'), array($handler, 'close' array($handler, 'read'), 'good_write', array($handler, 'destroy'), array($handler, 'gc')); var_dump($ret); -$ret = session_set_save_handler($handler); -var_dump($ret); +try { + $ret = session_set_save_handler($handler); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} session_start(); --EXPECTF-- *** Testing session_set_save_handler() function: interface wrong *** bool(true) - -Warning: session_set_save_handler() expects parameter 1 to be SessionHandlerInterface, object given in %s -bool(false) +session_set_save_handler() expects parameter 1 to be SessionHandlerInterface, object given good handler writing diff --git a/ext/shmop/tests/002.phpt b/ext/shmop/tests/002.phpt index 3206f90776b15..a06f454445ed0 100644 --- a/ext/shmop/tests/002.phpt +++ b/ext/shmop/tests/002.phpt @@ -18,9 +18,6 @@ edgarsandi - }; echo PHP_EOL, '## shmop_open function tests ##'; - // warning outputs: 4 parameters expected - var_dump($shm_id = shmop_open()); - // warning outputs: invalid flag when the flags length != 1 var_dump(shmop_open($hex_shm_id(), '', 0644, 1024)); @@ -34,9 +31,6 @@ echo PHP_EOL, '## shmop_open function tests ##'; var_dump(shmop_open($hex_shm_id(), "c", 0666, 0)); echo PHP_EOL, '## shmop_read function tests ##'; - // warning outputs: 3 parameters expected - var_dump(shmop_read()); - // warning outputs: start is out of range $shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024); var_dump(shmop_read($shm_id, -10, 0)); @@ -48,31 +42,13 @@ echo PHP_EOL, '## shmop_read function tests ##'; shmop_delete($shm_id); echo PHP_EOL, '## shmop_write function tests ##'; - // warning outputs: 3 parameters expected - var_dump(shmop_write()); - // warning outputs: offset out of range $shm_id = shmop_open($hex_shm_id(), 'n', 0600, 1024); var_dump(shmop_write($shm_id, 'text to try write', -10)); shmop_delete($shm_id); - -echo PHP_EOL, '## shmop_size function tests ##'; - // warning outputs: 1 parameter expected - var_dump(shmop_size()); - -echo PHP_EOL, '## shmop_delete function tests ##'; - // warning outputs: 1 parameter expected - var_dump(shmop_delete()); - -echo PHP_EOL, '## shmop_close function tests ##'; - // warning outputs: 1 parameter expected - var_dump(shmop_close()); ?> --EXPECTF-- ## shmop_open function tests ## -Warning: shmop_open() expects exactly 4 parameters, 0 given in %s on line %d -NULL - Warning: shmop_open(): is not a valid flag in %s on line %d bool(false) @@ -86,9 +62,6 @@ Warning: shmop_open(): Shared memory segment size must be greater than zero in % bool(false) ## shmop_read function tests ## -Warning: shmop_read() expects exactly 3 parameters, 0 given in %s on line %d -NULL - Warning: shmop_read(): start is out of range in %s on line %d bool(false) @@ -96,20 +69,5 @@ Warning: shmop_read(): count is out of range in %s on line %d bool(false) ## shmop_write function tests ## -Warning: shmop_write() expects exactly 3 parameters, 0 given in %s on line %d -NULL - Warning: shmop_write(): offset out of range in %s on line %d bool(false) - -## shmop_size function tests ## -Warning: shmop_size() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -## shmop_delete function tests ## -Warning: shmop_delete() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -## shmop_close function tests ## -Warning: shmop_close() expects exactly 1 parameter, 0 given in %s on line %d -NULL diff --git a/ext/simplexml/tests/SimpleXMLElement_xpath_3.phpt b/ext/simplexml/tests/SimpleXMLElement_xpath_3.phpt deleted file mode 100644 index 8682cf818d4be..0000000000000 --- a/ext/simplexml/tests/SimpleXMLElement_xpath_3.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Testing xpath() with invalid XML ---SKIPIF-- - ---FILE-- -xpath("BBBB")); -?> ---EXPECTF-- -Notice: Undefined variable: x in %s on line %d - -Warning: simplexml_load_string() expects parameter 3 to be int, float given in %s on line %d - -Fatal error: Uncaught Error: Call to a member function xpath() on null in %s:%d -Stack trace: -#0 {main} - thrown in %s on line %d diff --git a/ext/simplexml/tests/bug37565.phpt b/ext/simplexml/tests/bug37565.phpt index 0af93deaf3219..d20fbd5aca76d 100644 --- a/ext/simplexml/tests/bug37565.phpt +++ b/ext/simplexml/tests/bug37565.phpt @@ -31,7 +31,5 @@ try { ===DONE=== --EXPECT-- Error: simplexml_load_string() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given -Error: Argument 1 passed to Reflection::export() must implement interface Reflector, null given Error: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given -Error: Argument 1 passed to Reflection::export() must implement interface Reflector, null given ===DONE=== diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 6f495b6bd1797..1b27ec1e9064d 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1111,12 +1111,12 @@ PHP_METHOD(SoapServer, __construct) zend_long cache_wsdl; HashTable *typemap_ht = NULL; - SOAP_SERVER_BEGIN_CODE(); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) { - php_error_docref(NULL, E_ERROR, "Invalid parameters"); + return; } + SOAP_SERVER_BEGIN_CODE(); + if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) { php_error_docref(NULL, E_ERROR, "Invalid parameters"); } @@ -2267,12 +2267,12 @@ PHP_METHOD(SoapClient, __construct) HashTable *typemap_ht = NULL; zval *this_ptr = ZEND_THIS; - SOAP_CLIENT_BEGIN_CODE(); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) { - php_error_docref(NULL, E_ERROR, "Invalid parameters"); + return; } + SOAP_CLIENT_BEGIN_CODE(); + if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) { php_error_docref(NULL, E_ERROR, "$wsdl must be string or null"); } diff --git a/ext/soap/tests/bug77088.phpt b/ext/soap/tests/bug77088.phpt index 413529bcaac09..e6f5e7582ead9 100644 --- a/ext/soap/tests/bug77088.phpt +++ b/ext/soap/tests/bug77088.phpt @@ -12,18 +12,17 @@ try $options = NULL; $sClient = new SoapClient("test.wsdl", $options); } -catch(SoapFault $e) +catch(TypeError $e) { var_dump($e); } ?> --EXPECTF-- -Warning: SoapClient::__construct() expects parameter 2 to be array, null given in %sbug77088.php on line %d -object(SoapFault)#%d (%d) { +object(TypeError)#%d (%d) { ["message":protected]=> - string(%d) "SoapClient::__construct(): Invalid parameters" - ["string":"Exception":private]=> + string(%d) "SoapClient::__construct() expects parameter 2 to be array, null given" + ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) @@ -31,7 +30,7 @@ object(SoapFault)#%d (%d) { string(%d) "%sbug77088.php" ["line":protected]=> int(6) - ["trace":"Exception":private]=> + ["trace":"Error":private]=> array(1) { [0]=> array(6) { @@ -54,12 +53,6 @@ object(SoapFault)#%d (%d) { } } } - ["previous":"Exception":private]=> + ["previous":"Error":private]=> NULL - ["faultstring"]=> - string(%d) "SoapClient::__construct(): Invalid parameters" - ["faultcode"]=> - string(6) "Client" - ["faultcodens"]=> - string(41) "http://schemas.xmlsoap.org/soap/envelope/" } diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt index 4889b10d8ed82..152781a4ecf97 100644 --- a/ext/soap/tests/bugs/bug31422.phpt +++ b/ext/soap/tests/bugs/bug31422.phpt @@ -39,7 +39,6 @@ $server->handle($HTTP_RAW_POST_DATA); echo "ok\n"; ?> --EXPECTF-- -PHP Warning: fopen() expects at least 2 parameters, 0 given in %sbug31422.php on line %d -PHP Fatal error: Hello in %sbug31422.php on line %d -SOAP-ENV:ServerHello +SOAP-ENV:Serverfopen() expects at least 2 parameters, 0 given +ok diff --git a/ext/sockets/tests/socket_connect_params.phpt b/ext/sockets/tests/socket_connect_params.phpt index 94c38de1cb923..f1fdf55a81e38 100644 --- a/ext/sockets/tests/socket_connect_params.phpt +++ b/ext/sockets/tests/socket_connect_params.phpt @@ -14,8 +14,11 @@ fa@php.net $rand = rand(1,999); $s_c = socket_create_listen(31330+$rand); // wrong parameter count - $s_w = socket_connect(); - $s_w = socket_connect($s_c); + try { + $s_w = socket_connect($s_c); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $s_w = socket_connect($s_c, '0.0.0.0'); $s_w = socket_connect($s_c, '0.0.0.0', 31330+$rand); @@ -23,9 +26,7 @@ fa@php.net ?> --EXPECTF-- -Warning: socket_connect() expects at least 2 parameters, 0 given in %s on line %d - -Warning: socket_connect() expects at least 2 parameters, 1 given in %s on line %d +socket_connect() expects at least 2 parameters, 1 given Warning: socket_connect(): Socket of type AF_INET requires 3 arguments in %s on line %d diff --git a/ext/sockets/tests/socket_create_listen_used.phpt b/ext/sockets/tests/socket_create_listen_used.phpt index b41e2caefca2a..2dfec4fbf7968 100644 --- a/ext/sockets/tests/socket_create_listen_used.phpt +++ b/ext/sockets/tests/socket_create_listen_used.phpt @@ -18,7 +18,6 @@ fa@php.net // default invocation $s_c_l2 = socket_create_listen(31330+$rand); var_dump($s_c_l2); - socket_close($s_c_l2); socket_close($s_c_l); ?> --EXPECTF-- @@ -26,5 +25,3 @@ resource(%i) of type (Socket) Warning: socket_create_listen(): unable to bind to given address [%i]: %a in %s on line %d bool(false) - -Warning: socket_close() expects parameter 1 to be resource, bool given in %s on line %d diff --git a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt index 554819ac991ec..5cf054458a923 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt @@ -10,10 +10,6 @@ if (!extension_loaded('sockets')) { } --FILE-- +--EXPECTF-- Warning: socket_create_pair(): unable to create socket pair [%d]: %s not supported in %s on line %d bool(false) diff --git a/ext/sockets/tests/socket_export_stream-2.phpt b/ext/sockets/tests/socket_export_stream-2.phpt index d3db5e36c8a0c..fb89bd28d7239 100644 --- a/ext/sockets/tests/socket_export_stream-2.phpt +++ b/ext/sockets/tests/socket_export_stream-2.phpt @@ -8,10 +8,6 @@ if (!extension_loaded('sockets')) { --FILE-- --EXPECTF-- -Warning: socket_export_stream() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: socket_export_stream() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: socket_export_stream() expects parameter 1 to be resource, int given in %s on line %d -NULL - -Warning: socket_export_stream() expects parameter 1 to be resource, object given in %s on line %d -NULL - Warning: socket_export_stream(): supplied resource is not a valid Socket resource in %s on line %d bool(false) diff --git a/ext/sockets/tests/socket_import_stream-2.phpt b/ext/sockets/tests/socket_import_stream-2.phpt index e1fada608e51c..8464b460399e1 100644 --- a/ext/sockets/tests/socket_import_stream-2.phpt +++ b/ext/sockets/tests/socket_import_stream-2.phpt @@ -8,10 +8,6 @@ if (!extension_loaded('sockets')) { --FILE-- --EXPECTF-- -Warning: socket_import_stream() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: socket_import_stream() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: socket_import_stream() expects parameter 1 to be resource, int given in %s on line %d -NULL - -Warning: socket_import_stream() expects parameter 1 to be resource, object given in %s on line %d -NULL - Warning: socket_import_stream(): cannot represent a stream of type STDIO as a Socket Descriptor in %s on line %d bool(false) diff --git a/ext/sockets/tests/socket_listen-wrongparams.phpt b/ext/sockets/tests/socket_listen-wrongparams.phpt index 41d7ac1f108b9..b5715a5ff55e7 100644 --- a/ext/sockets/tests/socket_listen-wrongparams.phpt +++ b/ext/sockets/tests/socket_listen-wrongparams.phpt @@ -10,13 +10,9 @@ if (!extension_loaded('sockets')) { } --FILE-- --EXPECTF-- -Warning: socket_read() expects at least 2 parameters, 0 given in %s on line %d - -Warning: socket_read() expects at least 2 parameters, 1 given in %s on line %d - Warning: socket_read(): unable to read from socket [%i]: %a in %s on line %d diff --git a/ext/sockets/tests/socket_select-wrongparams-2.phpt b/ext/sockets/tests/socket_select-wrongparams-2.phpt index c149973e703e1..a7c423df1bf99 100644 --- a/ext/sockets/tests/socket_select-wrongparams-2.phpt +++ b/ext/sockets/tests/socket_select-wrongparams-2.phpt @@ -12,12 +12,9 @@ $write = null; $except = null; $time = 0; var_dump(socket_select($sockets, $write, $except, $time)); -socket_select($sockets, $write, $except); --EXPECTF-- Warning: socket_select(): no resource arrays were passed to select in %s on line %d bool(false) - -Warning: socket_select() expects at least 4 parameters, 3 given in %s on line %d --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt b/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt index 689421011eaf1..0720b319b7f00 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt @@ -16,7 +16,6 @@ if (!extension_loaded('sockets')) { } $address = '127.0.0.1'; - socket_sendto($socket, '', 1, 0, $address); // cause warning if (!socket_bind($socket, $address, 1223)) { die("Unable to bind to $address:1223"); } @@ -34,8 +33,6 @@ if (!extension_loaded('sockets')) { $from = ""; $port = 0; - socket_recvfrom($socket, $buf, 12, 0); // cause warning - socket_recvfrom($socket, $buf, 12, 0, $from); // cause warning $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from, $port); if ($bytes_received == -1) { die('An error occurred while receiving from the socket'); @@ -45,13 +42,8 @@ if (!extension_loaded('sockets')) { echo "Received $buf from remote address $from and remote port $port" . PHP_EOL; socket_close($socket); ---EXPECTF-- -Warning: Wrong parameter count for socket_sendto() in %s on line %d +--EXPECT-- bool(false) - -Warning: socket_recvfrom() expects at least 5 parameters, 4 given in %s on line %d - -Warning: Wrong parameter count for socket_recvfrom() in %s on line %d Received Ping! from remote address 127.0.0.1 and remote port 1223 --CREDITS-- Falko Menge diff --git a/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp-win32.phpt b/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp-win32.phpt index 8754028f84b43..fbc4da3861cc5 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp-win32.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp-win32.phpt @@ -20,7 +20,6 @@ require 'ipv6_skipif.inc'; } socket_recvfrom($socket, $buf, 12, 0, $from, $port); // cause warning $address = '::1'; - socket_sendto($socket, '', 1, 0, $address); // cause warning if (!socket_bind($socket, $address, 1223)) { die("Unable to bind to $address:1223"); } @@ -36,8 +35,6 @@ require 'ipv6_skipif.inc'; $from = ""; $port = 0; - socket_recvfrom($socket, $buf, 12, 0); // cause warning - socket_recvfrom($socket, $buf, 12, 0, $from); // cause warning $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from, $port); if ($bytes_received == -1) { die('An error occurred while receiving from the socket'); @@ -50,12 +47,6 @@ require 'ipv6_skipif.inc'; --EXPECTF-- Warning: socket_recvfrom(): unable to recvfrom [10022]: %s in %s on line %d - -Warning: Wrong parameter count for socket_sendto() in %s on line %d - -Warning: socket_recvfrom() expects at least 5 parameters, 4 given in %s on line %d - -Warning: Wrong parameter count for socket_recvfrom() in %s on line %d Received Ping! from remote address ::1 and remote port 1223 --CREDITS-- Falko Menge diff --git a/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt b/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt index bd0790427773b..ef44109b81aae 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt @@ -20,7 +20,6 @@ require 'ipv6_skipif.inc'; } var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); // false (EAGAIN, no warning) $address = '::1'; - socket_sendto($socket, '', 1, 0, $address); // cause warning if (!socket_bind($socket, $address, 1223)) { die("Unable to bind to $address:1223"); } @@ -36,8 +35,6 @@ require 'ipv6_skipif.inc'; $from = ""; $port = 0; - socket_recvfrom($socket, $buf, 12, 0); // cause warning - socket_recvfrom($socket, $buf, 12, 0, $from); // cause warning $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from, $port); if ($bytes_received == -1) { die('An error occurred while receiving from the socket'); @@ -47,14 +44,8 @@ require 'ipv6_skipif.inc'; echo "Received $buf from remote address $from and remote port $port" . PHP_EOL; socket_close($socket); ---EXPECTF-- +--EXPECT-- bool(false) - -Warning: Wrong parameter count for socket_sendto() in %s on line %d - -Warning: socket_recvfrom() expects at least 5 parameters, 4 given in %s on line %d - -Warning: Wrong parameter count for socket_recvfrom() in %s on line %d Received Ping! from remote address ::1 and remote port 1223 --CREDITS-- Falko Menge diff --git a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt index e25bf4df1a547..600cbea595648 100644 --- a/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt +++ b/ext/sockets/tests/socket_sentto_recvfrom_unix.phpt @@ -26,7 +26,6 @@ if (!extension_loaded('sockets')) { $msg = "Ping!"; $len = strlen($msg); - $bytes_sent = socket_sendto($socket, $msg, $len, 0); // cause warning $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address); if ($bytes_sent == -1) { @unlink($address); @@ -54,8 +53,6 @@ if (!extension_loaded('sockets')) { --EXPECTF-- Warning: socket_create(): Unable to create socket [%d]: Protocol not supported in %s on line %d bool(false) - -Warning: socket_sendto() expects at least 5 parameters, 4 given in %s on line %d bool(false) Received Ping! --CREDITS-- diff --git a/ext/sockets/tests/socket_strerror.phpt b/ext/sockets/tests/socket_strerror.phpt index aef56e5a84be8..4f1237e8908c9 100644 --- a/ext/sockets/tests/socket_strerror.phpt +++ b/ext/sockets/tests/socket_strerror.phpt @@ -14,13 +14,11 @@ fa@php.net ?> --FILE-- --EXPECTF-- -Warning: socket_strerror() expects exactly 1 parameter, 0 given in %s on line %d string(7) "Success" string(23) "Operation not permitted" string(25) "No such file or directory" diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index e690b946151ef..416cbd014e29e 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1344,15 +1344,12 @@ SPL_METHOD(SplFileInfo, setFileClass) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); zend_class_entry *ce = spl_ce_SplFileObject; - zend_error_handling error_handling; - - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { - intern->file_class = ce; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == FAILURE) { + return; } - zend_restore_error_handling(&error_handling); + intern->file_class = ce; } /* }}} */ @@ -1362,15 +1359,12 @@ SPL_METHOD(SplFileInfo, setInfoClass) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); zend_class_entry *ce = spl_ce_SplFileInfo; - zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling ); - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { - intern->info_class = ce; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == FAILURE) { + return; } - zend_restore_error_handling(&error_handling); + intern->info_class = ce; } /* }}} */ @@ -1380,15 +1374,12 @@ SPL_METHOD(SplFileInfo, getFileInfo) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); zend_class_entry *ce = intern->info_class; - zend_error_handling error_handling; - - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { - spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == FAILURE) { + return; } - zend_restore_error_handling(&error_handling); + spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value); } /* }}} */ @@ -1398,22 +1389,20 @@ SPL_METHOD(SplFileInfo, getPathInfo) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); zend_class_entry *ce = intern->info_class; - zend_error_handling error_handling; - - zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling); + size_t path_len; + char *path; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) { - size_t path_len; - char *path = spl_filesystem_object_get_pathname(intern, &path_len); - if (path) { - char *dpath = estrndup(path, path_len); - path_len = php_dirname(dpath, path_len); - spl_filesystem_object_create_info(intern, dpath, path_len, 1, ce, return_value); - efree(dpath); - } + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == FAILURE) { + return; } - zend_restore_error_handling(&error_handling); + path = spl_filesystem_object_get_pathname(intern, &path_len); + if (path) { + char *dpath = estrndup(path, path_len); + path_len = php_dirname(dpath, path_len); + spl_filesystem_object_create_info(intern, dpath, path_len, 1, ce, return_value); + efree(dpath); + } } /* }}} */ diff --git a/ext/spl/tests/SplFileInfo_setFileClass_error.phpt b/ext/spl/tests/SplFileInfo_setFileClass_error.phpt index 7443998013ce5..db0186f21817e 100644 --- a/ext/spl/tests/SplFileInfo_setFileClass_error.phpt +++ b/ext/spl/tests/SplFileInfo_setFileClass_error.phpt @@ -7,7 +7,7 @@ $info = new SplFileInfo(__FILE__); try { $info->setFileClass('stdClass'); -} catch (UnexpectedValueException $e) { +} catch (TypeError $e) { echo $e->getMessage(), "\n"; } diff --git a/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt b/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt index a280a6e1474f2..9a2e71defe52f 100644 --- a/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt +++ b/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt @@ -7,7 +7,7 @@ $info = new SplFileInfo(__FILE__); try { $info->setInfoClass('stdClass'); -} catch (UnexpectedValueException $e) { +} catch (TypeError $e) { echo $e->getMessage(), "\n"; } diff --git a/ext/spl/tests/SplFileObject_seek_error_001.phpt b/ext/spl/tests/SplFileObject_seek_error_001.phpt index 4de5bcdd4d2c7..8741e3b7887d5 100644 --- a/ext/spl/tests/SplFileObject_seek_error_001.phpt +++ b/ext/spl/tests/SplFileObject_seek_error_001.phpt @@ -2,9 +2,7 @@ SplFileObject::seek function - test parameters --FILE-- seek(1,2); -$obj->seek(); +$obj = new SplFileObject(__FILE__); try { $obj->seek(-1); } catch (LogicException $e) { @@ -12,7 +10,4 @@ try { } ?> --EXPECTF-- -Warning: SplFileObject::seek() expects exactly 1 parameter, 2 given in %s - -Warning: SplFileObject::seek() expects exactly 1 parameter, 0 given in %s -Can't seek file %s to negative line %s +Can't seek file %s to negative line -1 diff --git a/ext/spl/tests/arrayObject_asort_basic1.phpt b/ext/spl/tests/arrayObject_asort_basic1.phpt index 6c6fd2949ffc0..094d825bb6250 100644 --- a/ext/spl/tests/arrayObject_asort_basic1.phpt +++ b/ext/spl/tests/arrayObject_asort_basic1.phpt @@ -15,7 +15,11 @@ $ao1 = new ArrayObject(array(4,2,3)); $ao2 = new ArrayObject(array('a'=>4,'b'=>2,'c'=>3)); var_dump($ao1->asort()); var_dump($ao1); -var_dump($ao2->asort('blah')); +try { + var_dump($ao2->asort('blah')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($ao2); var_dump($ao2->asort(SORT_NUMERIC)); var_dump($ao2); @@ -35,9 +39,7 @@ object(ArrayObject)#%d (1) { int(4) } } - -Warning: asort() expects parameter 2 to be int, string given in %sarrayObject_asort_basic1.php on line %d -bool(false) +asort() expects parameter 2 to be int, string given object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { diff --git a/ext/spl/tests/arrayObject_count_basic1.phpt b/ext/spl/tests/arrayObject_count_basic1.phpt index 41e1527f933a1..3271090d08218 100644 --- a/ext/spl/tests/arrayObject_count_basic1.phpt +++ b/ext/spl/tests/arrayObject_count_basic1.phpt @@ -25,9 +25,6 @@ var_dump(count($c), count($ao)); unset($c[0]); unset($ao[0]); var_dump($c->count(), $ao->count()); - -//Extra args are ignored. -var_dump($ao->count('blah')); ?> ==ArrayIterator== count(), $ao->count()); - -//Extra args are ignored. -var_dump($ao->count('blah')); ?> ---EXPECTF-- +--EXPECT-- ==ArrayObject== int(99) int(0) @@ -67,9 +61,6 @@ int(99) int(2) int(99) int(1) - -Warning: ArrayObject::count() expects exactly 0 parameters, 1 given in %s on line %d -NULL ==ArrayIterator== int(99) int(0) @@ -79,6 +70,3 @@ int(99) int(2) int(99) int(1) - -Warning: ArrayIterator::count() expects exactly 0 parameters, 1 given in %s on line %d -NULL diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt index 823256edbcc50..c6759a31cf4da 100644 --- a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt +++ b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt @@ -29,8 +29,8 @@ $ao = new ArrayObject($original); try { $copy = $ao->exchangeArray(); $copy['addedToCopy'] = 'added To Copy'; -} catch (Exception $e) { - echo "Exception:" . $e->getMessage() . "\n"; +} catch (TypeError $e) { + echo "Exception: " . $e->getMessage() . "\n"; } $original->addedToOriginal = 'added To Original'; var_dump($ao, $original, $copy); @@ -81,8 +81,9 @@ array(2) { --> exchangeArray() with no arg: +Exception: ArrayObject::exchangeArray() expects exactly 1 parameter, 0 given -Warning: ArrayObject::exchangeArray() expects exactly 1 parameter, 0 given in %s on line 27 +Notice: Undefined variable: copy in %s on line %d object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> object(C)#3 (2) { @@ -98,10 +99,7 @@ object(C)#3 (2) { ["addedToOriginal"]=> string(17) "added To Original" } -array(1) { - ["addedToCopy"]=> - string(13) "added To Copy" -} +NULL --> exchangeArray() with bad arg type: diff --git a/ext/spl/tests/arrayObject_ksort_basic1.phpt b/ext/spl/tests/arrayObject_ksort_basic1.phpt index 1692a02ef1d3c..aa1abbf239a5f 100644 --- a/ext/spl/tests/arrayObject_ksort_basic1.phpt +++ b/ext/spl/tests/arrayObject_ksort_basic1.phpt @@ -14,7 +14,11 @@ $ao1 = new ArrayObject(array(4,2,3)); $ao2 = new ArrayObject(array('b'=>4,'a'=>2,'q'=>3, 99=>'x')); var_dump($ao1->ksort()); var_dump($ao1); -var_dump($ao2->ksort('blah')); +try { + var_dump($ao2->ksort('blah')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($ao2); var_dump($ao2->ksort(SORT_STRING)); var_dump($ao2); @@ -34,9 +38,7 @@ object(ArrayObject)#%d (1) { int(3) } } - -Warning: ksort() expects parameter 2 to be int, string given in %sarrayObject_ksort_basic1.php on line %d -bool(false) +ksort() expects parameter 2 to be int, string given object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(4) { diff --git a/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt b/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt index 89efdb6a9f6a2..d0910b3a0a95a 100644 --- a/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt +++ b/ext/spl/tests/arrayObject_setIteratorClass_error1.phpt @@ -8,7 +8,7 @@ try { foreach($ao as $key=>$value) { echo " $key=>$value\n"; } -} catch (Exception $e) { +} catch (TypeError $e) { var_dump($e->getMessage()); } @@ -18,7 +18,7 @@ try { foreach($ao as $key=>$value) { echo " $key=>$value\n"; } -} catch (Exception $e) { +} catch (TypeError $e) { var_dump($e->getMessage()); } @@ -43,14 +43,7 @@ try { ?> --EXPECTF-- -Warning: ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from Iterator, 'nonExistentClass' given in %s on line 4 - a=>1 - b=>2 - c=>3 - -Warning: ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from Iterator, 'stdClass' given in %s on line 14 - a=>1 - b=>2 - c=>3 +string(118) "ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from Iterator, 'nonExistentClass' given" +string(110) "ArrayObject::setIteratorClass() expects parameter 1 to be a class name derived from Iterator, 'stdClass' given" string(113) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClass' given" string(105) "ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'stdClass' given" diff --git a/ext/spl/tests/bug46051.phpt b/ext/spl/tests/bug46051.phpt index e993951ffa1b8..d53f87bc47090 100644 --- a/ext/spl/tests/bug46051.phpt +++ b/ext/spl/tests/bug46051.phpt @@ -6,8 +6,8 @@ Bug #46051 (SplFileInfo::openFile - memory overlap) $x = new splfileinfo(__FILE__); try { -$x->openFile(NULL, NULL, NULL); -} catch (Exception $e) { } + $x->openFile(NULL, NULL, NULL); +} catch (TypeError $e) { } var_dump($x->getPathName()); --EXPECTF-- diff --git a/ext/spl/tests/bug65545.phpt b/ext/spl/tests/bug65545.phpt index 76c29cbf48f25..bd5a7f06dbfd8 100644 --- a/ext/spl/tests/bug65545.phpt +++ b/ext/spl/tests/bug65545.phpt @@ -6,9 +6,6 @@ $obj = new SplFileObject(__FILE__, 'r'); $data = $obj->fread(5); var_dump($data); -$data = $obj->fread(); -var_dump($data); - $data = $obj->fread(0); var_dump($data); @@ -20,9 +17,6 @@ var_dump(strlen($data) === filesize(__FILE__) - 5); --EXPECTF-- string(5) "fwrite("blahlubba"); var_dump($fo->ftruncate(4)); $fo->rewind(); -var_dump($fo->fgets(8)); +var_dump($fo->fgets()); $fo->rewind(); $fo->fwrite("blahlubba"); -// This should throw a warning and return NULL since an argument is missing -var_dump($fo->ftruncate()); - ?> ==DONE== --CLEAN-- @@ -33,10 +30,5 @@ unlink($path); ?> --EXPECTF-- bool(true) - -Warning: SplFileObject::fgets() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: SplFileObject::ftruncate() expects exactly 1 parameter, 0 given in %s on line %d -NULL +string(4) "blah" ==DONE== diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt index 1271ccaa6495f..66d03dc359364 100644 --- a/ext/spl/tests/iterator_044.phpt +++ b/ext/spl/tests/iterator_044.phpt @@ -24,8 +24,16 @@ class MyCachingIterator extends CachingIterator { echo "===$k===\n"; var_dump($v); - var_dump($this->offsetExists($v)); - var_dump($this->offsetGet($v)); + try { + var_dump($this->offsetExists($v)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump($this->offsetGet($v)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } } } @@ -52,9 +60,6 @@ catch(Exception $e) $it = new MyCachingIterator(new ArrayIterator(array(0, 'foo'=>1, 2, 'bar'=>3, 4)), CachingIterator::FULL_CACHE); -var_dump($it->offsetExists()); -var_dump($it->offsetGet()); - $checks = array(0, new stdClass, new MyFoo, NULL, 2, 'foo', 3); $it->test($checks); @@ -71,12 +76,6 @@ $it->test($checks); --EXPECTF-- Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) - -Warning: CachingIterator::offsetExists() expects exactly 1 parameter, 0 given in %siterator_044.php on line %d -NULL - -Warning: CachingIterator::offsetGet() expects exactly 1 parameter, 0 given in %siterator_044.php on line %d -NULL ===0=== int(0) bool(false) @@ -86,12 +85,8 @@ NULL ===1=== object(stdClass)#%d (0) { } - -Warning: CachingIterator::offsetExists() expects parameter 1 to be string, object given in %siterator_044.php on line %d -NULL - -Warning: CachingIterator::offsetGet() expects parameter 1 to be string, object given in %siterator_044.php on line %d -NULL +CachingIterator::offsetExists() expects parameter 1 to be string, object given +CachingIterator::offsetGet() expects parameter 1 to be string, object given ===2=== object(MyFoo)#%d (0) { } @@ -131,12 +126,8 @@ int(0) ===1=== object(stdClass)#1 (0) { } - -Warning: CachingIterator::offsetExists() expects parameter 1 to be string, object given in %siterator_044.php on line %d -NULL - -Warning: CachingIterator::offsetGet() expects parameter 1 to be string, object given in %siterator_044.php on line %d -NULL +CachingIterator::offsetExists() expects parameter 1 to be string, object given +CachingIterator::offsetGet() expects parameter 1 to be string, object given ===2=== object(MyFoo)#2 (0) { } diff --git a/ext/spl/tests/iterator_045.phpt b/ext/spl/tests/iterator_045.phpt index c8ffae77a5e8b..fce7ab3655401 100644 --- a/ext/spl/tests/iterator_045.phpt +++ b/ext/spl/tests/iterator_045.phpt @@ -73,10 +73,6 @@ catch(Exception $e) $it = new MyCachingIterator(new ArrayIterator(array(0, 1, 2, 3)), CachingIterator::FULL_CACHE); -var_dump($it->offsetSet()); -var_dump($it->offsetSet(0)); -var_dump($it->offsetUnset()); - $checks = array(0 => 25, 1 => 42, 3 => 'FooBar'); $unsets = array(0, 2); @@ -97,15 +93,6 @@ $it->show(); --EXPECTF-- Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) - -Warning: CachingIterator::offsetSet() expects exactly 2 parameters, 0 given in %siterator_045.php on line %d -NULL - -Warning: CachingIterator::offsetSet() expects exactly 2 parameters, 1 given in %siterator_045.php on line %d -NULL - -Warning: CachingIterator::offsetUnset() expects exactly 1 parameter, 0 given in %siterator_045.php on line %d -NULL MyCachingIterator::testSet() set(0,25) set(1,42) diff --git a/ext/spl/tests/iterator_count.phpt b/ext/spl/tests/iterator_count.phpt index c0dad0f4223c2..944b40dd961eb 100644 --- a/ext/spl/tests/iterator_count.phpt +++ b/ext/spl/tests/iterator_count.phpt @@ -9,20 +9,10 @@ $array=array('a','b'); $iterator = new ArrayIterator($array); -iterator_count(); - - -iterator_count($iterator,'1'); - iterator_count('1'); - ?> --EXPECTF-- -Warning: iterator_count() expects exactly 1 parameter, 0 given in %s - -Warning: iterator_count() expects exactly 1 parameter, 2 given in %s - Fatal error: Uncaught TypeError: Argument 1 passed to iterator_count() must implement interface Traversable, string given in %s:%d Stack trace: #0 %s(%d): iterator_count('1') diff --git a/ext/spl/tests/iterator_to_array.phpt b/ext/spl/tests/iterator_to_array.phpt index f36b99db23f56..a5a8e5a9b7e33 100644 --- a/ext/spl/tests/iterator_to_array.phpt +++ b/ext/spl/tests/iterator_to_array.phpt @@ -9,19 +9,10 @@ $array=array('a','b'); $iterator = new ArrayIterator($array); -iterator_to_array(); - - -iterator_to_array($iterator,'test','test'); - iterator_to_array('test','test'); ?> --EXPECTF-- -Warning: iterator_to_array() expects at least 1 parameter, 0 given in %s - -Warning: iterator_to_array() expects at most 2 parameters, 3 given in %s - Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, string given in %s:%d Stack trace: #0 %s(%d): iterator_to_array('test', 'test') diff --git a/ext/spl/tests/regexIterator_setMode_error.phpt b/ext/spl/tests/regexIterator_setMode_error.phpt index 77732b058c416..046086102be52 100644 --- a/ext/spl/tests/regexIterator_setMode_error.phpt +++ b/ext/spl/tests/regexIterator_setMode_error.phpt @@ -17,12 +17,8 @@ try { var_dump($e->getCode()); } -$regexIterator->setMode('foo'); - ?> --EXPECTF-- int(0) string(14) "Illegal mode 7" int(0) - -Warning: RegexIterator::setMode() expects parameter 1 to be int, string given in %s on line %d diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt index 60de68b82a948..72458446e1c37 100644 --- a/ext/spl/tests/spl_004.phpt +++ b/ext/spl/tests/spl_004.phpt @@ -44,11 +44,19 @@ var_dump(iterator_apply($it, 'test')); echo "===ERRORS===\n"; try { var_dump(iterator_apply($it, 'test', 1)); -} catch (Error $e) { - my_error_handler($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(iterator_apply($it, 'non_existing_function')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(iterator_apply($it, 'non_existing_function', NULL, 2)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } -var_dump(iterator_apply($it, 'non_existing_function')); -var_dump(iterator_apply($it, 'non_existing_function', NULL, 2)); ?> ===DONE=== @@ -78,9 +86,7 @@ int(5) int(6) int(4) ===ERRORS=== -Error: Argument 3 passed to iterator_apply() must be of the type array or null, int given -Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name -NULL -Error: iterator_apply() expects at most 3 parameters, 4 given -NULL +Argument 3 passed to iterator_apply() must be of the type array or null, int given +iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name +iterator_apply() expects at most 3 parameters, 4 given ===DONE=== diff --git a/ext/spl/tests/spl_heap_is_empty_basic.phpt b/ext/spl/tests/spl_heap_is_empty_basic.phpt index 47d7ccce9a3f5..4a90734ad4415 100644 --- a/ext/spl/tests/spl_heap_is_empty_basic.phpt +++ b/ext/spl/tests/spl_heap_is_empty_basic.phpt @@ -21,11 +21,8 @@ $heap->insert(1); var_dump($heap->isEmpty()); $heap->extract(); var_dump($heap->isEmpty()); -$heap->isEmpty('var'); ?> --EXPECTF-- bool(true) bool(false) bool(true) - -Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s diff --git a/ext/spl/tests/spl_object_id.phpt b/ext/spl/tests/spl_object_id.phpt index ca13b03feee41..a4e8518eafda7 100644 --- a/ext/spl/tests/spl_object_id.phpt +++ b/ext/spl/tests/spl_object_id.phpt @@ -4,18 +4,10 @@ SPL: spl_object_id() --EXPECTF-- int(%d) - -Warning: spl_object_id() expects parameter 1 to be object, int given in %sspl_object_id.php on line %d -NULL - -Warning: spl_object_id() expects exactly 1 parameter, 0 given in %sspl_object_id.php on line %d -NULL bool(false) diff --git a/ext/sqlite3/tests/sqlite3_33_reset.phpt b/ext/sqlite3/tests/sqlite3_33_reset.phpt index 531874ceb6024..48abc829c7f66 100644 --- a/ext/sqlite3/tests/sqlite3_33_reset.phpt +++ b/ext/sqlite3/tests/sqlite3_33_reset.phpt @@ -15,13 +15,11 @@ $db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')"); $stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id'); $stmt->bindValue(':id', 1, SQLITE3_INTEGER); -$stmt->reset("dummy"); $stmt->reset(); //var_dump($db); //var_dump($db->close()); echo "Done\n"; ?> ---EXPECTF-- -Warning: SQLite3Stmt::reset() expects exactly 0 parameters, 1 given in %s on line %d +--EXPECT-- Done diff --git a/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt b/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt index 767f9d00650d4..d921b99dd7ac6 100644 --- a/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt +++ b/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt @@ -17,7 +17,6 @@ try{ } var_dump($db->enableExceptions(false)); $db->query("SELECT * FROM non_existent_table"); -var_dump($db->enableExceptions("wrong_type","wrong_type")); echo "Closing database\n"; var_dump($db->close()); echo "Done\n"; @@ -28,9 +27,6 @@ no such table: non_existent_table bool(true) Warning: SQLite3::query(): no such table: non_existent_table in %s on line %d - -Warning: SQLite3::enableExceptions() expects at most 1 parameter, 2 given in %s on line %d -NULL Closing database bool(true) Done diff --git a/ext/standard/random.c b/ext/standard/random.c index f6568a658fd8e..01d99a5eefcef 100644 --- a/ext/standard/random.c +++ b/ext/standard/random.c @@ -194,7 +194,7 @@ PHP_FUNCTION(random_bytes) zend_long size; zend_string *bytes; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 1, 1) + ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_LONG(size) ZEND_PARSE_PARAMETERS_END(); @@ -268,7 +268,7 @@ PHP_FUNCTION(random_int) zend_long max; zend_long result; - ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_THROW, 2, 2) + ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_LONG(min) Z_PARAM_LONG(max) ZEND_PARSE_PARAMETERS_END(); diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index ebb4d2593fb5c..4b131033b1020 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1671,8 +1671,7 @@ PHP_FUNCTION(sapi_windows_vt100_support) php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); } else { - zend_internal_type_error( - ZEND_ARG_USES_STRICT_TYPES(), + zend_type_error( "%s() was not able to analyze the specified stream", get_active_function_name() ); diff --git a/ext/standard/tests/array/005.phpt b/ext/standard/tests/array/005.phpt index c82f5f7fd0beb..c51e98a67b28e 100644 --- a/ext/standard/tests/array/005.phpt +++ b/ext/standard/tests/array/005.phpt @@ -33,18 +33,6 @@ $mixed_array = array( /* Testing Error Conditions */ echo "\n*** Testing Error Conditions ***\n"; -/* Zero argument */ -var_dump( array_shift() ); - -/* Scalar argument */ -var_dump( array_shift($number) ); - -/* String argument */ -var_dump( array_shift($str) ); - -/* Invalid Number of arguments */ -var_dump( array_shift($mixed_array[1],$mixed_array[2]) ); - /* Empty Array as argument */ var_dump( array_shift($empty_array) ); @@ -83,18 +71,6 @@ echo"Done"; ?> --EXPECTF-- *** Testing Error Conditions *** - -Warning: array_shift() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: array_shift() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: array_shift() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: array_shift() expects exactly 1 parameter, 2 given in %s on line %d -NULL NULL *** Testing with various array inputs *** diff --git a/ext/standard/tests/array/009.phpt b/ext/standard/tests/array/009.phpt index 017456917ebfe..c62be0d27c2c2 100644 --- a/ext/standard/tests/array/009.phpt +++ b/ext/standard/tests/array/009.phpt @@ -69,51 +69,6 @@ foreach ($varient_arrays as $sub_array ) { echo "\n"; } -/*test these functions on array which is already unset */ -echo "\n-- Testing variation: when array is unset --\n"; -$unset_array = array (1); -unset($unset_array); - -var_dump( current($unset_array) ); -var_dump( key($unset_array) ); -var_dump( next($unset_array) ); -var_dump( reset($unset_array) ); - - -echo "\n*** Testing error conditions ***\n"; -//Zero argument, expected 1 argument -var_dump( key() ); -var_dump( current() ); -var_dump( reset() ); -var_dump( next() ); - -// args more than expected, expected 1 argument -$temp_array = array(1); -var_dump( key($temp_array, $temp_array) ); -var_dump( current($temp_array, $temp_array) ); -var_dump( reset($temp_array, $temp_array) ); -var_dump( next($temp_array, $temp_array) ); - -// invalid args type, valid argument: array -$int_var = 1; -$float_var = 1.5; -$string = "string"; -var_dump( key($int_var) ); -var_dump( key($float_var) ); -var_dump( key($string) ); - -var_dump( current($int_var) ); -var_dump( current($float_var) ); -var_dump( current($string) ); - -var_dump( next($int_var) ); -var_dump( next($float_var) ); -var_dump( next($string) ); - -var_dump( reset($int_var) ); -var_dump( reset($float_var) ); -var_dump( reset($string) ); - echo "Done\n"; ?> --EXPECTF-- @@ -456,84 +411,4 @@ array(5) { string(4) "zero" } - --- Testing variation: when array is unset -- - -Notice: Undefined variable: unset_array in %s on line %d - -Warning: current() expects parameter 1 to be array, null given in %s on line %d -NULL - -Notice: Undefined variable: unset_array in %s on line %d - -Warning: key() expects parameter 1 to be array, null given in %s on line %d -NULL - -Warning: next() expects parameter 1 to be array, null given in %s on line %d -NULL - -Warning: reset() expects parameter 1 to be array, null given in %s on line %d -NULL - -*** Testing error conditions *** - -Warning: key() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: current() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: reset() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: next() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: key() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: current() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: reset() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: next() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: key() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: key() expects parameter 1 to be array, float given in %s on line %d -NULL - -Warning: key() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: current() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: current() expects parameter 1 to be array, float given in %s on line %d -NULL - -Warning: current() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: next() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: next() expects parameter 1 to be array, float given in %s on line %d -NULL - -Warning: next() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: reset() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: reset() expects parameter 1 to be array, float given in %s on line %d -NULL - -Warning: reset() expects parameter 1 to be array, string given in %s on line %d -NULL Done diff --git a/ext/standard/tests/array/array_change_key_case_variation.phpt b/ext/standard/tests/array/array_change_key_case_variation.phpt index 3f8d502ffe60e..f2b185523f32d 100644 --- a/ext/standard/tests/array/array_change_key_case_variation.phpt +++ b/ext/standard/tests/array/array_change_key_case_variation.phpt @@ -6,13 +6,16 @@ Test array_change_key_case() function - 2 $item = array ("one" => 1, "two" => 2, "THREE" => 3, "FOUR" => "four"); /* use 'case' argument other than CASE_LOWER & CASE_UPPER */ -var_dump(array_change_key_case($item, "CASE_UPPER")); +try { + var_dump(array_change_key_case($item, "CASE_UPPER")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(array_change_key_case($item, 5)); /* when keys are different in terms of only case */ /* should return one value key pair with key being in lowercase */ var_dump( array_change_key_case( array("ONE" => 1, "one" => 3, "One" => 4) ) ); -var_dump( array_change_key_case( array("ONE" => 1, "one" => 6, "One" => 5), "CASE_UPPER" ) ); /* should return one value key pair with key being in uppercase */ var_dump( array_change_key_case( array("ONE" => 1, "one" => 2, "One" => 3), CASE_UPPER ) ); @@ -21,8 +24,7 @@ var_dump( array_change_key_case( array("ONE" => 1, "one" => 1, "One" => 2), 5 ) echo "end\n"; ?> --EXPECTF-- -Warning: array_change_key_case() expects parameter 2 to be int, string given in %s on line %d -NULL +array_change_key_case() expects parameter 2 to be int, string given array(4) { ["ONE"]=> int(1) @@ -37,9 +39,6 @@ array(1) { ["one"]=> int(4) } - -Warning: array_change_key_case() expects parameter 2 to be int, string given in %s on line %d -NULL array(1) { ["ONE"]=> int(3) diff --git a/ext/standard/tests/array/array_column_error.phpt b/ext/standard/tests/array/array_column_error.phpt index 26a09aff24881..92232485202f8 100644 --- a/ext/standard/tests/array/array_column_error.phpt +++ b/ext/standard/tests/array/array_column_error.phpt @@ -11,18 +11,6 @@ Test array_column() function: error conditions echo "*** Testing array_column() : error conditions ***\n"; -echo "\n-- Testing array_column() function with Zero arguments --\n"; -var_dump(array_column()); - -echo "\n-- Testing array_column() function with One argument --\n"; -var_dump(array_column(array())); - -echo "\n-- Testing array_column() function with string as first parameter --\n"; -var_dump(array_column('foo', 0)); - -echo "\n-- Testing array_column() function with int as first parameter --\n"; -var_dump(array_column(1, 'foo')); - echo "\n-- Testing array_column() column key parameter should be a string or an integer (testing bool) --\n"; var_dump(array_column(array(), true)); @@ -40,26 +28,6 @@ echo "Done\n"; --EXPECTF-- *** Testing array_column() : error conditions *** --- Testing array_column() function with Zero arguments -- - -Warning: array_column() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing array_column() function with One argument -- - -Warning: array_column() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing array_column() function with string as first parameter -- - -Warning: array_column() expects parameter 1 to be array, string given in %s on line %d -NULL - --- Testing array_column() function with int as first parameter -- - -Warning: array_column() expects parameter 1 to be array, int given in %s on line %d -NULL - -- Testing array_column() column key parameter should be a string or an integer (testing bool) -- Warning: array_column(): The column key should be either a string or an integer in %s on line %d diff --git a/ext/standard/tests/array/array_diff_uassoc_error.phpt b/ext/standard/tests/array/array_diff_uassoc_error.phpt index d90c80f20b793..f6c6905780b57 100644 --- a/ext/standard/tests/array/array_diff_uassoc_error.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_error.phpt @@ -27,36 +27,32 @@ function key_compare_func($a, $b) //Test array_diff_uassoc with one more than the expected number of arguments echo "\n-- Testing array_diff_uassoc() function with more than expected no. of arguments --\n"; -var_dump( array_diff_uassoc($array1, $array2, "key_compare_func", $extra_arg) ); -var_dump( array_diff_uassoc($array1, $array2, $array3, $array4, "key_compare_func", $extra_arg) ); +try { + var_dump( array_diff_uassoc($array1, $array2, "key_compare_func", $extra_arg) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump( array_diff_uassoc($array1, $array2, $array3, $array4, "key_compare_func", $extra_arg) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} // Testing array_diff_uassoc with one less than the expected number of arguments echo "\n-- Testing array_diff_uassoc() function with less than expected no. of arguments --\n"; var_dump( array_diff_uassoc($array1, $array2) ); -// Testing array_diff_uassoc with no arguments -echo "\n-- Testing array_diff_uassoc() function with no arguments --\n"; -var_dump( array_diff_uassoc() ); ?> ===DONE=== --EXPECTF-- *** Testing array_diff_uassoc() : error conditions *** -- Testing array_diff_uassoc() function with more than expected no. of arguments -- - -Warning: array_diff_uassoc() expects parameter 4 to be a valid callback, array must have exactly two members in %s on line %d -NULL - -Warning: array_diff_uassoc() expects parameter 6 to be a valid callback, array must have exactly two members in %s on line %d -NULL +array_diff_uassoc() expects parameter 4 to be a valid callback, array must have exactly two members +array_diff_uassoc() expects parameter 6 to be a valid callback, array must have exactly two members -- Testing array_diff_uassoc() function with less than expected no. of arguments -- Warning: array_diff_uassoc(): at least 3 parameters are required, 2 given in %s on line %d NULL - --- Testing array_diff_uassoc() function with no arguments -- - -Warning: array_diff_uassoc(): at least 3 parameters are required, 0 given in %s on line %d -NULL ===DONE=== diff --git a/ext/standard/tests/array/array_diff_ukey_variation10.phpt b/ext/standard/tests/array/array_diff_ukey_variation10.phpt index 2f07428c05c43..e80f02629ea42 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation10.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation10.phpt @@ -14,19 +14,23 @@ $array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red"); $array2 = array("a" => "green", "yellow", "red"); //function name within double quotes -var_dump( array_diff_ukey($array1, $array1, "unknown_function") ); +try { + var_dump( array_diff_ukey($array1, $array1, "unknown_function") ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} //function name within single quotes -var_dump( array_diff_ukey($array1, $array1, 'unknown_function') ); +try { + var_dump( array_diff_ukey($array1, $array1, 'unknown_function') ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ===DONE=== ---EXPECTF-- +--EXPECT-- *** Testing array_diff_ukey() : usage variation *** - -Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d -NULL - -Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d -NULL +array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name +array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name ===DONE=== diff --git a/ext/standard/tests/array/array_fill_error.phpt b/ext/standard/tests/array/array_fill_error.phpt index 2fbdb850c3570..386404a33629e 100644 --- a/ext/standard/tests/array/array_fill_error.phpt +++ b/ext/standard/tests/array/array_fill_error.phpt @@ -10,44 +10,16 @@ Test array_fill() function : error conditions echo "*** Testing array_fill() : error conditions ***\n"; -// Zero arguments -echo "-- Testing array_fill() function with Zero arguments --\n"; -var_dump( array_fill() ); - -// More than expected number of arguments -echo "-- Testing array_fill() function with more than expected no. of arguments --\n"; +// calling array_fill with negative values for 'num' parameter $start_key = 0; -$num = 2; -$val = 1; -$extra_arg = 10; -var_dump( array_fill($start_key,$num,$val, $extra_arg) ); - -// Less than the expected number of arguments -echo "-- Testing array_fill() function with less than expected no. of arguments --\n"; -$start_key = 0; -$num = 2; -var_dump( array_fill($start_key,$num) ); - -//calling array_fill with negative values for 'num' parameter $num = -1; +$val = 1; var_dump( array_fill($start_key,$num,$val) ); echo "Done"; ?> --EXPECTF-- *** Testing array_fill() : error conditions *** --- Testing array_fill() function with Zero arguments -- - -Warning: array_fill() expects exactly 3 parameters, 0 given in %s on line %d -NULL --- Testing array_fill() function with more than expected no. of arguments -- - -Warning: array_fill() expects exactly 3 parameters, 4 given in %s on line %d -NULL --- Testing array_fill() function with less than expected no. of arguments -- - -Warning: array_fill() expects exactly 3 parameters, 2 given in %s on line %d -NULL Warning: array_fill(): Number of elements can't be negative in %s on line %d bool(false) diff --git a/ext/standard/tests/array/array_fill_keys.phpt b/ext/standard/tests/array/array_fill_keys.phpt index 12adde72e72b1..fb222a414bae3 100644 --- a/ext/standard/tests/array/array_fill_keys.phpt +++ b/ext/standard/tests/array/array_fill_keys.phpt @@ -4,15 +4,12 @@ basic array_fill_keys test precision=14 --FILE-- ---EXPECTF-- -Warning: array_fill_keys() expects parameter 1 to be array, string given in %s on line %d -NULL +--EXPECT-- array(0) { } array(2) { diff --git a/ext/standard/tests/array/array_fill_keys_variation3.phpt b/ext/standard/tests/array/array_fill_keys_variation3.phpt index 84cc928cbc358..b1abbcfe1b9c4 100644 --- a/ext/standard/tests/array/array_fill_keys_variation3.phpt +++ b/ext/standard/tests/array/array_fill_keys_variation3.phpt @@ -12,33 +12,18 @@ Test array_fill_keys() function : variation of parameter echo "*** Testing array_fill_keys() : parameter variations ***\n"; -$simpleStr = "simple"; $fp = fopen(__FILE__, "r"); -$bool = false; -$float = 2.4; $array = array("one", "two"); -$nullVal = null; - -echo "\n-- Testing array_fill_keys() function with both wrong arguments --\n"; -var_dump( array_fill_keys($bool, $float) ); echo "\n-- Testing array_fill_keys() function with unusual second arguments --\n"; var_dump( array_fill_keys($array, $fp) ); -echo "\n-- Testing array_fill_keys() function with mixed array --\n"; -var_dump( array_fill_keys($nullVal, $simpleStr) ); - fclose($fp); echo "Done"; ?> --EXPECTF-- *** Testing array_fill_keys() : parameter variations *** --- Testing array_fill_keys() function with both wrong arguments -- - -Warning: array_fill_keys() expects parameter 1 to be array, bool given in %sarray_fill_keys_variation3.php on line %d -NULL - -- Testing array_fill_keys() function with unusual second arguments -- array(2) { ["one"]=> @@ -46,9 +31,4 @@ array(2) { ["two"]=> resource(%d) of type (stream) } - --- Testing array_fill_keys() function with mixed array -- - -Warning: array_fill_keys() expects parameter 1 to be array, null given in %sarray_fill_keys_variation3.php on line %d -NULL Done diff --git a/ext/standard/tests/array/array_filter.phpt b/ext/standard/tests/array/array_filter.phpt index ba27a59c963f3..1488aedd09194 100644 --- a/ext/standard/tests/array/array_filter.phpt +++ b/ext/standard/tests/array/array_filter.phpt @@ -26,9 +26,6 @@ var_dump(array_filter($array2, "even")); var_dump(array_filter($array3, "even")); var_dump(array_filter(array())); -var_dump(array_filter(array(), array())); -var_dump(array_filter("", null)); -var_dump(array_filter($array1, 1)); echo '== DONE =='; ?> @@ -81,13 +78,4 @@ array(2) { } array(0) { } - -Warning: array_filter() expects parameter 2 to be a valid callback, array must have exactly two members in %s on line %d -NULL - -Warning: array_filter() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: array_filter() expects parameter 2 to be a valid callback, no array or string given in %s on line %d -NULL == DONE == diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt index 4749fe8e45d5d..a32fdadc05ff0 100644 --- a/ext/standard/tests/array/array_filter_variation10.phpt +++ b/ext/standard/tests/array/array_filter_variation10.phpt @@ -48,7 +48,11 @@ var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_KEY)); var_dump(array_filter($mixed, 'is_numeric', 0)); -var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_BOTH)); +try { + var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_BOTH)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done" ?> @@ -88,14 +92,5 @@ array(2) { ["b"]=> int(2) } - -Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48 - -Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48 - -Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48 - -Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48 -array(0) { -} +is_numeric() expects exactly 1 parameter, 2 given Done diff --git a/ext/standard/tests/array/array_filter_variation9.phpt b/ext/standard/tests/array/array_filter_variation9.phpt index ed89d13d35b24..1755a322b0fc5 100644 --- a/ext/standard/tests/array/array_filter_variation9.phpt +++ b/ext/standard/tests/array/array_filter_variation9.phpt @@ -22,10 +22,18 @@ var_dump( array_filter($input, 'is_int') ); var_dump( array_filter($input, 'chr') ); // using language construct 'echo' as 'callback' -var_dump( array_filter($input, 'echo') ); +try { + var_dump( array_filter($input, 'echo') ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} // using language construct 'exit' as 'callback' -var_dump( array_filter($input, 'exit') ); +try { + var_dump( array_filter($input, 'exit') ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done" ?> @@ -63,10 +71,6 @@ array(8) { [7]=> NULL } - -Warning: array_filter() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL - -Warning: array_filter() expects parameter 2 to be a valid callback, function 'exit' not found or invalid function name in %s on line %d -NULL +array_filter() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name +array_filter() expects parameter 2 to be a valid callback, function 'exit' not found or invalid function name Done diff --git a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt index 65432379d71e1..f4b91503bc092 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt @@ -14,19 +14,23 @@ $array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4); $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); //function name within double quotes -var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); +try { + var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} //function name within single quotes -var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') ); +try { + var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ===DONE=== --EXPECTF-- *** Testing array_intersect_ukey() : usage variation *** - -Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d -NULL - -Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d -NULL +array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name +array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name ===DONE=== diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index 61faf0158ddcf..e917815337219 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -69,24 +69,8 @@ foreach ($search_arrays_v as $search_array) { } echo "\n*** Testing error conditions ***\n"; -//Zeor args -var_dump( array_key_exists() ); // first args as array var_dump( array_key_exists(array(), array()) ); -// second args as string -var_dump( array_key_exists("", "") ); -// second args a integer -var_dump( array_key_exists(1, 1) ); -// second args as NULL -var_dump( array_key_exists(1, NULL) ); -// second args as boolean -var_dump( array_key_exists(1, true) ); -// first args as boolean -var_dump( array_key_exists(false, true) ); -// second args as float -var_dump( array_key_exists(false, 17.5) ); -// args more than expected -var_dump( array_key_exists(1, array(), array()) ); // first argument as floating point value var_dump( array_key_exists(17.5, array(1,23) ) ) ; @@ -249,33 +233,9 @@ bool(true) *** Testing error conditions *** -Warning: array_key_exists() expects exactly 2 parameters, 0 given in %s on line %d -NULL - Warning: array_key_exists(): The first argument should be either a string or an integer in %s on line %d bool(false) -Warning: array_key_exists() expects parameter 2 to be array, string given in %s on line %d -NULL - -Warning: array_key_exists() expects parameter 2 to be array, int given in %s on line %d -NULL - -Warning: array_key_exists() expects parameter 2 to be array, null given in %s on line %d -NULL - -Warning: array_key_exists() expects parameter 2 to be array, bool given in %s on line %d -NULL - -Warning: array_key_exists() expects parameter 2 to be array, bool given in %s on line %d -NULL - -Warning: array_key_exists() expects parameter 2 to be array, float given in %s on line %d -NULL - -Warning: array_key_exists() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: array_key_exists(): The first argument should be either a string or an integer in %s on line %d bool(false) diff --git a/ext/standard/tests/array/array_keys_error.phpt b/ext/standard/tests/array/array_keys_error.phpt index 46a989b839c67..0febae29c7f54 100644 --- a/ext/standard/tests/array/array_keys_error.phpt +++ b/ext/standard/tests/array/array_keys_error.phpt @@ -3,32 +3,19 @@ Test array_keys() function (error conditions) --FILE-- expected +echo "\n*** Testing error conditions ***\n"; +try { + var_dump(array_keys(new stdclass)); // object +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(array_keys(array(1,2,3, new stdClass => array()))); // (W)illegal offset echo "Done\n"; ?> --EXPECTF-- *** Testing error conditions *** -Warning: array_keys() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: array_keys() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: array_keys() expects parameter 1 to be array, object given in %s on line %d -NULL - -Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d -NULL +array_keys() expects parameter 1 to be array, object given Warning: Illegal offset type in %s on line %d array(3) { diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt index 56dd033521e06..d15f28425eeb5 100644 --- a/ext/standard/tests/array/array_map_error.phpt +++ b/ext/standard/tests/array/array_map_error.phpt @@ -9,10 +9,6 @@ Test array_map() function : error conditions echo "*** Testing array_map() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing array_map() function with Zero arguments --\n"; -var_dump( array_map() ); - // Testing array_map with one less than the expected number of arguments echo "\n-- Testing array_map() function with one less than expected no. of arguments --\n"; function callback1() { @@ -45,15 +41,8 @@ echo "Done"; --EXPECTF-- *** Testing array_map() : error conditions *** --- Testing array_map() function with Zero arguments -- - -Warning: array_map() expects at least 2 parameters, 0 given in %s on line %d%d -NULL - -- Testing array_map() function with one less than expected no. of arguments -- - -Warning: array_map() expects at least 2 parameters, 1 given in %s on line %d%d -NULL +Exception: array_map() expects at least 2 parameters, 1 given -- Testing array_map() function with less no. of arrays than callback function arguments -- Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected diff --git a/ext/standard/tests/array/array_map_object1.phpt b/ext/standard/tests/array/array_map_object1.phpt index 944fc8c2c86bb..43cc4484e698f 100644 --- a/ext/standard/tests/array/array_map_object1.phpt +++ b/ext/standard/tests/array/array_map_object1.phpt @@ -28,7 +28,11 @@ class SimpleClass } function test($cb, $args) { echo join('::', $cb) . "\n"; - var_dump(array_map($cb, $args)); + try { + var_dump(array_map($cb, $args)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } test(array('SimpleClass', 'square'), array(1, 2)); @@ -135,21 +139,15 @@ array(2) { -- simple class with private variable and method -- SimpleClassPri::add - -Warning: array_map() expects parameter 1 to be a valid callback, cannot access private method SimpleClassPri::add() in %sarray_map_object1.php on line %d -NULL +array_map() expects parameter 1 to be a valid callback, cannot access private method SimpleClassPri::add() -- simple class with protected variable and method -- SimpleClassPro::mul - -Warning: array_map() expects parameter 1 to be a valid callback, cannot access protected method SimpleClassPro::mul() in %sarray_map_object1.php on line %d -NULL +array_map() expects parameter 1 to be a valid callback, cannot access protected method SimpleClassPro::mul() -- class without members -- EmptyClass - -Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in %sarray_map_object1.php on line %d -NULL +array_map() expects parameter 1 to be a valid callback, array must have exactly two members -- abstract class -- ChildClass::emptyFunction @@ -182,13 +180,9 @@ array(2) { int(4) } StaticClass::cube - -Warning: array_map() expects parameter 1 to be a valid callback, cannot access private method StaticClass::cube() in %sarray_map_object1.php on line %d -NULL +array_map() expects parameter 1 to be a valid callback, cannot access private method StaticClass::cube() StaticClass::retVal - -Warning: array_map() expects parameter 1 to be a valid callback, cannot access protected method StaticClass::retVal() in %sarray_map_object1.php on line %d -NULL +array_map() expects parameter 1 to be a valid callback, cannot access protected method StaticClass::retVal() -- class implementing an interface -- InterClass::square array(2) { diff --git a/ext/standard/tests/array/array_map_object2.phpt b/ext/standard/tests/array/array_map_object2.phpt index 7cfb528bf2808..e5218ccbe4a20 100644 --- a/ext/standard/tests/array/array_map_object2.phpt +++ b/ext/standard/tests/array/array_map_object2.phpt @@ -26,21 +26,25 @@ class SimpleClass } echo "-- with non-existent class --\n"; -var_dump( array_map(array('non-existent', 'square'), array(1, 2)) ); +try { + var_dump( array_map(array('non-existent', 'square'), array(1, 2)) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "-- with existent class and non-existent method --\n"; -var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) ); +try { + var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> --EXPECTF-- *** Testing array_map() : with non-existent class and method *** -- with non-existent class -- - -Warning: array_map() expects parameter 1 to be a valid callback, class 'non-existent' not found in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, class 'non-existent' not found -- with existent class and non-existent method -- - -Warning: array_map() expects parameter 1 to be a valid callback, class 'SimpleClass' does not have a method 'non-existent' in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, class 'SimpleClass' does not have a method 'non-existent' Done diff --git a/ext/standard/tests/array/array_map_object3.phpt b/ext/standard/tests/array/array_map_object3.phpt index 114d1d3134976..2f1536df5c2b2 100644 --- a/ext/standard/tests/array/array_map_object3.phpt +++ b/ext/standard/tests/array/array_map_object3.phpt @@ -51,13 +51,21 @@ echo "-- accessing parent method from child class --\n"; var_dump( array_map(array('ChildClass', 'staticParent1'), $arr1) ); echo "-- accessing child method from parent class --\n"; -var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) ); +try { + var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "-- accessing parent method using child class object --\n"; var_dump( array_map(array($childobj, 'staticParent1'), $arr1) ); echo "-- accessing child method using parent class object --\n"; -var_dump( array_map(array($parentobj, 'staticChild'), $arr1) ); +try { + var_dump( array_map(array($parentobj, 'staticChild'), $arr1) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> @@ -73,9 +81,7 @@ array(3) { int(7) } -- accessing child method from parent class -- - -Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticChild' in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticChild' -- accessing parent method using child class object -- array(3) { [0]=> @@ -86,7 +92,5 @@ array(3) { int(7) } -- accessing child method using parent class object -- - -Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticChild' in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticChild' Done diff --git a/ext/standard/tests/array/array_map_variation12.phpt b/ext/standard/tests/array/array_map_variation12.phpt index b258c2d31b98d..67abde0108a27 100644 --- a/ext/standard/tests/array/array_map_variation12.phpt +++ b/ext/standard/tests/array/array_map_variation12.phpt @@ -20,10 +20,18 @@ echo "-- with built-in function 'pow' and two parameters --\n"; var_dump( array_map('pow', $array1, $array2)); echo "-- with built-in function 'pow' and one parameter --\n"; -var_dump( array_map('pow', $array1)); +try { + var_dump( array_map('pow', $array1)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "-- with language construct --\n"; -var_dump( array_map('echo', $array1)); +try { + var_dump( array_map('echo', $array1)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> @@ -39,22 +47,7 @@ array(3) { int(243) } -- with built-in function 'pow' and one parameter -- - -Warning: pow() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: pow() expects exactly 2 parameters, 1 given in %s on line %d - -Warning: pow() expects exactly 2 parameters, 1 given in %s on line %d -array(3) { - [0]=> - NULL - [1]=> - NULL - [2]=> - NULL -} +pow() expects exactly 2 parameters, 1 given -- with language construct -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'echo' not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation14.phpt b/ext/standard/tests/array/array_map_variation14.phpt index 771d3f949ef0b..2764cb7374051 100644 --- a/ext/standard/tests/array/array_map_variation14.phpt +++ b/ext/standard/tests/array/array_map_variation14.phpt @@ -36,10 +36,18 @@ echo "-- with undefined variable --\n"; var_dump( array_map(@$undefined_var, $arr1) ); echo "-- with empty string --\n"; -var_dump( array_map("", $arr1, $arr2) ); +try { + var_dump( array_map("", $arr1, $arr2) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "-- with empty array --\n"; -var_dump( array_map(array(), $arr1, $arr2) ); +try { + var_dump( array_map(array(), $arr1, $arr2) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> @@ -115,11 +123,7 @@ array(2) { int(2) } -- with empty string -- - -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name -- with empty array -- - -Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, array must have exactly two members Done diff --git a/ext/standard/tests/array/array_map_variation15.phpt b/ext/standard/tests/array/array_map_variation15.phpt index b29af47713ffb..f36d55bd5f4ec 100644 --- a/ext/standard/tests/array/array_map_variation15.phpt +++ b/ext/standard/tests/array/array_map_variation15.phpt @@ -18,13 +18,15 @@ $arr1 = array(1, 2); $arr2 = array("one", "two"); $arr3 = array(1.1, 2.2); -var_dump( array_map('non_existent', $arr1, $arr2, $arr3) ); +try { + var_dump( array_map('non_existent', $arr1, $arr2, $arr3) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing array_map() : non existent 'callback' function *** - -Warning: array_map() expects parameter 1 to be a valid callback, function 'non_existent' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'non_existent' not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation16.phpt b/ext/standard/tests/array/array_map_variation16.phpt index c4987cb385405..0c80337c769b9 100644 --- a/ext/standard/tests/array/array_map_variation16.phpt +++ b/ext/standard/tests/array/array_map_variation16.phpt @@ -30,8 +30,12 @@ $callback_names = array( ); for($count = 0; $count < count($callback_names); $count++) { - echo "-- Iteration ".($count + 1)." --\n"; - var_dump( array_map($callback_names[$count], $arr1) ); + echo "-- Iteration ".($count + 1)." --\n"; + try { + var_dump( array_map($callback_names[$count], $arr1) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } echo "Done"; @@ -39,35 +43,19 @@ echo "Done"; --EXPECTF-- *** Testing array_map() : non-permmited built-in functions *** -- Iteration 1 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'echo' not found or invalid function name -- Iteration 2 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'array' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'array' not found or invalid function name -- Iteration 3 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'empty' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'empty' not found or invalid function name -- Iteration 4 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'eval' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'eval' not found or invalid function name -- Iteration 5 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'exit' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'exit' not found or invalid function name -- Iteration 6 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'isset' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'isset' not found or invalid function name -- Iteration 7 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'list' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'list' not found or invalid function name -- Iteration 8 -- - -Warning: array_map() expects parameter 1 to be a valid callback, function 'print' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function 'print' not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation17.phpt b/ext/standard/tests/array/array_map_variation17.phpt index 1cfbdd7beb553..4558dc999f074 100644 --- a/ext/standard/tests/array/array_map_variation17.phpt +++ b/ext/standard/tests/array/array_map_variation17.phpt @@ -66,93 +66,77 @@ $unexpected_callbacks = array( // loop through each element of $inputs to check the behavior of array_map for($count = 0; $count < count($unexpected_callbacks); $count++) { - echo "\n-- Iteration ".($count + 1)." --"; - var_dump( array_map($unexpected_callbacks[$count], $arr1)); + echo "\n-- Iteration ".($count + 1)." --\n"; + try { + var_dump( array_map($unexpected_callbacks[$count], $arr1)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } }; fclose($fp); echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing array_map() : unexpected values for 'callback' argument *** -- Iteration 1 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 2 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 3 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 4 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 5 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 6 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 7 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 8 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 9 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 10 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 11 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 12 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 13 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 14 -- -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name -- Iteration 15 -- -Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name -- Iteration 16 -- -Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, array must have exactly two members -- Iteration 17 -- -Warning: array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object -- Iteration 18 -- -Warning: array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object -- Iteration 19 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given -- Iteration 20 -- -Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, no array or string given Done diff --git a/ext/standard/tests/array/array_merge.phpt b/ext/standard/tests/array/array_merge.phpt index e6a8096282c18..98cb3a318fbaa 100644 --- a/ext/standard/tests/array/array_merge.phpt +++ b/ext/standard/tests/array/array_merge.phpt @@ -78,12 +78,13 @@ var_dump(array_merge($begin_array[6])); echo "\n*** Testing array_merge() with typecasting non-array to array ***\n"; var_dump(array_merge($begin_array[4], (array)"type1", (array)10, (array)12.34)); -echo "\n*** Testing error conditions ***"; +echo "\n*** Testing error conditions ***\n"; /* Invalid arguments */ -var_dump(array_merge()); -var_dump(array_merge(100, 200)); -var_dump(array_merge($begin_array[0], $begin_array[1], 100)); -var_dump(array_merge($begin_array[0], $begin_array[1], $arr4)); +try { + var_dump(array_merge()); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -746,17 +747,5 @@ array(7) { } *** Testing error conditions *** -Warning: array_merge() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: array_merge(): Expected parameter 1 to be an array, int given in %s on line %d -NULL - -Warning: array_merge(): Expected parameter 3 to be an array, int given in %s on line %d -NULL - -Notice: Undefined variable: arr4 in %s on line %d - -Warning: array_merge(): Expected parameter 3 to be an array, null given in %s on line %d -NULL +array_merge() expects at least 1 parameter, 0 given Done diff --git a/ext/standard/tests/array/array_merge_recursive_error.phpt b/ext/standard/tests/array/array_merge_recursive_error.phpt index ffa9cc998e6f0..f741220837949 100644 --- a/ext/standard/tests/array/array_merge_recursive_error.phpt +++ b/ext/standard/tests/array/array_merge_recursive_error.phpt @@ -11,7 +11,11 @@ echo "*** Testing array_merge_recursive() : error conditions ***\n"; // Zero arguments echo "\n-- Testing array_merge_recursive() function with Zero arguments --\n"; -var_dump( array_merge_recursive() ); +try { + var_dump( array_merge_recursive() ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> @@ -19,7 +23,5 @@ echo "Done"; *** Testing array_merge_recursive() : error conditions *** -- Testing array_merge_recursive() function with Zero arguments -- - -Warning: array_merge_recursive() expects at least 1 parameter, 0 given in %s on line %d -NULL +array_merge_recursive() expects at least 1 parameter, 0 given Done diff --git a/ext/standard/tests/array/array_multisort_error.phpt b/ext/standard/tests/array/array_multisort_error.phpt index 3e78b78ac080f..105662be07096 100644 --- a/ext/standard/tests/array/array_multisort_error.phpt +++ b/ext/standard/tests/array/array_multisort_error.phpt @@ -10,10 +10,6 @@ Test array_multisort() function : error conditions echo "*** Testing array_multisort() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing array_multisort() function with Zero arguments --\n"; -var_dump( array_multisort() ); - echo "\n-- Testing array_multisort() function with repeated flags --\n"; $ar1 = array(1); var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) ); @@ -27,11 +23,6 @@ var_dump( array_multisort($ar1, SORT_STRING, SORT_NUMERIC) ); --EXPECTF-- *** Testing array_multisort() : error conditions *** --- Testing array_multisort() function with Zero arguments -- - -Warning: array_multisort() expects at least 1 parameter, 0 given in %sarray_multisort_error.php on line %d -NULL - -- Testing array_multisort() function with repeated flags -- Warning: array_multisort(): Argument #3 is expected to be an array or sorting flag that has not already been specified in %sarray_multisort_error.php on line %d diff --git a/ext/standard/tests/array/array_pad.phpt b/ext/standard/tests/array/array_pad.phpt index c2675167306a9..fd5fa520b62c8 100644 --- a/ext/standard/tests/array/array_pad.phpt +++ b/ext/standard/tests/array/array_pad.phpt @@ -3,9 +3,6 @@ array_pad() tests --FILE-- --EXPECTF-- -Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d -NULL - -Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d -NULL - -Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d -NULL array(1) { [0]=> int(0) @@ -95,7 +83,4 @@ array(4) { Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d bool(false) - -Warning: array_pad() expects parameter 1 to be array, string given in %s on line %d -NULL Done diff --git a/ext/standard/tests/array/array_push.phpt b/ext/standard/tests/array/array_push.phpt index 52e754f94ddf0..227a520ac1e54 100644 --- a/ext/standard/tests/array/array_push.phpt +++ b/ext/standard/tests/array/array_push.phpt @@ -31,16 +31,7 @@ $mixed_array = array( ); /* Error Conditions */ -echo "\n*** Testing Error Conditions ***\n"; - -/* Zero argument */ -var_dump( array_push() ); - -/* Scalar argument */ -var_dump( array_push($number, 22) ); - -/* String argument */ -var_dump( array_push($str, 22) ); +echo "\n*** Testing Edge Conditions ***\n"; /* Invalid Number of arguments */ var_dump( array_push($mixed_array[1],1,2) ); @@ -70,16 +61,7 @@ var_dump( $mixed_array[2] ); echo"\nDone"; ?> --EXPECTF-- -*** Testing Error Conditions *** - -Warning: array_push() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: array_push() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: array_push() expects parameter 1 to be array, string given in %s on line %d -NULL +*** Testing Edge Conditions *** int(11) int(1) diff --git a/ext/standard/tests/array/array_rand.phpt b/ext/standard/tests/array/array_rand.phpt index db432dc9b4636..72999eda5fdd6 100644 --- a/ext/standard/tests/array/array_rand.phpt +++ b/ext/standard/tests/array/array_rand.phpt @@ -3,10 +3,8 @@ array_rand() tests --FILE-- --EXPECTF-- -Warning: array_rand() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: array_rand(): Array is empty in %s on line %d NULL Warning: array_rand(): Array is empty in %s on line %d NULL -Warning: array_rand() expects parameter 1 to be array, int given in %s on line %d -NULL - Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d NULL diff --git a/ext/standard/tests/array/array_search1.phpt b/ext/standard/tests/array/array_search1.phpt index 49563f9712559..10c1672e54939 100644 --- a/ext/standard/tests/array/array_search1.phpt +++ b/ext/standard/tests/array/array_search1.phpt @@ -5,8 +5,6 @@ array_search() tests $a = array(1=>0, 2=>1, 4=>3, "a"=>"b", "c"=>"d"); -var_dump(array_search(1)); -var_dump(array_search(1,1)); var_dump(array_search("a",$a)); var_dump(array_search("0",$a, true)); var_dump(array_search("0",$a)); @@ -18,12 +16,7 @@ var_dump(array_search(-1,$a, true)); echo "Done\n"; ?> ---EXPECTF-- -Warning: array_search() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: array_search() expects parameter 2 to be array, int given in %s on line %d -NULL +--EXPECT-- int(1) bool(false) int(1) diff --git a/ext/standard/tests/array/array_search_variation3.phpt b/ext/standard/tests/array/array_search_variation3.phpt index 41b0b5bb206e7..596c36f805aac 100644 --- a/ext/standard/tests/array/array_search_variation3.phpt +++ b/ext/standard/tests/array/array_search_variation3.phpt @@ -33,9 +33,17 @@ class array_search_check { $array_search_obj = new array_search_check(); //creating new object //error: as wrong datatype for second argument -var_dump( array_search("array_var", $array_search_obj) ); +try { + var_dump( array_search("array_var", $array_search_obj) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} //error: as wrong datatype for second argument -var_dump( array_search("foo", $array_search_obj) ); +try { + var_dump( array_search("foo", $array_search_obj) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} //element found as "one" exists in array $array_var var_dump( array_search("one", $array_search_obj->array_var) ); @@ -48,11 +56,7 @@ string(5) "three" int(5) *** Testing objects with array_search() *** - -Warning: array_search() expects parameter 2 to be array, object given in %s on line %d -NULL - -Warning: array_search() expects parameter 2 to be array, object given in %s on line %d -NULL +array_search() expects parameter 2 to be array, object given +array_search() expects parameter 2 to be array, object given int(1) Done diff --git a/ext/standard/tests/array/array_slice.phpt b/ext/standard/tests/array/array_slice.phpt index 59d804350b5d9..d19f5195d6f12 100644 --- a/ext/standard/tests/array/array_slice.phpt +++ b/ext/standard/tests/array/array_slice.phpt @@ -20,26 +20,6 @@ $var_array = array( $num = 4; $str = "john"; -/* Zero args */ -echo"\n*** Output for Zero Argument ***\n"; -array_slice(); - -/* Single args */ -echo"\n*** Output for Single array Argument ***\n"; -array_slice($var_array); - -/* More than valid no. of args (ie. >4 ) */ -echo"\n*** Output for invalid number of Arguments ***\n"; -array_slice($var_array, 2, 4, true, 3); - -/* Scalar arg */ -echo"\n*** Output for scalar Argument ***\n"; -array_slice($num, 2); - -/* String arg */ -echo"\n*** Output for string Argument ***\n"; -array_slice($str, 2); - $counter = 1; foreach ($var_array as $sub_array) { @@ -89,26 +69,6 @@ foreach ($var_array as $sub_array) ?> --EXPECTF-- -*** Output for Zero Argument *** - -Warning: array_slice() expects at least 2 parameters, 0 given in %s on line %d - -*** Output for Single array Argument *** - -Warning: array_slice() expects at least 2 parameters, 1 given in %s on line %d - -*** Output for invalid number of Arguments *** - -Warning: array_slice() expects at most 4 parameters, 5 given in %s on line %d - -*** Output for scalar Argument *** - -Warning: array_slice() expects parameter 1 to be array, int given in %s on line %d - -*** Output for string Argument *** - -Warning: array_slice() expects parameter 1 to be array, string given in %s on line %d - *** Iteration 1 *** *** Variation with first two Arguments *** diff --git a/ext/standard/tests/array/array_slice_variation1.phpt b/ext/standard/tests/array/array_slice_variation1.phpt index f0c30ba53d390..46f33b9503448 100644 --- a/ext/standard/tests/array/array_slice_variation1.phpt +++ b/ext/standard/tests/array/array_slice_variation1.phpt @@ -15,8 +15,16 @@ var_dump(array_slice(range(1, 3), -1, NULL, 1)); $a = 'foo'; -var_dump(array_slice(range(1, 3), 0, $a)); -var_dump(array_slice(range(1, 3), 0, $a)); +try { + var_dump(array_slice(range(1, 3), 0, $a)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump(array_slice(range(1, 3), 0, $a)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump($a); ?> @@ -53,10 +61,6 @@ array(1) { [2]=> int(3) } - -Warning: array_slice() expects parameter 3 to be int, string given in %s on line %d -NULL - -Warning: array_slice() expects parameter 3 to be int, string given in %s on line %d -NULL +array_slice() expects parameter 3 to be int, string given +array_slice() expects parameter 3 to be int, string given string(3) "foo" diff --git a/ext/standard/tests/array/array_unshift.phpt b/ext/standard/tests/array/array_unshift.phpt index 9b474277a95e4..9ebe83391e142 100644 --- a/ext/standard/tests/array/array_unshift.phpt +++ b/ext/standard/tests/array/array_unshift.phpt @@ -7,8 +7,6 @@ $a = array(); $s = ""; var_dump(array_unshift($a, $s)); var_dump($a); -var_dump(array_unshift($s, $a)); -var_dump($a); var_dump(array_unshift($a, $a)); var_dump($a); @@ -20,13 +18,6 @@ array(1) { [0]=> string(0) "" } - -Warning: array_unshift() expects parameter 1 to be array, string given in %s on line %d -NULL -array(1) { - [0]=> - string(0) "" -} int(2) array(2) { [0]=> diff --git a/ext/standard/tests/array/array_walk.phpt b/ext/standard/tests/array/array_walk.phpt index 7cd8a8cf7a170..cf792bfa19a56 100644 --- a/ext/standard/tests/array/array_walk.phpt +++ b/ext/standard/tests/array/array_walk.phpt @@ -3,12 +3,6 @@ array_walk() tests --FILE-- --EXPECTF-- -Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: array_walk() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: array_walk() expects parameter 2 to be a valid callback, function '' not found or invalid function name in %s on line %d -NULL int(1) int(0) string(4) "data" diff --git a/ext/standard/tests/array/array_walk_closure.phpt b/ext/standard/tests/array/array_walk_closure.phpt index 0a5d8545828ea..7ac62d7484a74 100644 --- a/ext/standard/tests/array/array_walk_closure.phpt +++ b/ext/standard/tests/array/array_walk_closure.phpt @@ -3,14 +3,6 @@ array_walk() closure tests --FILE-- 1, "two"=>2, "three" => 3]; var_dump(array_walk($ar, function(){ var_dump(func_get_args());})); @@ -94,14 +86,6 @@ try { echo "Done\n"; ?> --EXPECTF-- -Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: array_walk() expects parameter 1 to be array, bool given in %s on line %d -NULL - -Warning: array_walk() expects parameter 1 to be array, null given in %s on line %d -NULL array(2) { [0]=> int(1) diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt index a4026180fbf7b..73445892a6dd2 100644 --- a/ext/standard/tests/array/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk_error2.phpt @@ -61,7 +61,5 @@ Exception: Too few arguments to function callback2(), 3 passed and exactly 4 exp Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk() function with too many callback parameters -- - -Warning: array_walk() expects at most 3 parameters, 4 given in %s on line %d -NULL +Exception: array_walk() expects at most 3 parameters, 4 given Done diff --git a/ext/standard/tests/array/array_walk_objects.phpt b/ext/standard/tests/array/array_walk_objects.phpt index fc04304fc5e1c..9f3ac8c1cd668 100644 --- a/ext/standard/tests/array/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk_objects.phpt @@ -24,7 +24,11 @@ array_walk($t, "walk"); $var = array(); array_walk($var, "walk"); $var = ""; -array_walk($var, "walk"); +try { + array_walk($var, "walk"); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -39,6 +43,5 @@ string(10) "%r\0%r*%r\0%rvar_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" - -Warning: array_walk() expects parameter 1 to be array, string given in %s on line %d +array_walk() expects parameter 1 to be 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 a83c227a3bf9c..097143e8ecd5a 100644 --- a/ext/standard/tests/array/array_walk_rec_objects.phpt +++ b/ext/standard/tests/array/array_walk_rec_objects.phpt @@ -24,7 +24,11 @@ array_walk_recursive($t, "walk"); $var = array(); array_walk_recursive($var, "walk"); $var = ""; -array_walk_recursive($var, "walk"); +try { + array_walk_recursive($var, "walk"); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> @@ -39,6 +43,5 @@ string(10) "%r\0%r*%r\0%rvar_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" - -Warning: array_walk_recursive() expects parameter 1 to be array, string given in %s on line %d +array_walk_recursive() expects parameter 1 to be array, string given Done diff --git a/ext/standard/tests/array/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk_recursive1.phpt index 962f133e4c3d2..f952b4410b8a0 100644 --- a/ext/standard/tests/array/array_walk_recursive1.phpt +++ b/ext/standard/tests/array/array_walk_recursive1.phpt @@ -3,12 +3,6 @@ array_walk_recursive() tests --FILE-- --EXPECTF-- -Warning: array_walk_recursive() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: array_walk_recursive() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: array_walk_recursive() expects parameter 2 to be a valid callback, function '' not found or invalid function name in %s on line %d -NULL int(1) int(0) string(4) "data" diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt index b162a1c9dcde2..e9bd7ea1758d0 100644 --- a/ext/standard/tests/array/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt @@ -61,7 +61,5 @@ Exception: Too few arguments to function callback2(), 3 passed and exactly 4 exp Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk_recursive() function with too many callback parameters -- - -Warning: array_walk_recursive() expects at most 3 parameters, 4 given in %s on line %d -NULL +Exception: array_walk_recursive() expects at most 3 parameters, 4 given Done diff --git a/ext/standard/tests/array/array_walk_recursive_variation7.phpt b/ext/standard/tests/array/array_walk_recursive_variation7.phpt index 06dc1aaa090a3..a0c159d71d151 100644 --- a/ext/standard/tests/array/array_walk_recursive_variation7.phpt +++ b/ext/standard/tests/array/array_walk_recursive_variation7.phpt @@ -29,9 +29,6 @@ var_dump( array_walk_recursive($input, function($value, $key) { var_dump($key); echo "-- Anonymous function with three arguments --\n"; var_dump( array_walk_recursive($input, function($value, $key, $user_data) { var_dump($key); var_dump($value); var_dump($user_data); echo "\n"; }, 10)); -echo "-- Anonymous function with one more argument --\n"; -var_dump( array_walk_recursive($input, function($value, $key, $user_data) { var_dump($key); var_dump($value); var_dump($user_data); echo "\n"; }, 20, 30)); - echo "-- Anonymous function with null argument --\n"; var_dump( array_walk_recursive( $input, function() { echo "1\n"; })); echo "Done" @@ -80,10 +77,6 @@ int(0) int(10) bool(true) --- Anonymous function with one more argument -- - -Warning: array_walk_recursive() expects at most 3 parameters, 4 given in %s on line %d -NULL -- Anonymous function with null argument -- 1 1 diff --git a/ext/standard/tests/array/array_walk_recursive_variation8.phpt b/ext/standard/tests/array/array_walk_recursive_variation8.phpt index 2db8067fe0962..51eba1e0e0e10 100644 --- a/ext/standard/tests/array/array_walk_recursive_variation8.phpt +++ b/ext/standard/tests/array/array_walk_recursive_variation8.phpt @@ -25,7 +25,11 @@ echo "-- With 'min' built-in function --\n"; var_dump( array_walk_recursive($input, "min")); echo "-- With 'echo' language construct --\n"; -var_dump( array_walk_recursive($input, "echo")); +try { + var_dump( array_walk_recursive($input, "echo")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done" ?> @@ -36,7 +40,5 @@ bool(true) -- With 'min' built-in function -- bool(true) -- With 'echo' language construct -- - -Warning: array_walk_recursive() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL +array_walk_recursive() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk_variation7.phpt b/ext/standard/tests/array/array_walk_variation7.phpt index 671ad44309c5f..0354782eda104 100644 --- a/ext/standard/tests/array/array_walk_variation7.phpt +++ b/ext/standard/tests/array/array_walk_variation7.phpt @@ -29,9 +29,6 @@ var_dump( array_walk($input, function($value, $key) { var_dump($key); var_dump($ echo "-- Anonymous function with three arguments --\n"; var_dump( array_walk($input, function($value, $key, $user_data) { var_dump($key); var_dump($value); var_dump($user_data); echo "\n"; }, 10)); -echo "-- Anonymous function with one more argument --\n"; -var_dump( array_walk($input, function($value, $key, $user_data) { var_dump($key); var_dump($value); var_dump($user_data); echo "\n"; }, 20, 30)); - echo "-- Anonymous function with null argument --\n"; var_dump( array_walk( $input, function() { echo "1\n"; })); echo "Done" @@ -80,10 +77,6 @@ int(0) int(10) bool(true) --- Anonymous function with one more argument -- - -Warning: array_walk() expects at most 3 parameters, 4 given in %s on line %d -NULL -- Anonymous function with null argument -- 1 1 diff --git a/ext/standard/tests/array/array_walk_variation8.phpt b/ext/standard/tests/array/array_walk_variation8.phpt index 829baf1add2d7..baa5f3914bbcd 100644 --- a/ext/standard/tests/array/array_walk_variation8.phpt +++ b/ext/standard/tests/array/array_walk_variation8.phpt @@ -25,7 +25,11 @@ echo "-- With 'min' built-in function --\n"; var_dump( array_walk($input, "min")); echo "-- With 'echo' language construct --\n"; -var_dump( array_walk($input, "echo")); +try { + var_dump( array_walk($input, "echo")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done" ?> @@ -36,7 +40,5 @@ bool(true) -- With 'min' built-in function -- bool(true) -- With 'echo' language construct -- - -Warning: array_walk() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL +array_walk() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name Done diff --git a/ext/standard/tests/array/bug35014.phpt b/ext/standard/tests/array/bug35014.phpt index f858bf107b7c7..b674590fd6692 100644 --- a/ext/standard/tests/array/bug35014.phpt +++ b/ext/standard/tests/array/bug35014.phpt @@ -7,7 +7,6 @@ precision=14 --FILE-- ---EXPECTF-- -Warning: array_product() expects parameter 1 to be array, string given in %s on line %d -NULL +--EXPECT-- int(1) int(0) int(3) diff --git a/ext/standard/tests/array/bug35014_64bit.phpt b/ext/standard/tests/array/bug35014_64bit.phpt index 5caf48c6ee4ce..3b3d29b5be18e 100644 --- a/ext/standard/tests/array/bug35014_64bit.phpt +++ b/ext/standard/tests/array/bug35014_64bit.phpt @@ -7,7 +7,6 @@ precision=14 --FILE-- ---EXPECTF-- -Warning: array_product() expects parameter 1 to be array, string given in %s on line %d -NULL +--EXPECT-- int(1) int(0) int(3) diff --git a/ext/standard/tests/array/bug40191.phpt b/ext/standard/tests/array/bug40191.phpt index f5e439821db06..b94e709364060 100644 --- a/ext/standard/tests/array/bug40191.phpt +++ b/ext/standard/tests/array/bug40191.phpt @@ -8,12 +8,14 @@ $arrObj->append('foo'); $arrObj->append('bar'); $arrObj->append('foo'); -$arr = array_unique($arrObj); -var_dump($arr); +try { + $arr = array_unique($arrObj); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> ---EXPECTF-- -Warning: array_unique() expects parameter 1 to be array, object given in %s on line %d -NULL +--EXPECT-- +array_unique() expects parameter 1 to be array, object given Done diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index 6d81c16621de5..1fd2e8e6cafce 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -111,16 +111,6 @@ for( $i =0; $i < count( $mode_arr ); $i++) { var_dump(count($arr, $mode_arr[$i])); } - -echo "\n-- Testing error conditions --"; -var_dump( count() ); // No. of args = 0 -var_dump( count(array(), COUNT_NORMAL, 100) ); // No. of args > expected - -/* Testing Invalid type arguments */ -var_dump( count("string", "ABCD") ); -var_dump( count(100, "string") ); -var_dump( count(array(), "") ); - echo "\nDone"; /* closing the resource handles */ @@ -230,20 +220,4 @@ For mode '1' count is => int(9) For mode '' count is => int(3) For mode '' count is => int(3) --- Testing error conditions -- -Warning: count() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: count() expects at most 2 parameters, 3 given in %s on line %d -NULL - -Warning: count() expects parameter 2 to be int, %s given in %s on line %d -NULL - -Warning: count() expects parameter 2 to be int, %s given in %s on line %d -NULL - -Warning: count() expects parameter 2 to be int, %s given in %s on line %d -NULL - Done diff --git a/ext/standard/tests/array/end.phpt b/ext/standard/tests/array/end.phpt index dc3f2eb75e8f1..496b6c9566c9a 100644 --- a/ext/standard/tests/array/end.phpt +++ b/ext/standard/tests/array/end.phpt @@ -106,21 +106,6 @@ $resources = array($file_handle, $dir_handle); var_dump( end($resources) ); var_dump( current($resources) ); -echo "\n*** Testing error conditions ***\n"; -/* checking for unexpected number of arguments */ -var_dump( end() ); -var_dump( end($array[0], $array[0]) ); - -/* checking for unexpected type of arguments */ -$var=1; -$var1="string"; -var_dump( end($var) ); -var_dump( end($var1) ); - -/* checking null array */ -$null_array = array(); -var_dump( end($null_array) ); - echo "Done\n"; @@ -219,19 +204,4 @@ array(2) { *** Testing end() on resource type *** resource(%d) of type (stream) resource(%d) of type (stream) - -*** Testing error conditions *** - -Warning: end() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: end() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: end() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: end() expects parameter 1 to be array, string given in %s on line %d -NULL -bool(false) Done diff --git a/ext/standard/tests/array/end_64bit.phpt b/ext/standard/tests/array/end_64bit.phpt index 0af5064e8215b..55f0d2e53b3e7 100644 --- a/ext/standard/tests/array/end_64bit.phpt +++ b/ext/standard/tests/array/end_64bit.phpt @@ -106,21 +106,6 @@ $resources = array($file_handle, $dir_handle); var_dump( end($resources) ); var_dump( current($resources) ); -echo "\n*** Testing error conditions ***\n"; -/* checking for unexpected number of arguments */ -var_dump( end() ); -var_dump( end($array[0], $array[0]) ); - -/* checking for unexpected type of arguments */ -$var=1; -$var1="string"; -var_dump( end($var) ); -var_dump( end($var1) ); - -/* checking null array */ -$null_array = array(); -var_dump( end($null_array) ); - echo "Done\n"; ?> @@ -218,19 +203,4 @@ array(2) { *** Testing end() on resource type *** resource(%d) of type (stream) resource(%d) of type (stream) - -*** Testing error conditions *** - -Warning: end() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: end() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: end() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: end() expects parameter 1 to be array, string given in %s on line %d -NULL -bool(false) Done diff --git a/ext/standard/tests/array/extract_error.phpt b/ext/standard/tests/array/extract_error.phpt index e8bcf8f5d8d87..08e1824b0fb30 100644 --- a/ext/standard/tests/array/extract_error.phpt +++ b/ext/standard/tests/array/extract_error.phpt @@ -6,25 +6,11 @@ Test extract() function (error conditions) /* Testing Error Conditions */ echo "*** Testing Error Conditions ***\n"; -/* Zero Arguments */ -var_dump( extract() ); - /* Invalid second argument ( only 0-6 is valid) */ $arr = array(1); var_dump( extract($arr, -1 . "wddr") ); var_dump( extract($arr, 7 , "wddr") ); -/* scalar argument */ -$val = 1; -var_dump( extract($val) ); - -/* string argument */ -$str = "test"; -var_dump( extract($str) ); - -/* More than valid number of arguments i.e. 3 args */ -var_dump( extract($arr, EXTR_SKIP, "aa", "ee") ); - /* Two Arguments, second as prefix but without prefix string as third argument */ var_dump( extract($arr,EXTR_PREFIX_IF_EXISTS) ); @@ -33,9 +19,6 @@ echo "Done\n"; --EXPECTF-- *** Testing Error Conditions *** -Warning: extract() expects at least 1 parameter, 0 given in %s on line %d -NULL - Notice: A non well formed numeric value encountered in %s on line %d Warning: extract(): Invalid extract type in %s on line %d @@ -44,15 +27,6 @@ NULL Warning: extract(): Invalid extract type in %s on line %d NULL -Warning: extract() expects parameter 1 to be array, int given in %s on line %d -NULL - -Warning: extract() expects parameter 1 to be array, string given in %s on line %d -NULL - -Warning: extract() expects at most 3 parameters, 4 given in %s on line %d -NULL - Warning: extract(): specified extract type requires the prefix parameter in %s on line %d NULL Done diff --git a/ext/standard/tests/array/in_array_variation3.phpt b/ext/standard/tests/array/in_array_variation3.phpt index f07d1dea8999e..0b58990041852 100644 --- a/ext/standard/tests/array/in_array_variation3.phpt +++ b/ext/standard/tests/array/in_array_variation3.phpt @@ -36,9 +36,17 @@ class in_array_check { $in_array_obj = new in_array_check(); //creating new object //error: as wrong datatype for second argument -var_dump( in_array("array_var", $in_array_obj) ); +try { + var_dump( in_array("array_var", $in_array_obj) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} //error: as wrong datatype for second argument -var_dump( in_array("foo", $in_array_obj) ); +try { + var_dump( in_array("foo", $in_array_obj) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} //element found as "one" exists in array $array_var var_dump( in_array("one", $in_array_obj->array_var) ); @@ -51,11 +59,7 @@ bool(true) bool(true) *** Testing objects with in_array() *** - -Warning: in_array() expects parameter 2 to be array, object given in %s on line %d -NULL - -Warning: in_array() expects parameter 2 to be array, object given in %s on line %d -NULL +in_array() expects parameter 2 to be array, object given +in_array() expects parameter 2 to be array, object given bool(true) Done diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt index ae4f304eae8bc..df471ef255945 100644 --- a/ext/standard/tests/array/max.phpt +++ b/ext/standard/tests/array/max.phpt @@ -5,7 +5,6 @@ precision=14 --FILE-- --EXPECTF-- -Warning: max() expects at least 1 parameter, 0 given in %s on line 3 +Warning: max(): When only one parameter is given, it must be an array in %s on line %d NULL -Warning: max(): When only one parameter is given, it must be an array in %s on line 4 -NULL - -Warning: max(): Array must contain at least one element in %s on line 5 +Warning: max(): Array must contain at least one element in %s on line %d bool(false) -Warning: max(): When only one parameter is given, it must be an array in %s on line 6 +Warning: max(): When only one parameter is given, it must be an array in %s on line %d NULL int(2) float(2.11) diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt index cb8c7cfdcae5d..031e9b2c96b00 100644 --- a/ext/standard/tests/array/min.phpt +++ b/ext/standard/tests/array/min.phpt @@ -5,7 +5,6 @@ precision=14 --FILE-- --EXPECTF-- -Warning: min() expects at least 1 parameter, 0 given in %s on line 3 +Warning: min(): When only one parameter is given, it must be an array in %s on line %d NULL -Warning: min(): When only one parameter is given, it must be an array in %s on line 4 -NULL - -Warning: min(): Array must contain at least one element in %s on line 5 +Warning: min(): Array must contain at least one element in %s on line %d bool(false) -Warning: min(): When only one parameter is given, it must be an array in %s on line 6 +Warning: min(): When only one parameter is given, it must be an array in %s on line %d NULL int(1) float(2.09) diff --git a/ext/standard/tests/array/range_errors.phpt b/ext/standard/tests/array/range_errors.phpt index b63e9874bf0bf..3a3b2bdf60605 100644 --- a/ext/standard/tests/array/range_errors.phpt +++ b/ext/standard/tests/array/range_errors.phpt @@ -21,10 +21,7 @@ var_dump( range(1.0, 7.0, 6.5) ); echo "\n\n-- Testing ( (low > high) && (low-high < step) ) --"; var_dump( range(7.0, 1.0, 6.5) ); -echo "\n-- Testing Invalid number of arguments --"; -var_dump( range() ); // No.of args = 0 -var_dump( range(1) ); // No.of args < expected -var_dump( range(1,2,3,4) ); // No.of args > expected +echo "\n-- Testing other conditions --"; var_dump( range(-1, -2, 2) ); var_dump( range("a", "j", "z") ); var_dump( range(0, 1, "140962482048819216326.24") ); @@ -67,16 +64,7 @@ bool(false) Warning: range(): step exceeds the specified range in %s on line %d bool(false) --- Testing Invalid number of arguments -- -Warning: range() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: range() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: range() expects at most 3 parameters, 4 given in %s on line %d -bool(false) - +-- Testing other conditions -- Warning: range(): step exceeds the specified range in %s on line %d bool(false) diff --git a/ext/standard/tests/array/uasort_variation8.phpt b/ext/standard/tests/array/uasort_variation8.phpt index 2bb2b46512579..d27cd569c009b 100644 --- a/ext/standard/tests/array/uasort_variation8.phpt +++ b/ext/standard/tests/array/uasort_variation8.phpt @@ -10,7 +10,6 @@ Test uasort() function : usage variations - built-in function as 'cmp_function' /* * Passing different built-in library functions in place of 'cmp_function' * valid comparison functions: strcmp() & strcasecmp() -* language constructs: echo & exit */ echo "*** Testing uasort() : built in function as 'cmp_function' ***\n"; @@ -28,13 +27,6 @@ echo "-- Testing uasort() with built-in 'cmp_function': strcmp() --\n"; var_dump( uasort($array_arg, 'strcmp') ); // expecting: bool(true) var_dump($array_arg); -// Testing with language construct as comparison function -echo "-- Testing uasort() with language construct as 'cmp_function' --\n"; -var_dump( uasort($languageConstruct_fun_arg, 'echo') ); // expecting: bool(false) - -echo "-- Testing uasort() with language construct as 'cmp_function' --\n"; -var_dump( uasort($languageConstruct_fun_arg, 'exit') ); // expecting: bool(false) - echo "Done" ?> --EXPECTF-- @@ -67,12 +59,4 @@ array(5) { ["o"]=> string(6) "orange" } --- Testing uasort() with language construct as 'cmp_function' -- - -Warning: uasort() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL --- Testing uasort() with language construct as 'cmp_function' -- - -Warning: uasort() expects parameter 2 to be a valid callback, function 'exit' not found or invalid function name in %s on line %d -NULL Done diff --git a/ext/standard/tests/array/usort_variation8.phpt b/ext/standard/tests/array/usort_variation8.phpt index 3296c4a36ab05..98c303e083307 100644 --- a/ext/standard/tests/array/usort_variation8.phpt +++ b/ext/standard/tests/array/usort_variation8.phpt @@ -30,14 +30,6 @@ $temp_array2 = $array_arg; var_dump( usort($temp_array2, 'strcmp') ); var_dump($temp_array2); -// Testing with language construct as comparison function -echo "\n-- Testing usort() with language construct as 'cmp_function' --\n"; -$temp_array3 = $array_arg; -var_dump( usort($temp_array3, 'echo') ); - -echo "\n-- Testing usort() with language construct as 'cmp_function' --\n"; -$temp_array4 = $array_arg; -var_dump( usort($temp_array4, 'exit') ); ?> ===DONE=== --EXPECTF-- @@ -72,14 +64,4 @@ array(5) { [4]=> string(6) "orange" } - --- Testing usort() with language construct as 'cmp_function' -- - -Warning: usort() expects parameter 2 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d -NULL - --- Testing usort() with language construct as 'cmp_function' -- - -Warning: usort() expects parameter 2 to be a valid callback, function 'exit' not found or invalid function name in %s on line %d -NULL ===DONE=== diff --git a/ext/standard/tests/assert/assert04.phpt b/ext/standard/tests/assert/assert04.phpt index f20aaf8e2b370..35f7668ce18d7 100644 --- a/ext/standard/tests/assert/assert04.phpt +++ b/ext/standard/tests/assert/assert04.phpt @@ -11,17 +11,8 @@ assert.bail = 0 assert_options(ASSERT_ACTIVE, 0); assert(1); - /* Wrong parameter count in assert */ assert_options(ASSERT_ACTIVE, 1); -assert(2, "failure", 3); - -/* Wrong parameter count in assert_options */ -assert_options(ASSERT_ACTIVE, 0, 2); - -/* Wrong parameter name in assert_options */ -$test="ASSERT_FRED"; -assert_options($test, 1); /* Assert false */ assert(0); @@ -35,12 +26,6 @@ echo "not reached\n"; ?> --EXPECTF-- -Warning: assert() expects at most 2 parameters, 3 given in %s on line %d - -Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d - -Warning: assert_options() expects parameter 1 to be int, string given in %s on line %d - Warning: assert(): assert(0) failed in %s on line %d Warning: assert(): assert(0) failed in %s on line %d diff --git a/ext/standard/tests/class_object/property_exists_error.phpt b/ext/standard/tests/class_object/property_exists_error.phpt index 217a5c61f9954..7a2f4712da0ac 100644 --- a/ext/standard/tests/class_object/property_exists_error.phpt +++ b/ext/standard/tests/class_object/property_exists_error.phpt @@ -10,19 +10,8 @@ Test property_exists() function : error conditions echo "*** Testing property_exists() : error conditions ***\n"; -$object_or_class = "obj"; -$property_name = 'string_val'; -$extra_arg = 10; - - -echo "\n-- Testing property_exists() function with more than expected no. of arguments --\n"; -var_dump( property_exists($object_or_class, $property_name, $extra_arg) ); - - -echo "\n-- Testing property_exists() function with less than expected no. of arguments --\n"; -var_dump( property_exists($object_or_class) ); - echo "\n-- Testing property_exists() function with incorrect arguments --\n"; +$property_name = 'string_val'; var_dump( property_exists(10, $property_name) ); ?> @@ -30,16 +19,6 @@ var_dump( property_exists(10, $property_name) ); --EXPECTF-- *** Testing property_exists() : error conditions *** --- Testing property_exists() function with more than expected no. of arguments -- - -Warning: property_exists() expects exactly 2 parameters, 3 given in %sproperty_exists_error.php on line %d -NULL - --- Testing property_exists() function with less than expected no. of arguments -- - -Warning: property_exists() expects exactly 2 parameters, 1 given in %sproperty_exists_error.php on line %d -NULL - -- Testing property_exists() function with incorrect arguments -- Warning: First parameter must either be an object or the name of an existing class in %sproperty_exists_error.php on line %d diff --git a/ext/standard/tests/dir/closedir_error-win32-mb.phpt b/ext/standard/tests/dir/closedir_error-win32-mb.phpt deleted file mode 100644 index e5ca80b7d25a4..0000000000000 --- a/ext/standard/tests/dir/closedir_error-win32-mb.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Test closedir() function : error conditions - Pass incorrect number of arguments ---SKIPIF-- - ---FILE-- - -===DONE=== ---CLEAN-- - ---EXPECTF-- -*** Testing closedir() : error conditions *** - --- Testing closedir() function with more than expected no. of arguments -- - -Warning: closedir() expects at most 1 parameter, 2 given in %s on line %d -NULL -===DONE=== diff --git a/ext/standard/tests/dir/scandir_variation3-win32-mb.phpt b/ext/standard/tests/dir/scandir_variation3-win32-mb.phpt deleted file mode 100644 index ffb0284d95b37..0000000000000 --- a/ext/standard/tests/dir/scandir_variation3-win32-mb.phpt +++ /dev/null @@ -1,244 +0,0 @@ ---TEST-- -Test scandir() function : usage variations - diff data types as $context arg ---SKIPIF-- - ---FILE-- - -===DONE=== ---CLEAN-- - ---EXPECTF-- -*** Testing scandir() : usage variations *** - --- Iteration 1 -- - -Warning: scandir() expects parameter 3 to be resource, int given in %s on line %d -NULL - --- Iteration 2 -- - -Warning: scandir() expects parameter 3 to be resource, int given in %s on line %d -NULL - --- Iteration 3 -- - -Warning: scandir() expects parameter 3 to be resource, int given in %s on line %d -NULL - --- Iteration 4 -- - -Warning: scandir() expects parameter 3 to be resource, int given in %s on line %d -NULL - --- Iteration 5 -- - -Warning: scandir() expects parameter 3 to be resource, float given in %s on line %d -NULL - --- Iteration 6 -- - -Warning: scandir() expects parameter 3 to be resource, float given in %s on line %d -NULL - --- Iteration 7 -- - -Warning: scandir() expects parameter 3 to be resource, float given in %s on line %d -NULL - --- Iteration 8 -- - -Warning: scandir() expects parameter 3 to be resource, float given in %s on line %d -NULL - --- Iteration 9 -- - -Warning: scandir() expects parameter 3 to be resource, float given in %s on line %d -NULL - --- Iteration 10 -- - -Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d -NULL - --- Iteration 11 -- - -Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d -NULL - --- Iteration 12 -- - -Warning: scandir() expects parameter 3 to be resource, bool given in %s on line %d -NULL - --- Iteration 13 -- - -Warning: scandir() expects parameter 3 to be resource, bool given in %s on line %d -NULL - --- Iteration 14 -- - -Warning: scandir() expects parameter 3 to be resource, bool given in %s on line %d -NULL - --- Iteration 15 -- - -Warning: scandir() expects parameter 3 to be resource, bool given in %s on line %d -NULL - --- Iteration 16 -- - -Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d -NULL - --- Iteration 17 -- - -Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d -NULL - --- Iteration 18 -- - -Warning: scandir() expects parameter 3 to be resource, array given in %s on line %d -NULL - --- Iteration 19 -- - -Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d -NULL - --- Iteration 20 -- - -Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d -NULL - --- Iteration 21 -- - -Warning: scandir() expects parameter 3 to be resource, string given in %s on line %d -NULL - --- Iteration 22 -- - -Warning: scandir() expects parameter 3 to be resource, object given in %s on line %d -NULL - --- Iteration 23 -- - -Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d -NULL - --- Iteration 24 -- - -Warning: scandir() expects parameter 3 to be resource, null given in %s on line %d -NULL - --- Iteration 25 -- - -Warning: scandir(): supplied resource is not a valid Stream-Context resource in %s on line %d -array(2) { - [0]=> - string(1) "." - [1]=> - string(2) ".." -} -===DONE=== diff --git a/ext/standard/tests/directory/DirectoryClass_error_001-mb.phpt b/ext/standard/tests/directory/DirectoryClass_error_001-mb.phpt index cba61d3fbf97f..ed68c2a7d77a2 100644 --- a/ext/standard/tests/directory/DirectoryClass_error_001-mb.phpt +++ b/ext/standard/tests/directory/DirectoryClass_error_001-mb.phpt @@ -21,12 +21,6 @@ var_dump($d->read()); var_dump($d->rewind()); var_dump($d->close()); -echo "\n--> Try all methods with wrong number of args:\n"; -$d = new Directory($d); -var_dump($d->read(1,2)); -var_dump($d->rewind(1,2)); -var_dump($d->close(1,2)); - ?> --CLEAN-- Try all methods with wrong number of args: - -Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d -NULL - -Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d -NULL - -Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d -NULL diff --git a/ext/standard/tests/directory/DirectoryClass_error_001.phpt b/ext/standard/tests/directory/DirectoryClass_error_001.phpt index 5b2771eef6cbc..0a693dd9b75aa 100644 --- a/ext/standard/tests/directory/DirectoryClass_error_001.phpt +++ b/ext/standard/tests/directory/DirectoryClass_error_001.phpt @@ -17,12 +17,6 @@ var_dump($d->read()); var_dump($d->rewind()); var_dump($d->close()); -echo "\n--> Try all methods with wrong number of args:\n"; -$d = new Directory(getcwd()); -var_dump($d->read(1,2)); -var_dump($d->rewind(1,2)); -var_dump($d->close(1,2)); - ?> --EXPECTF-- --> Try all methods with bad handle: @@ -46,14 +40,3 @@ bool(false) Warning: Directory::close(): Unable to find my handle property in %s on line %d bool(false) - ---> Try all methods with wrong number of args: - -Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d -NULL - -Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d -NULL - -Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d -NULL diff --git a/ext/standard/tests/file/005_error.phpt b/ext/standard/tests/file/005_error.phpt index e3ce551b3de94..bc2bf3f9784b3 100644 --- a/ext/standard/tests/file/005_error.phpt +++ b/ext/standard/tests/file/005_error.phpt @@ -29,31 +29,6 @@ var_dump( filemtime("/no/such/file/or/dir") ); var_dump( filectime("/no/such/file/or/dir") ); var_dump( touch("/no/such/file/or/dir", 10) ); -/* Only one invalid argument */ -var_dump( fileatime(__FILE__, "string") ); -var_dump( filemtime(__FILE__, 100) ); -var_dump( filectime(__FILE__, TRUE) ); -var_dump( touch(__FILE__, 10, 100, 123) ); - -echo "\n-- Testing No.of arguments less than expected --"; -var_dump( fileatime() ); -var_dump( filemtime() ); -var_dump( filectime() ); -var_dump( touch() ); - -echo "\n-- Testing No.of arguments greater than expected --"; -/* Both invalid arguments */ -var_dump( fileatime("/no/such/file/or/dir", "string") ); -var_dump( filemtime("/no/such/file/or/dir", 100) ); -var_dump( filectime("/no/such/file/or/dir", TRUE) ); -var_dump( touch("/no/such/file/or/dir", 10, 100, 123) ); - -/* Only one invalid argument */ -var_dump( fileatime(__FILE__, "string") ); -var_dump( filemtime(__FILE__, 100) ); -var_dump( filectime(__FILE__, TRUE) ); -var_dump( touch(__FILE__, 10, 100, 123) ); - echo "\nDone"; ?> --EXPECTF-- @@ -72,54 +47,4 @@ bool(false) Warning: touch(): Unable to create file /no/such/file/or/dir because No such file or directory in %s on line %d bool(false) -Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing No.of arguments less than expected -- -Warning: fileatime() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: touch() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing No.of arguments greater than expected -- -Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: fileatime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filemtime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: filectime() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - Done diff --git a/ext/standard/tests/file/006_error.phpt b/ext/standard/tests/file/006_error.phpt index c35eba21287a2..e3bdda1b52dda 100644 --- a/ext/standard/tests/file/006_error.phpt +++ b/ext/standard/tests/file/006_error.phpt @@ -46,19 +46,6 @@ var_dump( chmod("/no/such/file/dir", 0777) ); var_dump( fileperms("/no/such/file/dir") ); echo "\n"; -/* With args less than expected */ -$fp = fopen(dirname(__FILE__)."/006_error.tmp", "w"); -fclose($fp); -var_dump( chmod(dirname(__FILE__)."/006_error.tmp") ); -var_dump( chmod("nofile") ); -var_dump( chmod() ); -var_dump( fileperms() ); - -/* With args greater than expected */ -var_dump( chmod(dirname(__FILE__)."/006_error.tmp", 0755, TRUE) ); -var_dump( fileperms(dirname(__FILE__)."/006_error.tmp", 0777) ); -var_dump( fileperms("nofile", 0777) ); - echo "\n*** Done ***\n"; ?> --CLEAN-- @@ -83,25 +70,4 @@ Warning: fileperms(): stat failed for /no/such/file/dir in %s on line %d bool(false) -Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: chmod() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: fileperms() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: chmod() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: fileperms() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt index 19bbf60fe9aa9..cf81a83ea08d7 100644 --- a/ext/standard/tests/file/006_variation2.phpt +++ b/ext/standard/tests/file/006_variation2.phpt @@ -68,15 +68,23 @@ $perms_array = array( $count = 1; foreach($perms_array as $permission) { echo "-- Iteration $count --\n"; - var_dump( chmod($file_name, $permission) ); - printf("%o", fileperms($file_name) ); - echo "\n"; - clearstatcache(); - - var_dump( chmod($dir_name, $permission) ); - printf("%o", fileperms($dir_name) ); - echo "\n"; - clearstatcache(); + try { + var_dump( chmod($file_name, $permission) ); + printf("%o", fileperms($file_name) ); + echo "\n"; + clearstatcache(); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + + try { + var_dump( chmod($dir_name, $permission) ); + printf("%o", fileperms($dir_name) ); + echo "\n"; + clearstatcache(); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } echo "*** Done ***\n"; @@ -148,39 +156,15 @@ bool(true) bool(true) 43567 -- Iteration 12 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod() expects parameter 2 to be int, string given +chmod() expects parameter 2 to be int, string given -- Iteration 13 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod() expects parameter 2 to be int, string given +chmod() expects parameter 2 to be int, string given -- Iteration 14 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod() expects parameter 2 to be int, string given +chmod() expects parameter 2 to be int, string given -- Iteration 15 -- - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -103567 - -Warning: chmod() expects parameter 2 to be int, string given in %s on line %d -NULL -43567 +chmod() expects parameter 2 to be int, string given +chmod() expects parameter 2 to be int, string given *** Done *** diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt deleted file mode 100644 index 93a6a23e5f523..0000000000000 --- a/ext/standard/tests/file/007_error.phpt +++ /dev/null @@ -1,185 +0,0 @@ ---TEST-- -Test fopen, fclose() & feof() functions: error conditions ---CREDITS-- -Dave Kelsey ---FILE-- - ---EXPECTF-- -*** Testing error conditions for fopen(), fclsoe() & feof() *** - -Warning: fopen() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: fopen() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: fclose(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: feof(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: feof() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: fopen() expects at most 4 parameters, 5 given in %s on line %d -bool(false) - -Warning: fclose() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: feof() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) --- Testing fopen(), fclose() & feof() with invalid arguments -- --- Iteration 1 -- - -Warning: fopen(string): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fopen(10): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, int given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fopen(10.5): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, float given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fopen(1): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fopen() expects parameter 1 to be a valid path, array given in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, array given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fopen() expects parameter 1 to be a valid path, object given in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, object given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Iteration 7 -- - -Warning: fopen(): Filename cannot be empty in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, null given in %s on line %d -bool(false) --- Iteration 8 -- - -Warning: fopen(): Filename cannot be empty in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: feof() expects parameter 1 to be resource, string given in %s on line %d -bool(false) diff --git a/ext/standard/tests/file/basename-win32.phpt b/ext/standard/tests/file/basename-win32.phpt index 996b060ceac00..703861dec7082 100644 --- a/ext/standard/tests/file/basename-win32.phpt +++ b/ext/standard/tests/file/basename-win32.phpt @@ -115,23 +115,6 @@ check_basename( $file_paths ); echo "\n*** Testing possible variations in path and suffix ***\n"; check_basename( $file_path_variations ); -echo "\n*** Testing error conditions ***\n"; -// zero arguments -var_dump( basename() ); - -// more than expected no. of arguments -var_dump( basename("\\blah\\tmp\\bar.zip", ".zip", ".zip") ); - -// passing invalid type arguments -$object = new stdclass; -var_dump( basename( array("string\\bar") ) ); -var_dump( basename( array("string\\bar"), "bar" ) ); -var_dump( basename( "bar", array("string\\bar") ) ); -var_dump( basename( $object, "bar" ) ); -var_dump( basename( $object ) ); -var_dump( basename( $object, $object ) ); -var_dump( basename( "bar", $object ) ); - echo "Done\n"; ?> --EXPECTF-- @@ -309,33 +292,4 @@ string(0) "" --Iteration 32-- string(0) "" - -*** Testing error conditions *** - -Warning: basename() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: basename() expects at most 2 parameters, 3 given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: basename() expects parameter 2 to be string, object given in %s on line %d -NULL Done diff --git a/ext/standard/tests/file/basename.phpt b/ext/standard/tests/file/basename.phpt index a9b4389b5a512..8352f4da4b62d 100644 Binary files a/ext/standard/tests/file/basename.phpt and b/ext/standard/tests/file/basename.phpt differ diff --git a/ext/standard/tests/file/bug39863.phpt b/ext/standard/tests/file/bug39863.phpt index 5460203e056dd..174e349b15fd3 100644 --- a/ext/standard/tests/file/bug39863.phpt +++ b/ext/standard/tests/file/bug39863.phpt @@ -7,16 +7,11 @@ Andrew van der Stock, vanderaj @ owasp.org $filename = __FILE__ . chr(0). ".ridiculous"; -if (file_exists($filename)) { - echo "FAIL\n"; -} -else { - echo "PASS\n"; +try { + var_dump(file_exists($filename)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; } ?> -===DONE=== - ---EXPECTF-- -Warning: file_exists() expects parameter 1 to be a valid path, string given in %s on line %d -PASS -===DONE=== +--EXPECT-- +file_exists() expects parameter 1 to be a valid path, string given diff --git a/ext/standard/tests/file/chmod_error.phpt b/ext/standard/tests/file/chmod_error.phpt index 3b234c741ff08..b7999aa03dcd6 100644 --- a/ext/standard/tests/file/chmod_error.phpt +++ b/ext/standard/tests/file/chmod_error.phpt @@ -10,19 +10,6 @@ Test chmod() function : error conditions echo "*** Testing chmod() : error conditions ***\n"; - -//Test chmod with one more than the expected number of arguments -echo "\n-- Testing chmod() function with more than expected no. of arguments --\n"; -$filename = 'string_val'; -$mode = 10; -$extra_arg = 10; -var_dump( chmod($filename, $mode, $extra_arg) ); - -// Testing chmod with one less than the expected number of arguments -echo "\n-- Testing chmod() function with less than expected no. of arguments --\n"; -$filename = 'string_val'; -var_dump( chmod($filename) ); - // testing chmod with a non-existing file $filename = "___nonExisitingFile___"; var_dump(chmod($filename, 0777)); @@ -32,16 +19,6 @@ var_dump(chmod($filename, 0777)); --EXPECTF-- *** Testing chmod() : error conditions *** --- Testing chmod() function with more than expected no. of arguments -- - -Warning: chmod() expects exactly 2 parameters, 3 given in %s on line %d -NULL - --- Testing chmod() function with less than expected no. of arguments -- - -Warning: chmod() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: chmod(): No such file or directory in %s on line %d bool(false) ===DONE=== diff --git a/ext/standard/tests/file/copy_error.phpt b/ext/standard/tests/file/copy_error.phpt index 2d6395167b338..36eb58fc2a547 100644 --- a/ext/standard/tests/file/copy_error.phpt +++ b/ext/standard/tests/file/copy_error.phpt @@ -11,13 +11,6 @@ echo "*** Testing copy() function: error conditions --\n"; /* Invalid args */ var_dump( copy("/no/file", "file") ); -/* No.of args less than expected */ -var_dump( copy() ); -var_dump( copy(__FILE__) ); - -/* No.of args less than expected */ -var_dump( copy(__FILE__, "file1", "file1") ); - echo "*** Done ***\n"; ?> --EXPECTF-- @@ -25,13 +18,4 @@ echo "*** Done ***\n"; Warning: copy(/no/file): failed to open stream: No such file or directory in %s on line %d bool(false) - -Warning: copy() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: copy() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: copy() expects parameter 3 to be resource, string given in %s on line %d -NULL *** Done *** diff --git a/ext/standard/tests/file/copy_variation4.phpt b/ext/standard/tests/file/copy_variation4.phpt index 3c3abea05a1ab..8a2f8972fcdc3 100644 Binary files a/ext/standard/tests/file/copy_variation4.phpt and b/ext/standard/tests/file/copy_variation4.phpt differ diff --git a/ext/standard/tests/file/disk.phpt b/ext/standard/tests/file/disk.phpt index a048af6ccbf61..fe415535ba48f 100644 --- a/ext/standard/tests/file/disk.phpt +++ b/ext/standard/tests/file/disk.phpt @@ -11,9 +11,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { --FILE-- --EXPECTF-- -Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_error-win32.phpt b/ext/standard/tests/file/disk_free_space_error-win32.phpt index acb0fdd717a28..35140d23fb5b7 100644 --- a/ext/standard/tests/file/disk_free_space_error-win32.phpt +++ b/ext/standard/tests/file/disk_free_space_error-win32.phpt @@ -16,12 +16,6 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) echo "*** Testing error conditions ***\n"; $file_path = dirname(__FILE__); -var_dump( disk_free_space() ); // Zero Arguments -var_dump( diskfreespace() ); - -var_dump( disk_free_space( $file_path, "extra argument") ); // More than valid number of arguments -var_dump( diskfreespace( $file_path, "extra argument") ); - var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory var_dump( diskfreespace( $file_path."/dir1" )); @@ -43,18 +37,6 @@ unlink($file_path."/disk_free_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_free_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_free_space(): The system cannot find the path specified. in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_error.phpt b/ext/standard/tests/file/disk_free_space_error.phpt index 6433cde7029e9..00ec271f8d89a 100644 --- a/ext/standard/tests/file/disk_free_space_error.phpt +++ b/ext/standard/tests/file/disk_free_space_error.phpt @@ -16,12 +16,6 @@ if(substr(PHP_OS, 0, 3) == 'WIN') echo "*** Testing error conditions ***\n"; $file_path = dirname(__FILE__); -var_dump( disk_free_space() ); // Zero Arguments -var_dump( diskfreespace() ); - -var_dump( disk_free_space( $file_path, "extra argument") ); // More than valid number of arguments -var_dump( diskfreespace( $file_path, "extra argument") ); - var_dump( disk_free_space( $file_path."/dir1" )); // Invalid directory var_dump( diskfreespace( $file_path."/dir1" )); @@ -43,18 +37,6 @@ unlink($file_path."/disk_free_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_free_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_free_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: diskfreespace() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt index 6c6575d8965f1..912648f1007b4 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -48,8 +48,16 @@ $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; - var_dump( disk_free_space( $dir1 ) ); - var_dump( diskfreespace( $dir1 ) ); + try { + var_dump( disk_free_space( $dir1 ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( diskfreespace( $dir1 ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } @@ -102,35 +110,19 @@ float(%d) float(%d) -- Iteration 9 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space() expects parameter 1 to be a valid path, string given +diskfreespace() expects parameter 1 to be a valid path, string given -- Iteration 10 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space() expects parameter 1 to be a valid path, string given +diskfreespace() expects parameter 1 to be a valid path, string given -- Iteration 11 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space() expects parameter 1 to be a valid path, string given +diskfreespace() expects parameter 1 to be a valid path, string given -- Iteration 12 -- - -Warning: disk_free_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: diskfreespace() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_free_space() expects parameter 1 to be a valid path, string given +diskfreespace() expects parameter 1 to be a valid path, string given --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_error-win32.phpt b/ext/standard/tests/file/disk_total_space_error-win32.phpt index 0d511b37a7f86..29462bb31c8fe 100644 --- a/ext/standard/tests/file/disk_total_space_error-win32.phpt +++ b/ext/standard/tests/file/disk_total_space_error-win32.phpt @@ -16,10 +16,6 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) echo "*** Testing error conditions ***\n"; $file_path = dirname(__FILE__); -var_dump( disk_total_space() ); // Zero Arguments - -var_dump( disk_total_space( $file_path, "extra argument") ); // More than valid number of arguments - var_dump( disk_total_space( $file_path."/dir1" )); // Invalid directory @@ -38,12 +34,6 @@ unlink($file_path."/disk_total_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_total_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_total_space(): The system cannot find the path specified. in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_total_space_error.phpt b/ext/standard/tests/file/disk_total_space_error.phpt index 2c8a940117dfe..b50472708939f 100644 --- a/ext/standard/tests/file/disk_total_space_error.phpt +++ b/ext/standard/tests/file/disk_total_space_error.phpt @@ -16,10 +16,6 @@ if(substr(PHP_OS, 0, 3) == 'WIN') echo "*** Testing error conditions ***\n"; $file_path = dirname(__FILE__); -var_dump( disk_total_space() ); // Zero Arguments - -var_dump( disk_total_space( $file_path, "extra argument") ); // More than valid number of arguments - var_dump( disk_total_space( $file_path."/dir1" )); // Invalid directory @@ -38,12 +34,6 @@ unlink($file_path."/disk_total_space.tmp"); --EXPECTF-- *** Testing error conditions *** -Warning: disk_total_space() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: disk_total_space() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: disk_total_space(): No such file or directory in %s on line %d bool(false) float(%d) diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt index 071fa607492c2..89c47dcaba324 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -49,7 +49,11 @@ $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; - var_dump( disk_total_space( $dir1 ) ); + try { + var_dump( disk_total_space( $dir1 ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } @@ -96,25 +100,17 @@ float(%d) float(%d) -- Iteration 9 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space() expects parameter 1 to be a valid path, string given -- Iteration 10 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space() expects parameter 1 to be a valid path, string given -- Iteration 11 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space() expects parameter 1 to be a valid path, string given -- Iteration 12 -- - -Warning: disk_total_space() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +disk_total_space() expects parameter 1 to be a valid path, string given *** Testing with Binary Input *** -float(%d) +float(%s) --- Done --- diff --git a/ext/standard/tests/file/fgetc_variation2.phpt b/ext/standard/tests/file/fgetc_variation2.phpt index d444209af4291..dd0dbb2096dd2 100644 --- a/ext/standard/tests/file/fgetc_variation2.phpt +++ b/ext/standard/tests/file/fgetc_variation2.phpt @@ -26,15 +26,6 @@ fclose($file_handle); // read from closed file var_dump( fgetc($file_handle) ); -echo "-- Testing fgetc() with unset handle --\n"; -// open the file for reading -$file_handle = fopen(__FILE__, "r"); -// unset the file handle -unset($file_handle); - -//fgetc using unset handle -var_dump( fgetc($file_handle) ); - echo "Done"; ?> --EXPECTF-- @@ -43,10 +34,4 @@ echo "Done"; Warning: fgetc(): supplied resource is not a valid stream resource in %s on line %d bool(false) --- Testing fgetc() with unset handle -- - -Notice: Undefined variable: file_handle in %s on line %d - -Warning: fgetc() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt index 919343aa87505..eed35b30015e2 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -8,14 +8,8 @@ Test fgets() function : error conditions */ echo "*** Testing error conditions ***\n"; -// zero argument -echo "-- Testing fgets() with zero argument --\n"; -var_dump( fgets() ); -// more than expected no. of args -echo "-- Testing fgets() with more than expected number of arguments --\n"; $fp = fopen(__FILE__, "r"); -var_dump( fgets($fp, 10, $fp) ); // invalid length argument echo "-- Testing fgets() with invalid length arguments --\n"; @@ -26,45 +20,10 @@ var_dump( fgets($fp, $len) ); $len = 1; var_dump( fgets($fp, $len) ); // return length - 1 always, expect false - -// test invalid arguments : non-resources -echo "-- Testing fgets() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fgets() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fgets($invalid_args[$loop_counter - 1], 10) ); -} - -// fgets() on a file handle which is already closed -echo "-- Testing fgets() with closed/unset file handle --"; -fclose($fp); -var_dump(fgets($fp,10)); - -// fgets() on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( fgets(@$file_handle,10)); - echo "Done\n"; ?> --EXPECTF-- *** Testing error conditions *** --- Testing fgets() with zero argument -- - -Warning: fgets() expects at least 1 parameter, 0 given in %s on line %d -bool(false) --- Testing fgets() with more than expected number of arguments -- - -Warning: fgets() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -- Testing fgets() with invalid length arguments -- Warning: fgets(): Length parameter must be greater than 0 in %s on line %d @@ -73,35 +32,4 @@ bool(false) Warning: fgets(): Length parameter must be greater than 0 in %s on line %d bool(false) bool(false) --- Testing fgets() with invalid arguments -- --- Iteration 1 -- - -Warning: fgets() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fgets() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fgets() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fgets() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fgets() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fgets() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Testing fgets() with closed/unset file handle -- -Warning: fgets(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt index 0bbcf220391b9..aa8beb2d4def1 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -27,16 +27,6 @@ fclose($file_handle); var_dump( fgets($file_handle) ); // default length var_dump( fgets($file_handle, 10) ); // with specific length -echo "-- Testing fgets() with unset handle --\n"; -// open the file for reading -$file_handle = fopen(__FILE__, "r"); -// unset the file handle -unset($file_handle); - -//fgets using unset handle -var_dump( fgets($file_handle) ); // default length -var_dump( fgets($file_handle, 10) ); // with specific length - echo "Done"; ?> --EXPECTF-- @@ -48,15 +38,4 @@ bool(false) Warning: fgets(): supplied resource is not a valid stream resource in %s on line %d bool(false) --- Testing fgets() with unset handle -- - -Notice: Undefined variable: file_handle in %s on line %d - -Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d -bool(false) - -Notice: Undefined variable: file_handle in %s on line %d - -Warning: fgets() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt index 12148189e8282..2efacd1b31ac2 100644 --- a/ext/standard/tests/file/file_error.phpt +++ b/ext/standard/tests/file/file_error.phpt @@ -8,14 +8,10 @@ Test file() function : error conditions Returns the file in an array */ $file_path = dirname(__FILE__); -echo "\n*** Testing error conditions ***"; +echo "\n*** Testing error conditions ***\n"; $file_handle = fopen($file_path."/file.tmp", "w"); -var_dump( file() ); // Zero No. of args $filename = $file_path."/file.tmp"; -var_dump( file($filename, $filename, $filename, $filename) ); // more than expected number of arguments - -var_dump( file($filename, "INCORRECT_FLAG", NULL) ); // Incorrect flag var_dump( file($filename, 10, NULL) ); // Incorrect flag var_dump( file("temp.tmp") ); // non existing filename @@ -30,14 +26,6 @@ unlink($file_path."/file.tmp"); ?> --EXPECTF-- *** Testing error conditions *** -Warning: file() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: file() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: file() expects parameter 2 to be int, string given in %s on line %d -NULL array(0) { } diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index f06628f5161fc..6677d78866330 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -17,14 +17,8 @@ include($file_path."/file.inc"); echo "\n-- Testing with Non-existing file --\n"; print( file_get_contents("/no/such/file/or/dir") ); -echo "\n-- Testing No.of arguments less than expected --\n"; -print( file_get_contents() ); - -echo "\n-- Testing No.of arguments greater than expected --\n"; - create_files($file_path, 1, "text", 0755, 100, "w", "file", 1, "byte"); $file_handle = fopen($file_path."/file_put_contents_error.tmp", "w"); -print( file_get_contents($file_path."/file1.tmp", false, $file_handle, 1, 2, "extra_argument") ); echo "\n-- Testing for invalid negative maxlen values --"; var_dump( file_get_contents($file_path."/file1.tmp", FALSE, $file_handle, 0, -5) ); @@ -52,14 +46,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 No.of arguments less than expected -- - -Warning: file_get_contents() expects at least 1 parameter, 0 given in %s on line %d - --- Testing No.of arguments greater than expected -- - -Warning: file_get_contents() expects at most 5 parameters, 6 given in %s on line %d - -- Testing for invalid negative maxlen values -- Warning: file_get_contents(): length must be greater than or equal to zero in %s on line %d bool(false) 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 b2a09798e311b..23c33b60d3566 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 @@ -18,15 +18,7 @@ $file_path = dirname(__FILE__); echo "\n-- Testing with Non-existing file --\n"; print( file_get_contents("/no/such/file/or/dir") ); -echo "\n-- Testing No.of arguments less than expected --\n"; -print( file_get_contents() ); -print( file_put_contents() ); -print( file_put_contents($file_path."/".__FILE__) ); - $file_handle = fopen($file_path."/file_put_contents.tmp", "w"); -echo "\n-- Testing No.of arguments greater than expected --\n"; -print( file_put_contents("abc.tmp", 12345, 1, $file_handle, "extra_argument") ); -print( file_get_contents("abc.tmp", false, $file_handle, 1, 2, "extra_argument") ); echo "\n-- Testing for invalid negative maxlen values --"; file_put_contents($file_path."/file_put_contents1.tmp", "Garbage data in the file"); @@ -50,20 +42,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 No.of arguments less than expected -- - -Warning: file_get_contents() expects at least 1 parameter, 0 given in %s on line %d - -Warning: file_put_contents() expects at least 2 parameters, 0 given in %s on line %d - -Warning: file_put_contents() expects at least 2 parameters, 1 given in %s on line %d - --- Testing No.of arguments greater than expected -- - -Warning: file_put_contents() expects at most 4 parameters, 5 given in %s on line %d - -Warning: file_get_contents() expects at most 5 parameters, 6 given in %s on line %d - -- Testing for invalid negative maxlen values -- Warning: file_get_contents(): length must be greater than or equal to zero in %s on line %d bool(false) diff --git a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt index 4928404098fe1..25060ea0cf080 100644 --- a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt @@ -38,7 +38,11 @@ $names_arr = array( foreach($names_arr as $key =>$value) { echo "\n-- Filename: $key --\n"; - var_dump(file_get_contents($value)); + try { + var_dump(file_get_contents($value)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> @@ -77,14 +81,10 @@ Warning: file_get_contents( ): failed to open stream: Permission denied in %s on bool(false) -- Filename: \0 -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +file_get_contents() expects parameter 1 to be a valid path, string given -- Filename: array() -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %s on line %d -NULL +file_get_contents() expects parameter 1 to be a valid path, array given -- Filename: /no/such/file/dir -- diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt index 97a3495d5439b..f826ad60c2225 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -37,7 +37,11 @@ $names_arr = array( for( $i=0; $igetMessage(), "\n"; + } } echo "\n*** Done ***\n"; @@ -69,13 +73,9 @@ bool(false) Warning: file_get_contents( ): failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +file_get_contents() expects parameter 1 to be a valid path, string given -- Iteration 7 -- - -Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %s on line %d -NULL +file_get_contents() expects parameter 1 to be a valid path, array given -- Iteration 8 -- Warning: file_get_contents(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt index 095980b53627c..4c03581c48397 100644 --- a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt @@ -35,14 +35,18 @@ $names_arr = array( ); foreach($names_arr as $key =>$value) { - echo "\n-- Filename: $key --\n"; - $res = file_put_contents($value, "Some data"); - if ($res !== false && $res != null) { - echo "$res bytes written to: $value\n"; - unlink($value); - } else { - echo "Failed to write data to: $key\n"; - } + echo "\n-- Filename: $key --\n"; + try { + $res = file_put_contents($value, "Some data"); + if ($res !== false && $res != null) { + echo "$res bytes written to: $value\n"; + unlink($value); + } else { + echo "Failed to write data to: $key\n"; + } + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } }; ?> @@ -77,14 +81,10 @@ Warning: file_put_contents( ): failed to open stream: Permission denied in %s on Failed to write data to: " " -- Filename: \0 -- - -Warning: file_put_contents() expects parameter 1 to be a valid path, string given in %s on line %d -Failed to write data to: \0 +file_put_contents() expects parameter 1 to be a valid path, string given -- Filename: array() -- - -Warning: file_put_contents() expects parameter 1 to be a valid path, array given in %s on line %d -Failed to write data to: array() +file_put_contents() expects parameter 1 to be a valid path, array given -- Filename: /no/such/file/dir -- diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt index 4aef0644f9339..76b7b6f5c6fcc 100644 Binary files a/ext/standard/tests/file/file_put_contents_variation8.phpt and b/ext/standard/tests/file/file_put_contents_variation8.phpt differ diff --git a/ext/standard/tests/file/filegroup_error.phpt b/ext/standard/tests/file/filegroup_error.phpt index e32711cd5beae..e602f3441fd26 100644 --- a/ext/standard/tests/file/filegroup_error.phpt +++ b/ext/standard/tests/file/filegroup_error.phpt @@ -15,10 +15,6 @@ var_dump( filegroup("/no/such/file/dir") ); var_dump( filegroup("string") ); var_dump( filegroup(100) ); -/* Invalid no.of arguments */ -var_dump( filegroup() ); // args < expected -var_dump( filegroup("/no/such/file", "root") ); // args > expected - echo "\n*** Done ***\n"; ?> --EXPECTF-- @@ -33,10 +29,4 @@ bool(false) Warning: filegroup(): stat failed for 100 in %s on line %d bool(false) -Warning: filegroup() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filegroup() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/filegroup_variation2.phpt b/ext/standard/tests/file/filegroup_variation2.phpt index 809d61ba73794..46a3dc9f35860 100644 --- a/ext/standard/tests/file/filegroup_variation2.phpt +++ b/ext/standard/tests/file/filegroup_variation2.phpt @@ -11,7 +11,6 @@ Dave Kelsey /* Testing filegroup() with invalid arguments -int, float, bool, NULL, resource */ $file_path = dirname(__FILE__); -$file_handle = fopen($file_path."/filegroup_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -22,7 +21,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -34,7 +32,6 @@ foreach( $filenames as $filename ) { var_dump( filegroup($filename) ); clearstatcache(); } -fclose($file_handle); echo "\n*** Done ***"; ?> @@ -58,9 +55,6 @@ bool(false) bool(false) bool(false) -Warning: filegroup() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: filegroup(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt index ebefeb7e3f245..a0d4b2fdeed31 100644 --- a/ext/standard/tests/file/filegroup_variation3.phpt +++ b/ext/standard/tests/file/filegroup_variation3.phpt @@ -39,7 +39,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( filegroup( $file_path."/".$file ) ); + try { + var_dump( filegroup( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -74,12 +78,8 @@ bool(false) Warning: filegroup(): stat failed for %s/filegroup_variation3/filegroup*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: filegroup() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +filegroup() expects parameter 1 to be a valid path, string given - Iteration 8 - - -Warning: filegroup() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +filegroup() expects parameter 1 to be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/fileinode_error.phpt b/ext/standard/tests/file/fileinode_error.phpt index 462ab62367255..d080467f04bd0 100644 --- a/ext/standard/tests/file/fileinode_error.phpt +++ b/ext/standard/tests/file/fileinode_error.phpt @@ -16,12 +16,6 @@ var_dump( fileinode("/no/such/file/dir") ); var_dump( fileinode("string") ); var_dump( fileinode(100) ); -/* No.of arguments less than expected */ -var_dump( fileinode() ); - -/* No.of arguments greater than expected */ -var_dump( fileinode(__FILE__, "string") ); - echo "\n*** Done ***"; --EXPECTF-- *** Testing error conditions of fileinode() *** @@ -34,10 +28,4 @@ bool(false) Warning: fileinode(): stat failed for 100 in %s on line 14 bool(false) -Warning: fileinode() expects exactly 1 parameter, 0 given in %s on line 17 -NULL - -Warning: fileinode() expects exactly 1 parameter, 2 given in %s on line 20 -NULL - *** Done *** diff --git a/ext/standard/tests/file/fileinode_variation2.phpt b/ext/standard/tests/file/fileinode_variation2.phpt index 90c7eb19e3b77..d6397d33b81b5 100644 --- a/ext/standard/tests/file/fileinode_variation2.phpt +++ b/ext/standard/tests/file/fileinode_variation2.phpt @@ -12,7 +12,6 @@ Description: Returns the inode number of the file, or FALSE in case of an error. /* Testing fileinode() with invalid arguments -int, float, bool, NULL, resource */ $file_path = dirname(__FILE__); -$file_handle = fopen($file_path."/fileinode_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -23,7 +22,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -35,7 +33,6 @@ foreach( $filenames as $filename ) { var_dump( fileinode($filename) ); clearstatcache(); } -fclose($file_handle); echo "\n*** Done ***"; ?> @@ -59,9 +56,6 @@ bool(false) bool(false) bool(false) -Warning: fileinode() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: fileinode(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileinode_variation3.phpt b/ext/standard/tests/file/fileinode_variation3.phpt index 2f51e8f595a09..e50fcfb76759e 100644 --- a/ext/standard/tests/file/fileinode_variation3.phpt +++ b/ext/standard/tests/file/fileinode_variation3.phpt @@ -40,7 +40,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( fileinode( $file_path."/".$file ) ); + try { + var_dump( fileinode( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -75,12 +79,8 @@ bool(false) Warning: fileinode(): stat failed for %s/fileinode_variation3/fileinode*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: fileinode() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileinode() expects parameter 1 to be a valid path, string given - Iteration 8 - - -Warning: fileinode() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileinode() expects parameter 1 to be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/fileowner_error.phpt b/ext/standard/tests/file/fileowner_error.phpt index 967a541cc0a86..807c09f0f0f29 100644 --- a/ext/standard/tests/file/fileowner_error.phpt +++ b/ext/standard/tests/file/fileowner_error.phpt @@ -15,10 +15,6 @@ var_dump( fileowner("/no/such/file/dir") ); var_dump( fileowner("string") ); var_dump( fileowner(100) ); -/* Invalid no.of arguments */ -var_dump( fileowner() ); // args < expected -var_dump( fileowner("/no/such/file", "root") ); // args > expected - echo "\n*** Done ***\n"; ?> --EXPECTF-- @@ -33,10 +29,4 @@ bool(false) Warning: fileowner(): stat failed for 100 in %s on line %d bool(false) -Warning: fileowner() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: fileowner() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/fileowner_variation2.phpt b/ext/standard/tests/file/fileowner_variation2.phpt index 131d43bfaa738..f6741cb9ca2b5 100644 --- a/ext/standard/tests/file/fileowner_variation2.phpt +++ b/ext/standard/tests/file/fileowner_variation2.phpt @@ -12,7 +12,6 @@ Dave Kelsey /* Testing fileowner() with invalid arguments -int, float, bool, NULL, resource */ $file_path = dirname(__FILE__); -$file_handle = fopen($file_path."/fileowner_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -23,7 +22,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -35,7 +33,6 @@ foreach( $filenames as $filename ) { var_dump( fileowner($filename) ); clearstatcache(); } -fclose($file_handle); echo "\n*** Done ***"; ?> @@ -59,9 +56,6 @@ bool(false) bool(false) bool(false) -Warning: fileowner() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: fileowner(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileowner_variation3.phpt b/ext/standard/tests/file/fileowner_variation3.phpt index 5768f528f1b98..6a2953aa6c1aa 100644 --- a/ext/standard/tests/file/fileowner_variation3.phpt +++ b/ext/standard/tests/file/fileowner_variation3.phpt @@ -40,7 +40,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( fileowner( $file_path."/".$file ) ); + try { + var_dump( fileowner( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -75,12 +79,8 @@ bool(false) Warning: fileowner(): stat failed for %s/fileowner_variation3/fileowner*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: fileowner() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileowner() expects parameter 1 to be a valid path, string given - Iteration 8 - - -Warning: fileowner() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileowner() expects parameter 1 to be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/fileperms_variation2.phpt b/ext/standard/tests/file/fileperms_variation2.phpt index 6b1778e74e7f8..b2b8a198590ca 100644 --- a/ext/standard/tests/file/fileperms_variation2.phpt +++ b/ext/standard/tests/file/fileperms_variation2.phpt @@ -11,7 +11,6 @@ Dave Kelsey /* Testing fileperms() with invalid arguments -int, float, bool, NULL, resource */ $file_path = dirname(__FILE__); -$file_handle = fopen($file_path."/fileperms_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -22,7 +21,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -34,7 +32,6 @@ foreach( $filenames as $filename ) { var_dump( fileperms($filename) ); clearstatcache(); } -fclose($file_handle); echo "\n*** Done ***"; ?> @@ -58,9 +55,6 @@ bool(false) bool(false) bool(false) -Warning: fileperms() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: fileperms(): stat failed for 1234 in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fileperms_variation3.phpt b/ext/standard/tests/file/fileperms_variation3.phpt index 6ae97d1601be4..5b1160019ad65 100644 --- a/ext/standard/tests/file/fileperms_variation3.phpt +++ b/ext/standard/tests/file/fileperms_variation3.phpt @@ -39,7 +39,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( fileperms( $file_path."/".$file ) ); + try { + var_dump( fileperms( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -74,12 +78,8 @@ bool(false) Warning: fileperms(): stat failed for %s/fileperms_variation3/fileperms*.tmp in %s on line %d bool(false) - Iteration 7 - - -Warning: fileperms() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileperms() expects parameter 1 to be a valid path, string given - Iteration 8 - - -Warning: fileperms() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fileperms() expects parameter 1 to be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/filesize_error.phpt b/ext/standard/tests/file/filesize_error.phpt index 9f721ff9211a7..5ad8ee99ca138 100644 --- a/ext/standard/tests/file/filesize_error.phpt +++ b/ext/standard/tests/file/filesize_error.phpt @@ -14,13 +14,6 @@ echo "*** Testing filesize(): error conditions ***"; var_dump( filesize("/no/such/file") ); var_dump( filesize("/no/such/dir") ); -/* No.of arguments less than expected */ -var_dump( filesize() ); - -/* No.of arguments greater than expected */ -var_dump( filesize(__FILE__, 2000) ); -echo "\n"; - echo "*** Done ***\n"; ?> --EXPECTF-- @@ -30,11 +23,4 @@ bool(false) Warning: filesize(): stat failed for /no/such/dir in %s on line %d bool(false) - -Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/filetype_error.phpt b/ext/standard/tests/file/filetype_error.phpt index b49a5286c6770..a34671d9b06e5 100644 --- a/ext/standard/tests/file/filetype_error.phpt +++ b/ext/standard/tests/file/filetype_error.phpt @@ -16,12 +16,6 @@ print( filetype("/no/such/file/dir") ); print( filetype("string") ); print( filetype(100) ); -/* No.of args less than expected */ -print( filetype() ); - -/* No.of args greater than expected */ -print( filetype("file", "file") ); - echo "\n*** Done ***\n"; ?> --EXPECTF-- @@ -32,8 +26,4 @@ Warning: filetype(): Lstat failed for string in %s on line %d Warning: filetype(): Lstat failed for 100 in %s on line %d -Warning: filetype() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: filetype() expects exactly 1 parameter, 2 given in %s on line %d - *** Done *** diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index 2330270113536..4c3cb45c065e2 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -5,9 +5,6 @@ flock() tests $file = dirname(__FILE__)."/flock.dat"; -var_dump(flock()); -var_dump(flock("", "", $var)); - $fp = fopen($file, "w"); fclose($fp); @@ -41,12 +38,6 @@ $file = dirname(__FILE__)."/flock.dat"; unlink($file); ?> --EXPECTF-- -Warning: flock() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: flock() expects parameter 1 to be resource, string given in %s on line %d -NULL - Warning: flock(): supplied resource is not a valid stream resource in %s on line %d bool(false) bool(true) diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index ccb6274756995..0e3f1d949c243 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -29,7 +29,11 @@ $operations = array( $i = 0; foreach($operations as $operation) { echo "\n--- Iteration $i ---"; - var_dump(flock($fp, $operation)); + try { + var_dump(flock($fp, $operation)); + } catch (TypeError $e) { + echo "\n", $e->getMessage(), "\n"; + } $i++; } @@ -39,15 +43,6 @@ $fp = fopen($file, "w"); fclose($fp); var_dump(flock($fp, LOCK_SH|LOCK_NB)); -var_dump(flock("", "", $var)); - -/* No.of args leass than expected */ -var_dump(flock()); -var_dump(flock($fp)); - -/* No.of args greater than expected */ -var_dump(flock($fp, "", $var, "")); - echo "\n*** Done ***\n"; ?> --CLEAN-- @@ -75,38 +70,21 @@ Warning: flock(): Illegal operation argument in %s on line %d bool(false) --- Iteration 4 --- -Warning: flock() expects parameter 2 to be int, array given in %s on line %d -NULL +flock() expects parameter 2 to be int, array given --- Iteration 5 --- -Warning: flock() expects parameter 2 to be int, array given in %s on line %d -NULL +flock() expects parameter 2 to be int, array given --- Iteration 6 --- -Warning: flock() expects parameter 2 to be int, string given in %s on line %d -NULL +flock() expects parameter 2 to be int, string given --- Iteration 7 --- -Warning: flock() expects parameter 2 to be int, string given in %s on line %d -NULL +flock() expects parameter 2 to be int, string given --- Iteration 8 --- -Warning: flock() expects parameter 2 to be int, string given in %s on line %d -NULL +flock() expects parameter 2 to be int, string given Warning: flock(): supplied resource is not a valid stream resource in %s on line %d bool(false) -Warning: flock() expects parameter 1 to be resource, string given in %s on line %d -NULL - -Warning: flock() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: flock() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: flock() expects at most 3 parameters, 4 given in %s on line %d -NULL - *** Done *** diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt index b3607be58b9c9..048eb1475c9be 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -66,7 +66,11 @@ $pattern_arr = array( for( $i = 0; $igetMessage(), "\n"; + } } unlink($file_name); @@ -78,7 +82,11 @@ function match( $pattern, $string ) { for( $i = 0; $igetMessage(), "\n"; + } } } } @@ -134,7 +142,7 @@ match($null_arr, $null_arr); echo "\n*** Done ***\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fnmatch() with file and various patterns *** -- Iteration 0 -- bool(true) @@ -183,13 +191,9 @@ bool(false) -- Iteration 22 -- bool(false) -- Iteration 23 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 1 to be a valid path, string given -- Iteration 24 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 1 to be a valid path, string given -- Iteration 25 -- bool(false) -- Iteration 26 -- @@ -263,84 +267,44 @@ bool(true) --- With Strings --- -- Iteration 0 -- bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(true) -- Iteration 1 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given -- Iteration 2 -- bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(true) -- Iteration 3 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given -- Iteration 4 -- bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(true) bool(false) -- Iteration 5 -- bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(true) @@ -441,64 +405,42 @@ bool(true) bool(true) bool(true) bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(false) -- Iteration 1 -- bool(true) bool(true) bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(false) -- Iteration 2 -- bool(true) bool(true) bool(true) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(false) -- Iteration 3 -- - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: fnmatch() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given +fnmatch() expects parameter 1 to be a valid path, string given -- Iteration 4 -- bool(false) bool(false) bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(true) bool(false) -- Iteration 5 -- bool(false) bool(false) bool(false) - -Warning: fnmatch() expects parameter 2 to be a valid path, string given in %s on line %d -NULL +fnmatch() expects parameter 2 to be a valid path, string given bool(false) bool(true) diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt index 1c4068cd97230..f51f24c7548e6 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -14,14 +14,6 @@ echo "*** Testing error conditions ***\n"; $filename = __FILE__; $file_handle = fopen($filename, "r"); -// zero argument -echo "-- Testing fread() with zero argument --\n"; -var_dump( fread() ); - -// more than expected no. of args -echo "-- Testing fread() with more than expected number of arguments --\n"; -var_dump( fread($file_handle, 10, $file_handle) ); - // invalid length argument echo "-- Testing fread() with invalid length arguments --\n"; $len = 0; @@ -29,44 +21,9 @@ var_dump( fread($file_handle, $len) ); $len = -10; var_dump( fread($file_handle, $len) ); -// test invalid arguments : non-resources -echo "-- Testing fread() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fread() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fread($invalid_args[$loop_counter - 1], 10) ); -} - -// fwrite() on a file handle which is already closed -echo "-- Testing fwrite() with closed/unset file handle --\n"; -fclose($file_handle); -var_dump( fread($file_handle,$file_content_type) ); - -// fwrite on a file handle which is unset -$fp = fopen($filename, "r"); -unset($fp); //unset file handle -var_dump( fread(@$fp,10) ); -var_dump( fclose(@$fp) ); - echo "Done\n"; --EXPECTF-- *** Testing error conditions *** --- Testing fread() with zero argument -- - -Warning: fread() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) --- Testing fread() with more than expected number of arguments -- - -Warning: fread() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) -- Testing fread() with invalid length arguments -- Warning: fread(): Length parameter must be greater than 0 in %s on line %d @@ -74,41 +31,4 @@ bool(false) Warning: fread(): Length parameter must be greater than 0 in %s on line %d bool(false) --- Testing fread() with invalid arguments -- --- Iteration 1 -- - -Warning: fread() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fread() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fread() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fread() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fread() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fread() expects parameter 1 to be resource, object given in %s on line %d -bool(false) --- Testing fwrite() with closed/unset file handle -- - -Notice: Undefined variable: file_content_type in %s on line %d - -Warning: fread(): supplied resource is not a valid stream resource in %s on line %d -bool(false) - -Warning: fread() expects parameter 1 to be resource, null given in %s on line %d -bool(false) - -Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt index 6d3d0a5b961c1..7e40d20b4876a 100644 --- a/ext/standard/tests/file/fscanf.phpt +++ b/ext/standard/tests/file/fscanf.phpt @@ -5,10 +5,6 @@ fscanf() tests $filename = dirname(__FILE__)."/fscanf.dat"; -var_dump(fscanf()); -var_dump(fscanf(array())); -var_dump(fscanf(array(), array())); - file_put_contents($filename, "data"); $fp = fopen($filename, "rt"); @@ -64,14 +60,6 @@ $filename = dirname(__FILE__)."/fscanf.dat"; unlink($filename); ?> --EXPECTF-- -Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: fscanf() expects at least 2 parameters, 1 given in %s on line %d -NULL - -Warning: fscanf() expects parameter 1 to be resource, array given in %s on line %d -NULL int(0) NULL int(1) diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt index 0da1fc69aafbb..d5b2ba73aa911 100644 --- a/ext/standard/tests/file/fscanf_error.phpt +++ b/ext/standard/tests/file/fscanf_error.phpt @@ -17,16 +17,6 @@ if ($file_handle == false) fwrite($file_handle, "hello world"); fclose($file_handle); -// zero argument -var_dump( fscanf() ); - -// single argument -$file_handle = fopen($filename, 'r'); -if ($file_handle == false) - exit("Error:failed to open file $filename"); -var_dump( fscanf($file_handle) ); -fclose($file_handle); - // invalid file handle var_dump( fscanf($file_handle, "%s") ); @@ -63,12 +53,6 @@ unlink($filename); --EXPECTF-- *** Testing fscanf() for error conditions *** -Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: fscanf() expects at least 2 parameters, 1 given in %s on line %d -NULL - Warning: fscanf(): supplied resource is not a valid File-Handle resource in %s on line %d bool(false) diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index 9c1b3a822d1f1..c39b3bcbe57d8 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -14,86 +14,18 @@ Test fseek(), ftell() & rewind() functions : error conditions - fseek() */ echo "*** Testing fseek() : error conditions ***\n"; -// zero argument -echo "-- Testing fseek() with zero argument --\n"; -var_dump( fseek() ); - -// unexpected no. of args -echo "-- Testing fseek() with unexpected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( fseek($fp) ); -var_dump( fseek($fp, 10, $fp,10) ); - -// test invalid arguments : non-resources -echo "-- Testing fseek() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass -); -/* loop to test fseek() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fseek($invalid_args[$loop_counter - 1], 10) ); -} // fseek() on a file handle which is already closed echo "-- Testing fseek() with closed/unset file handle --"; +$fp = fopen(__FILE__, "r"); fclose($fp); var_dump(fseek($fp,10)); -// fseek() on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( fseek(@$file_handle,10)); - echo "Done\n"; ?> --EXPECTF-- *** Testing fseek() : error conditions *** --- Testing fseek() with zero argument -- - -Warning: fseek() expects at least 2 parameters, 0 given in %s on line %d -bool(false) --- Testing fseek() with unexpected number of arguments -- - -Warning: fseek() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: fseek() expects at most 3 parameters, 4 given in %s on line %d -bool(false) --- Testing fseek() with invalid arguments -- --- Iteration 1 -- - -Warning: fseek() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fseek() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fseek() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fseek() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fseek() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fseek() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing fseek() with closed/unset file handle -- Warning: fseek(): supplied resource is not a valid stream resource in %s on line %d bool(false) - -Warning: fseek() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index 8835046f6cd08..87f70b87172bf 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -14,82 +14,18 @@ Test fseek(), ftell() & rewind() functions : error conditions - ftell() */ echo "*** Testing ftell() : error conditions ***\n"; -// zero argument -echo "-- Testing ftell() with zero argument --\n"; -var_dump( ftell() ); - -// more than expected no. of args -echo "-- Testing ftell() with more than expected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( ftell($fp, 10) ); - -// test invalid arguments : non-resources -echo "-- Testing ftell() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test ftell with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( ftell($invalid_args[$loop_counter - 1]) ); -} // ftell on a file handle which is already closed echo "-- Testing ftell with closed/unset file handle --"; +$fp = fopen(__FILE__, "r"); fclose($fp); var_dump(ftell($fp)); -// ftell on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( ftell(@$file_handle) ); - echo "Done\n"; ?> --EXPECTF-- *** Testing ftell() : error conditions *** --- Testing ftell() with zero argument -- - -Warning: ftell() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) --- Testing ftell() with more than expected number of arguments -- - -Warning: ftell() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) --- Testing ftell() with invalid arguments -- --- Iteration 1 -- - -Warning: ftell() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: ftell() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: ftell() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: ftell() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: ftell() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: ftell() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing ftell with closed/unset file handle -- Warning: ftell(): supplied resource is not a valid stream resource in %s on line %d bool(false) - -Warning: ftell() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index 0b94bcffc7907..edbb9e22f2e57 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -14,82 +14,18 @@ Test fseek(), ftell() & rewind() functions : error conditions - rewind() */ echo "*** Testing rewind() : error conditions ***\n"; -// zero argument -echo "-- Testing rewind() with zero argument --\n"; -var_dump( rewind() ); - -// more than expected no. of args -echo "-- Testing rewind() with more than expected number of arguments --\n"; -$fp = fopen(__FILE__, "r"); -var_dump( rewind($fp, 10) ); - -// test invalid arguments : non-resources -echo "-- Testing rewind() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test rewind with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( rewind($invalid_args[$loop_counter - 1]) ); -} // rewind on a file handle which is already closed echo "-- Testing rewind() with closed/unset file handle --"; +$fp = fopen(__FILE__, "r"); fclose($fp); var_dump(rewind($fp)); -// rewind on a file handle which is unset -$file_handle = fopen(__FILE__, "r"); -unset($file_handle); //unset file handle -var_dump( rewind(@$file_handle) ); - echo "Done\n"; ?> --EXPECTF-- *** Testing rewind() : error conditions *** --- Testing rewind() with zero argument -- - -Warning: rewind() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) --- Testing rewind() with more than expected number of arguments -- - -Warning: rewind() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) --- Testing rewind() with invalid arguments -- --- Iteration 1 -- - -Warning: rewind() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: rewind() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: rewind() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: rewind() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: rewind() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: rewind() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing rewind() with closed/unset file handle -- Warning: rewind(): supplied resource is not a valid stream resource in %s on line %d bool(false) - -Warning: rewind() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index 3cb6db27f834f..ecbdeddf066fc 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -15,38 +15,6 @@ fwrite($file_handle, "Testing ftruncate error conditions \n"); fflush($file_handle); echo "\n Initial file size = ".filesize($filename)."\n"; -echo "-- Testing ftruncate() with less than expected number of arguments --\n"; - -// zero arguments -var_dump( ftruncate() ); - -// arguments less than expected numbers -var_dump( ftruncate( $file_handle ) ); -// check the first size -var_dump( filesize($filename) ); - -echo "-- Testing ftruncate() with more than expected number of arguments --\n"; -// more than expected number of arguments -var_dump( ftruncate($file_handle, 10, 20) ); -// check the first size -var_dump( filesize($filename) ); - -// test invalid arguments : non-resources -echo "-- Testing ftruncate() with invalid file pointer --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test ftruncate() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( ftruncate($invalid_args[$loop_counter - 1], 10) ); -} - // ftruncate() on a file handle which is already closed/unset echo "-- Testing ftruncate() with closed/unset file handle --\n"; @@ -56,13 +24,6 @@ var_dump( ftruncate($file_handle,10) ); // check the first size var_dump( filesize($filename) ); -// ftruncate on a file handle which is unset -$fp = fopen($filename, "w"); -unset($fp); //unset file handle -var_dump( ftruncate(@$fp,10)); -// check the first size -var_dump( filesize($filename) ); - echo "Done\n"; ?> --CLEAN-- @@ -74,51 +35,9 @@ unlink( $filename ); *** Testing ftruncate() : error conditions *** Initial file size = 36 --- Testing ftruncate() with less than expected number of arguments -- - -Warning: ftruncate() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: ftruncate() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) -int(36) --- Testing ftruncate() with more than expected number of arguments -- - -Warning: ftruncate() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) -int(36) --- Testing ftruncate() with invalid file pointer -- --- Iteration 1 -- - -Warning: ftruncate() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: ftruncate() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: ftruncate() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: ftruncate() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: ftruncate() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: ftruncate() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing ftruncate() with closed/unset file handle -- Warning: ftruncate(): supplied resource is not a valid stream resource in %s on line %d bool(false) int(36) - -Warning: ftruncate() expects parameter 1 to be resource, null given in %s on line %d -bool(false) -int(36) Done diff --git a/ext/standard/tests/file/fwrite.phpt b/ext/standard/tests/file/fwrite.phpt index 443710b99d042..195d3afe771f7 100644 --- a/ext/standard/tests/file/fwrite.phpt +++ b/ext/standard/tests/file/fwrite.phpt @@ -6,8 +6,7 @@ fwrite() tests $filename = dirname(__FILE__)."/fwrite.dat"; $fp = fopen($filename, "w"); -var_dump(fwrite($fp)); -var_dump(fwrite($fp, array())); +var_dump(fwrite($fp, "")); fclose($fp); $fp = fopen($filename, "r"); @@ -20,33 +19,16 @@ fclose($fp); var_dump(fwrite($fp, "data", -1)); -var_dump(fwrite(array(), "data", -1)); -var_dump(fwrite(array(), "data")); -var_dump(fwrite(array())); - var_dump(file_get_contents($filename)); @unlink($filename); echo "Done\n"; ?> --EXPECTF-- -Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d -bool(false) - -Warning: fwrite() expects parameter 2 to be string, array given in %s on line %d -bool(false) +int(0) int(0) int(0) int(4) int(0) - -Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d -bool(false) - -Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d -bool(false) - -Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d -bool(false) string(4) "data" Done diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt index f4f691be35322..a52d2dd0037c1 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -16,18 +16,8 @@ include ("file.inc"); echo "*** Testing fwrite() : error conditions ***\n"; $filename = dirname(__FILE__)."/fwrite_error.tmp"; - -echo "-- Testing fwrite() with less than expected number of arguments --\n"; -// zero argument -var_dump( fwrite() ); -// less than expected, 1 arg $file_handle = fopen ( $filename, "w"); -var_dump( fwrite($file_handle) ); - -// more than expected no. of args -echo "-- Testing fwrite() with more than expected number of arguments --\n"; $data = "data"; -var_dump( fwrite($file_handle, $data, strlen($data), 10) ); // invalid length argument echo "-- Testing fwrite() with invalid length arguments --\n"; @@ -36,32 +26,11 @@ var_dump( fwrite($file_handle, $data, $len) ); $len = -10; var_dump( fwrite($file_handle, $data, $len) ); -// test invalid arguments : non-resources -echo "-- Testing fwrite() with invalid arguments --\n"; -$invalid_args = array ( - "string", - 10, - 10.5, - true, - array(1,2,3), - new stdclass, -); -/* loop to test fwrite() with different invalid type of args */ -for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++) { - echo "-- Iteration $loop_counter --\n"; - var_dump( fwrite($invalid_args[$loop_counter - 1], 10) ); -} - // fwrite() on a file handle which is already closed echo "-- Testing fwrite() with closed/unset file handle --\n"; fclose($file_handle); var_dump(fwrite($file_handle,"data")); -// fwrite on a file handle which is unset -$fp = fopen($filename, "w"); -unset($fp); //unset file handle -var_dump( fwrite(@$fp,"data")); - echo "Done\n"; ?> --CLEAN-- @@ -71,50 +40,11 @@ unlink( $filename ); ?> --EXPECTF-- *** Testing fwrite() : error conditions *** --- Testing fwrite() with less than expected number of arguments -- - -Warning: fwrite() expects at least 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d -bool(false) --- Testing fwrite() with more than expected number of arguments -- - -Warning: fwrite() expects at most 3 parameters, 4 given in %s on line %d -bool(false) -- Testing fwrite() with invalid length arguments -- int(0) int(0) --- Testing fwrite() with invalid arguments -- --- Iteration 1 -- - -Warning: fwrite() expects parameter 1 to be resource, string given in %s on line %d -bool(false) --- Iteration 2 -- - -Warning: fwrite() expects parameter 1 to be resource, int given in %s on line %d -bool(false) --- Iteration 3 -- - -Warning: fwrite() expects parameter 1 to be resource, float given in %s on line %d -bool(false) --- Iteration 4 -- - -Warning: fwrite() expects parameter 1 to be resource, bool given in %s on line %d -bool(false) --- Iteration 5 -- - -Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d -bool(false) --- Iteration 6 -- - -Warning: fwrite() expects parameter 1 to be resource, object given in %s on line %d -bool(false) -- Testing fwrite() with closed/unset file handle -- Warning: fwrite(): supplied resource is not a valid stream resource in %s on line %d bool(false) - -Warning: fwrite() expects parameter 1 to be resource, null given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/file/get_current_user.phpt b/ext/standard/tests/file/get_current_user.phpt index f23d2fabef58d..04938e3d6b57f 100644 --- a/ext/standard/tests/file/get_current_user.phpt +++ b/ext/standard/tests/file/get_current_user.phpt @@ -3,13 +3,10 @@ get_current_user() tests --FILE-- --EXPECTF-- -Warning: get_current_user() expects exactly 0 parameters, 1 given in %s on line %d -NULL string(%d) %s Done diff --git a/ext/standard/tests/file/glob_variation-win32-mb.phpt b/ext/standard/tests/file/glob_variation-win32-mb.phpt index cba2e2b34374d..8d1ae00c3447a 100644 --- a/ext/standard/tests/file/glob_variation-win32-mb.phpt +++ b/ext/standard/tests/file/glob_variation-win32-mb.phpt @@ -46,12 +46,16 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "\n-- Iteration $counter --\n"; - var_dump( glob($pattern) ); // default arguments - var_dump( glob($pattern, GLOB_MARK) ); - var_dump( glob($pattern, GLOB_NOSORT) ); - var_dump( glob($pattern, GLOB_NOCHECK) ); - var_dump( glob($pattern, GLOB_NOESCAPE) ); - var_dump( glob($pattern, GLOB_ERR) ); + try { + var_dump( glob($pattern) ); // default arguments + var_dump( glob($pattern, GLOB_MARK) ); + var_dump( glob($pattern, GLOB_NOSORT) ); + var_dump( glob($pattern, GLOB_NOCHECK) ); + var_dump( glob($pattern, GLOB_NOESCAPE) ); + var_dump( glob($pattern, GLOB_ERR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -73,7 +77,11 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; - var_dump( glob($pattern, GLOB_ONLYDIR) ); + try { + var_dump( glob($pattern, GLOB_ONLYDIR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -326,24 +334,7 @@ array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32-mb.php on line %d -NULL +glob() expects parameter 1 to be a valid path, string given -- Iteration 9 -- array(0) { @@ -446,9 +437,7 @@ array(1) { array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %sglob_variation-win32-mb.php on line %d -NULL +glob() expects parameter 1 to be a valid path, string given -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/glob_variation-win32.phpt b/ext/standard/tests/file/glob_variation-win32.phpt index 5027ac03e634d..2706377d8c743 100644 --- a/ext/standard/tests/file/glob_variation-win32.phpt +++ b/ext/standard/tests/file/glob_variation-win32.phpt @@ -45,12 +45,16 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "\n-- Iteration $counter --\n"; - var_dump( glob($pattern) ); // default arguments - var_dump( glob($pattern, GLOB_MARK) ); - var_dump( glob($pattern, GLOB_NOSORT) ); - var_dump( glob($pattern, GLOB_NOCHECK) ); - var_dump( glob($pattern, GLOB_NOESCAPE) ); - var_dump( glob($pattern, GLOB_ERR) ); + try { + var_dump( glob($pattern) ); // default arguments + var_dump( glob($pattern, GLOB_MARK) ); + var_dump( glob($pattern, GLOB_NOSORT) ); + var_dump( glob($pattern, GLOB_NOCHECK) ); + var_dump( glob($pattern, GLOB_NOESCAPE) ); + var_dump( glob($pattern, GLOB_ERR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -72,7 +76,11 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; - var_dump( glob($pattern, GLOB_ONLYDIR) ); + try { + var_dump( glob($pattern, GLOB_ONLYDIR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -325,24 +333,7 @@ array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given %sglob_variation-win32.php on line %d -NULL +glob() expects parameter 1 to be a valid path, string given -- Iteration 9 -- array(0) { @@ -445,9 +436,7 @@ array(1) { array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %sglob_variation-win32.php on line %d -NULL +glob() expects parameter 1 to be a valid path, string given -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/glob_variation.phpt b/ext/standard/tests/file/glob_variation.phpt index 9d3b879379413..3c20a49b31944 100644 --- a/ext/standard/tests/file/glob_variation.phpt +++ b/ext/standard/tests/file/glob_variation.phpt @@ -48,12 +48,16 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "\n-- Iteration $counter --\n"; - var_dump( glob($pattern) ); // default arguments - var_dump( glob($pattern, GLOB_MARK) ); - var_dump( glob($pattern, GLOB_NOSORT) ); - var_dump( glob($pattern, GLOB_NOCHECK) ); - var_dump( glob($pattern, GLOB_NOESCAPE) ); - var_dump( glob($pattern, GLOB_ERR) ); + try { + var_dump( glob($pattern) ); // default arguments + var_dump( glob($pattern, GLOB_MARK) ); + var_dump( glob($pattern, GLOB_NOSORT) ); + var_dump( glob($pattern, GLOB_NOCHECK) ); + var_dump( glob($pattern, GLOB_NOESCAPE) ); + var_dump( glob($pattern, GLOB_ERR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -75,7 +79,11 @@ $counter = 1; using glob() */ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; - var_dump( glob($pattern, GLOB_ONLYDIR) ); + try { + var_dump( glob($pattern, GLOB_ONLYDIR) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; } @@ -328,24 +336,7 @@ array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +glob() expects parameter 1 to be a valid path, string given -- Iteration 9 -- array(0) { @@ -448,9 +439,7 @@ array(1) { array(0) { } -- Iteration 8 -- - -Warning: glob() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +glob() expects parameter 1 to be a valid path, string given -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/is_dir_variation3.phpt b/ext/standard/tests/file/is_dir_variation3.phpt index c1664165ebd69..060739ff3decb 100644 --- a/ext/standard/tests/file/is_dir_variation3.phpt +++ b/ext/standard/tests/file/is_dir_variation3.phpt @@ -9,8 +9,6 @@ Test is_dir() function: usage variations - invalid arguments /* Passing invalid arguments to is_dir() */ -$dir_handle = opendir( dirname(__FILE__) ); - echo "*** Testing is_dir() with Invalid arguments: expected bool(false) ***\n"; $dirnames = array( /* Invalid dirnames */ @@ -19,7 +17,6 @@ $dirnames = array( FALSE, NULL, " ", - $dir_handle, /* scalars */ 0, @@ -30,7 +27,6 @@ $dirnames = array( foreach($dirnames as $dirname) { var_dump( is_dir($dirname) ); } -closedir($dir_handle); echo "\n*** Done ***"; ?> @@ -41,9 +37,6 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_dir() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL bool(false) bool(false) diff --git a/ext/standard/tests/file/is_dir_variation4.phpt b/ext/standard/tests/file/is_dir_variation4.phpt index 5c0be485c56aa..3c3d0852ef50d 100644 --- a/ext/standard/tests/file/is_dir_variation4.phpt +++ b/ext/standard/tests/file/is_dir_variation4.phpt @@ -38,7 +38,11 @@ $count = 1; /* loop through to test each element the above array */ foreach($dirs_arr as $dir) { echo "\n-- Iteration $count --\n"; - var_dump( is_dir($file_path."/".$dir ) ); + try { + var_dump( is_dir($file_path."/".$dir ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count++; } @@ -77,13 +81,9 @@ bool(true) bool(false) -- Iteration 9 -- - -Warning: is_dir() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_dir() expects parameter 1 to be a valid path, string given -- Iteration 10 -- - -Warning: is_dir() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_dir() expects parameter 1 to be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/is_executable_error.phpt b/ext/standard/tests/file/is_executable_error.phpt index 4fb3dbaf5f7ac..e4b43095e3f07 100644 --- a/ext/standard/tests/file/is_executable_error.phpt +++ b/ext/standard/tests/file/is_executable_error.phpt @@ -6,24 +6,11 @@ Test is_executable() function: error conditions Description: Tells whether the filename is executable */ -echo "*** Testing is_executable(): error conditions ***\n"; -var_dump( is_executable() ); // args < expected no of arguments - -var_dump( is_executable(1, 2) ); // args > expected no. of arguments - echo "\n*** Testing is_exceutable() on non-existent directory ***\n"; var_dump( is_executable(dirname(__FILE__)."/is_executable") ); echo "Done\n"; --EXPECTF-- -*** Testing is_executable(): error conditions *** - -Warning: is_executable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_executable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing is_exceutable() on non-existent directory *** bool(false) Done diff --git a/ext/standard/tests/file/is_executable_variation1.phpt b/ext/standard/tests/file/is_executable_variation1.phpt index 1cd0a8d209ec6..784685705b8f7 100644 --- a/ext/standard/tests/file/is_executable_variation1.phpt +++ b/ext/standard/tests/file/is_executable_variation1.phpt @@ -51,7 +51,11 @@ $counter = 1; is an executable file */ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; - var_dump( is_executable($file) ); + try { + var_dump( is_executable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; clearstatcache(); } @@ -76,13 +80,9 @@ bool(false) -- Iteration 5 -- bool(false) -- Iteration 6 -- - -Warning: is_executable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_executable() expects parameter 1 to be a valid path, string given -- Iteration 7 -- - -Warning: is_executable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_executable() expects parameter 1 to be a valid path, string given -- Iteration 8 -- bool(false) -- Iteration 9 -- diff --git a/ext/standard/tests/file/is_executable_variation3.phpt b/ext/standard/tests/file/is_executable_variation3.phpt index a804f66eb2b3b..637bbacd67006 100644 --- a/ext/standard/tests/file/is_executable_variation3.phpt +++ b/ext/standard/tests/file/is_executable_variation3.phpt @@ -38,7 +38,6 @@ $invalid_files = array( FALSE, NULL, " ", - @array(), @$file_handle ); /* loop through to test each element in the above array @@ -61,8 +60,5 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_executable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL bool(false) Done diff --git a/ext/standard/tests/file/is_file_variation3.phpt b/ext/standard/tests/file/is_file_variation3.phpt index ec7037141760c..1b94594faa517 100644 --- a/ext/standard/tests/file/is_file_variation3.phpt +++ b/ext/standard/tests/file/is_file_variation3.phpt @@ -21,7 +21,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -50,9 +49,6 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_file() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL bool(false) bool(false) diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt index 505331d2c94c7..689ae1098f818 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -38,7 +38,11 @@ $count = 1; /* loop through to test each element in the above array */ foreach($files_arr as $file) { echo "- Iteration $count -\n"; - var_dump( is_file( $file_path."/".$file ) ); + try { + var_dump( is_file( $file_path."/".$file ) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } clearstatcache(); $count++; } @@ -67,12 +71,8 @@ bool(false) - Iteration 6 - bool(false) - Iteration 7 - - -Warning: is_file() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_file() expects parameter 1 to be a valid path, string given - Iteration 8 - - -Warning: is_file() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_file() expects parameter 1 to be a valid path, string given *** Done *** diff --git a/ext/standard/tests/file/is_readable_error.phpt b/ext/standard/tests/file/is_readable_error.phpt index 9a734cd14d310..8a4b507b6f3c5 100644 --- a/ext/standard/tests/file/is_readable_error.phpt +++ b/ext/standard/tests/file/is_readable_error.phpt @@ -6,24 +6,12 @@ Test is_readable() function: error conditions Description: Tells whether the filename is readable */ -echo "*** Testing is_readable(): error conditions ***\n"; -var_dump( is_readable() ); // args < expected -var_dump( is_readable(1, 2) ); // args > expected - echo "\n*** Testing is_readable() on non-existent file ***\n"; var_dump( is_readable(dirname(__FILE__)."/is_readable.tmp") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing is_readable(): error conditions *** - -Warning: is_readable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_readable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing is_readable() on non-existent file *** bool(false) Done diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt index 0ba2324f9a263..b6570fb9111db 100644 --- a/ext/standard/tests/file/is_readable_variation1.phpt +++ b/ext/standard/tests/file/is_readable_variation1.phpt @@ -60,7 +60,11 @@ $counter = 1; is a writable file */ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; - var_dump( is_readable($file) ); + try { + var_dump( is_readable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; clearstatcache(); } @@ -87,17 +91,11 @@ bool(false) -- Iteration 6 -- bool(false) -- Iteration 7 -- - -Warning: is_readable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_readable() expects parameter 1 to be a valid path, string given -- Iteration 8 -- - -Warning: is_readable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_readable() expects parameter 1 to be a valid path, string given -- Iteration 9 -- - -Warning: is_readable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_readable() expects parameter 1 to be a valid path, string given -- Iteration 10 -- bool(true) -- Iteration 11 -- diff --git a/ext/standard/tests/file/is_readable_variation3.phpt b/ext/standard/tests/file/is_readable_variation3.phpt index 74fc7af57487e..48b4e3038669c 100644 --- a/ext/standard/tests/file/is_readable_variation3.phpt +++ b/ext/standard/tests/file/is_readable_variation3.phpt @@ -37,7 +37,6 @@ $misc_files = array( FALSE, NULL, " ", - @array(), @$file_handle ); /* loop through to test each element in the above array @@ -60,8 +59,5 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_readable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL bool(false) Done diff --git a/ext/standard/tests/file/is_uploaded_file_basic.phpt b/ext/standard/tests/file/is_uploaded_file_basic.phpt index 1721935549b5c..d053244a798c8 100644 --- a/ext/standard/tests/file/is_uploaded_file_basic.phpt +++ b/ext/standard/tests/file/is_uploaded_file_basic.phpt @@ -29,19 +29,9 @@ var_dump(is_uploaded_file('random_filename.txt')); // not an uploaded file var_dump(is_uploaded_file('__FILE__')); -// Error cases -var_dump(is_uploaded_file()); -var_dump(is_uploaded_file('a', 'b')); - ?> --EXPECTF-- bool(true) bool(false) bool(false) bool(false) - -Warning: is_uploaded_file() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_uploaded_file() expects exactly 1 parameter, 2 given in %s on line %d -NULL diff --git a/ext/standard/tests/file/is_writable_error.phpt b/ext/standard/tests/file/is_writable_error.phpt index e3755bc748d95..e1641e0e9f3a1 100644 --- a/ext/standard/tests/file/is_writable_error.phpt +++ b/ext/standard/tests/file/is_writable_error.phpt @@ -8,14 +8,6 @@ Test is_writable() and its alias is_writeable() function: error conditions is_writeable() is an alias of is_writable() */ -echo "*** Testing is_writable(): error conditions ***\n"; -var_dump( is_writable() ); // args < expected -var_dump( is_writeable() ); - -echo "\n*** Testing is_writeable(): error conditions ***\n"; -var_dump( is_writable(1, 2) ); // args > expected -var_dump( is_writeable(1, 2) ); - echo "\n*** Testing is_writable() on non-existent file ***\n"; var_dump( is_writable(dirname(__FILE__)."/is_writable") ); var_dump( is_writeable(dirname(__FILE__)."/is_writable") ); @@ -23,22 +15,6 @@ var_dump( is_writeable(dirname(__FILE__)."/is_writable") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing is_writable(): error conditions *** - -Warning: is_writable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_writeable() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -*** Testing is_writeable(): error conditions *** - -Warning: is_writable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: is_writeable() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing is_writable() on non-existent file *** bool(false) bool(false) diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt index f5cdf6a8a0cfc..ec9756fbf138f 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -62,8 +62,16 @@ $counter = 1; is a writable file */ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; - var_dump( is_writable($file) ); - var_dump( is_writeable($file) ); + try { + var_dump( is_writable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( is_writeable($file) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter++; clearstatcache(); } @@ -96,26 +104,14 @@ bool(false) bool(false) bool(false) -- Iteration 7 -- - -Warning: is_writable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_writable() expects parameter 1 to be a valid path, string given +is_writeable() expects parameter 1 to be a valid path, string given -- Iteration 8 -- - -Warning: is_writable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_writable() expects parameter 1 to be a valid path, string given +is_writeable() expects parameter 1 to be a valid path, string given -- Iteration 9 -- - -Warning: is_writable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, string given in %s on line %d -NULL +is_writable() expects parameter 1 to be a valid path, string given +is_writeable() expects parameter 1 to be a valid path, string given -- Iteration 10 -- bool(true) bool(true) diff --git a/ext/standard/tests/file/is_writable_variation3.phpt b/ext/standard/tests/file/is_writable_variation3.phpt index 3cc7a4da9d6c1..d533a2745dfe5 100644 --- a/ext/standard/tests/file/is_writable_variation3.phpt +++ b/ext/standard/tests/file/is_writable_variation3.phpt @@ -35,7 +35,6 @@ $misc_files = array( FALSE, NULL, " ", - @array(), @$file_handle ); /* loop through to test each element in the above array @@ -66,12 +65,6 @@ bool(false) bool(false) bool(false) bool(false) - -Warning: is_writable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL - -Warning: is_writeable() expects parameter 1 to be a valid path, array given in %s on line %d -NULL bool(false) bool(false) Done diff --git a/ext/standard/tests/file/lchown_error.phpt b/ext/standard/tests/file/lchown_error.phpt index f4b4f5089e2df..18e0407fdc965 100644 --- a/ext/standard/tests/file/lchown_error.phpt +++ b/ext/standard/tests/file/lchown_error.phpt @@ -29,20 +29,9 @@ $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lchown.txt'; touch( $filename ); $uid = posix_getuid(); - -// Less than expected arguments -var_dump( lchown( $filename ) ); - -// More than expected arguments -var_dump( lchown( $filename, $uid, 'foobar' ) ); - // Non-existent filename var_dump( lchown( 'foobar_lchown.txt', $uid ) ); -// Wrong argument types -var_dump( lchown( new StdClass(), $uid ) ); -var_dump( lchown( array(), $uid ) ); - // Bad user var_dump( lchown( $filename, -5 ) ); @@ -58,21 +47,9 @@ unlink($filename); --EXPECTF-- *** Testing lchown() : error functionality *** -Warning: lchown() expects exactly 2 parameters, 1 given in %s on line %d -bool(true) - -Warning: lchown() expects exactly 2 parameters, 3 given in %s on line %d -bool(true) - Warning: lchown(): No such file or directory in %s on line %d bool(false) -Warning: lchown() expects parameter 1 to be a valid path, object given in %s on line %d -bool(true) - -Warning: lchown() expects parameter 1 to be a valid path, array given in %s on line %d -bool(true) - Warning: lchown(): %r(Operation not permitted|Invalid argument)%r in %s on line %d bool(false) ===DONE=== diff --git a/ext/standard/tests/file/lstat_stat_error.phpt b/ext/standard/tests/file/lstat_stat_error.phpt index 8f290a32e3d3d..e6fccd5acce98 100644 --- a/ext/standard/tests/file/lstat_stat_error.phpt +++ b/ext/standard/tests/file/lstat_stat_error.phpt @@ -17,54 +17,28 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { echo "*** Testing lstat() for error conditions ***\n"; $file_path = dirname(__FILE__); -var_dump( lstat() ); // args < expected -var_dump( lstat(__FILE__, 2) ); // args > expected var_dump( lstat("$file_path/temp.tmp") ); // non existing file var_dump( lstat(22) ); // scalar argument -$arr = array(__FILE__); -var_dump( lstat($arr) ); // array argument echo "\n*** Testing stat() for error conditions ***\n"; -var_dump( stat() ); // args < expected -var_dump( stat(__FILE__, 2) ); // file, args > expected -var_dump( stat(dirname(__FILE__), 2) ); //dir, args > expected var_dump( stat("$file_path/temp.tmp") ); // non existing file var_dump( stat("$file_path/temp/") ); // non existing dir var_dump( stat(22) ); // scalar argument -var_dump( stat($arr) ); // array argument echo "Done\n"; ?> --EXPECTF-- *** Testing lstat() for error conditions *** -Warning: lstat() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: lstat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: lstat(): Lstat failed for %s in %s on line %d bool(false) Warning: lstat(): Lstat failed for 22 in %s on line %d bool(false) -Warning: lstat() expects parameter 1 to be a valid path, array given in %s on line %d -NULL - *** Testing stat() for error conditions *** -Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: stat(): stat failed for %s in %s on line %d bool(false) @@ -73,7 +47,4 @@ bool(false) Warning: stat(): stat failed for 22 in %s on line %d bool(false) - -Warning: stat() expects parameter 1 to be a valid path, array given in %s on line %d -NULL Done diff --git a/ext/standard/tests/file/mkdir_rmdir_error.phpt b/ext/standard/tests/file/mkdir_rmdir_error.phpt index 17f908c3f6e33..be0b434c2c4c0 100644 --- a/ext/standard/tests/file/mkdir_rmdir_error.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_error.phpt @@ -9,48 +9,12 @@ Test mkdir() and rmdir() functions : error conditions Description: Removes directory */ -echo "*** Testing mkdir(): error conditions ***\n"; -var_dump( mkdir() ); // args < expected -var_dump( mkdir(1, 2, 3, 4, 5) ); // args > expected -var_dump( mkdir("testdir", 0777, false, $context, "test") ); // args > expected - -echo "\n*** Testing rmdir(): error conditions ***\n"; -var_dump( rmdir() ); // args < expected -var_dump( rmdir(1, 2, 3) ); // args > expected -var_dump( rmdir("testdir", $context, "test") ); // args > expected - echo "\n*** Testing rmdir() on non-existent directory ***\n"; var_dump( rmdir("temp") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing mkdir(): error conditions *** - -Warning: mkdir() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d -bool(false) - -Notice: Undefined variable: context in %s on line %d - -Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d -bool(false) - -*** Testing rmdir(): error conditions *** - -Warning: rmdir() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - -Notice: Undefined variable: context in %s on line %d - -Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - *** Testing rmdir() on non-existent directory *** Warning: rmdir(temp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt index 24dfc96ac9234..0af10551783ec 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -35,8 +35,16 @@ var_dump( mkdir("$file_path/mkdir_variation2/test/", 0777, true) ); var_dump( rmdir("$file_path/mkdir_variation2/") ); echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n"; -var_dump( mkdir("$file_path/temp".chr(0)."/") ); -var_dump( rmdir("$file_path/temp".chr(0)."/") ); +try { + var_dump( mkdir("$file_path/temp".chr(0)."/") ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump( rmdir("$file_path/temp".chr(0)."/") ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "\n*** Testing mkdir() with miscelleneous input ***\n"; /* changing mode of mkdir to prevent creating sub-directory under it */ @@ -64,12 +72,8 @@ Warning: rmdir(%s/mkdir_variation2/): %s on line %d bool(false) *** Testing mkdir() and rmdir() for binary safe functionality *** - -Warning: mkdir() expects parameter 1 to be a valid path, string given in %s on line %d -bool(false) - -Warning: rmdir() expects parameter 1 to be a valid path, string given in %s on line %d -bool(false) +mkdir() expects parameter 1 to be a valid path, string given +rmdir() expects parameter 1 to be a valid path, string given *** Testing mkdir() with miscelleneous input *** bool(true) diff --git a/ext/standard/tests/file/move_uploaded_file_basic.phpt b/ext/standard/tests/file/move_uploaded_file_basic.phpt index c6cfdd3203f9c..7af8748fe292e 100644 --- a/ext/standard/tests/file/move_uploaded_file_basic.phpt +++ b/ext/standard/tests/file/move_uploaded_file_basic.phpt @@ -49,11 +49,6 @@ fclose($fd); var_dump(move_uploaded_file($_FILES['file2']['tmp_name'], $destination4)); unlink($destination4); -echo "Wrong parameters\n"; -var_dump(move_uploaded_file()); -var_dump(move_uploaded_file(1, 2, 3)); - - ?> --EXPECTF-- Valid move @@ -66,10 +61,3 @@ Non-uploaded source file bool(false) Valid move to existing file bool(true) -Wrong parameters - -Warning: move_uploaded_file() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: move_uploaded_file() expects exactly 2 parameters, 3 given in %s on line %d -NULL diff --git a/ext/standard/tests/file/parse_ini_file_error.phpt b/ext/standard/tests/file/parse_ini_file_error.phpt index 29e022fb13b2e..5c812d7b9aca9 100644 --- a/ext/standard/tests/file/parse_ini_file_error.phpt +++ b/ext/standard/tests/file/parse_ini_file_error.phpt @@ -10,10 +10,6 @@ Test parse_ini_file() function : error conditions echo "*** Testing parse_ini_file() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing parse_ini_file() function with Zero arguments --\n"; -var_dump( parse_ini_file() ); - //Test parse_ini_file with one more than the expected number of arguments echo "\n-- Testing parse_ini_file() function with more than expected no. of arguments --\n"; $filename = 'string_val'; @@ -30,11 +26,6 @@ echo "Done"; --EXPECTF-- *** Testing parse_ini_file() : error conditions *** --- Testing parse_ini_file() function with Zero arguments -- - -Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -- Testing parse_ini_file() function with more than expected no. of arguments -- Warning: parse_ini_file(%s): failed to open stream: No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/pathinfo_variaton.phpt b/ext/standard/tests/file/pathinfo_variaton.phpt index 421f378e013d0..6f4492e375a4c 100644 --- a/ext/standard/tests/file/pathinfo_variaton.phpt +++ b/ext/standard/tests/file/pathinfo_variaton.phpt @@ -43,9 +43,6 @@ $paths = array ( "./array(1, 2)", "array( array(), null)", - /* pathname as object */ - $obj, - /* pathname as spaces */ " ", ' ', @@ -199,22 +196,6 @@ string(21) "array( array(), null)" string(0) "" string(21) "array( array(), null)" -- Iteration 9 -- - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: pathinfo() expects parameter 1 to be string, object given in %s on line %d -NULL --- Iteration 10 -- array(3) { ["dirname"]=> string(1) "." @@ -227,7 +208,7 @@ string(1) "." string(1) " " string(0) "" string(1) " " --- Iteration 11 -- +-- Iteration 10 -- array(3) { ["dirname"]=> string(1) "." @@ -240,7 +221,7 @@ string(1) "." string(1) " " string(0) "" string(1) " " --- Iteration 12 -- +-- Iteration 11 -- array(2) { ["basename"]=> string(0) "" @@ -251,7 +232,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 13 -- +-- Iteration 12 -- array(2) { ["basename"]=> string(0) "" @@ -262,7 +243,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 14 -- +-- Iteration 13 -- array(2) { ["basename"]=> string(0) "" @@ -273,7 +254,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 15 -- +-- Iteration 14 -- array(2) { ["basename"]=> string(0) "" @@ -284,7 +265,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 16 -- +-- Iteration 15 -- array(2) { ["basename"]=> string(0) "" @@ -295,7 +276,7 @@ string(0) "" string(0) "" string(0) "" string(0) "" --- Iteration 17 -- +-- Iteration 16 -- array(4) { ["dirname"]=> string(1) "." @@ -310,7 +291,7 @@ string(1) "." string(11) "www.foo.com" string(3) "com" string(7) "www.foo" --- Iteration 18 -- +-- Iteration 17 -- array(4) { ["dirname"]=> string(17) "/var/html/testdir" @@ -325,7 +306,7 @@ string(17) "/var/html/testdir" string(12) "example.html" string(4) "html" string(7) "example" --- Iteration 19 -- +-- Iteration 18 -- array(3) { ["dirname"]=> string(12) "/testdir/foo" @@ -338,7 +319,7 @@ string(12) "/testdir/foo" string(4) "test" string(0) "" string(4) "test" --- Iteration 20 -- +-- Iteration 19 -- array(4) { ["dirname"]=> string(4) "/foo" @@ -353,7 +334,7 @@ string(4) "/foo" string(12) "symlink.link" string(4) "link" string(7) "symlink" --- Iteration 21 -- +-- Iteration 20 -- array(3) { ["dirname"]=> string(1) "." @@ -366,7 +347,7 @@ string(1) "." string(5) "12345" string(0) "" string(5) "12345" --- Iteration 22 -- +-- Iteration 21 -- array(4) { ["dirname"]=> string(1) "." @@ -381,7 +362,7 @@ string(1) "." string(15) "www.example.com" string(3) "com" string(11) "www.example" --- Iteration 23 -- +-- Iteration 22 -- array(3) { ["dirname"]=> string(12) "/testdir/foo" @@ -394,7 +375,7 @@ string(12) "/testdir/foo" string(4) "test" string(0) "" string(4) "test" --- Iteration 24 -- +-- Iteration 23 -- array(4) { ["dirname"]=> string(6) "../foo" @@ -409,7 +390,7 @@ string(6) "../foo" string(9) "test.link" string(4) "link" string(4) "test" --- Iteration 25 -- +-- Iteration 24 -- array(4) { ["dirname"]=> string(76) "./test/work/scratch/mydir/yourdir/ourdir/test1/test2/test3/test4/test5/test6" @@ -424,7 +405,7 @@ string(76) "./test/work/scratch/mydir/yourdir/ourdir/test1/test2/test3/test4/tes string(8) "test.tmp" string(3) "tmp" string(4) "test" --- Iteration 26 -- +-- Iteration 25 -- array(4) { ["dirname"]=> string(1) "." diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt index 93ed5d946e6ff..22fe309741852 100644 --- a/ext/standard/tests/file/popen_pclose_error.phpt +++ b/ext/standard/tests/file/popen_pclose_error.phpt @@ -16,14 +16,9 @@ if (strtoupper( substr(PHP_OS, 0, 3) ) == 'SUN') */ $file_path = dirname(__FILE__); echo "*** Testing for error conditions ***\n"; -var_dump( popen() ); // Zero Arguments -var_dump( popen("abc.txt") ); // Single Argument var_dump( popen("abc.txt", "rw") ); // Invalid mode Argument -var_dump( pclose() ); $file_handle = fopen($file_path."/popen.tmp", "w"); -var_dump( pclose($file_handle, $file_handle) ); fclose($file_handle); -var_dump( pclose(1) ); echo "\n--- Done ---"; ?> --CLEAN-- @@ -34,22 +29,7 @@ unlink($file_path."/popen.tmp"); --EXPECTF-- *** Testing for error conditions *** -Warning: popen() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d -NULL - Warning: popen(abc.txt,rw): %s on line %d bool(false) -Warning: pclose() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: pclose() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: pclose() expects parameter 1 to be resource, int given in %s on line %d -bool(false) - --- Done --- diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt index fcaa7f3946823..c74b63d0d67e1 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -9,17 +9,12 @@ Test readfile() function: error conditions $context = stream_context_create(); echo "*** Test readfile(): error conditions ***\n"; -echo "-- Testing readfile() with unexpected no. of arguments --\n"; -var_dump( readfile() ); // args < expected -var_dump( readfile(__FILE__, true, $context, 4) ); // args > expected echo "\n-- Testing readfile() with invalid arguments --\n"; // invalid arguments var_dump( readfile(NULL) ); // NULL as $filename var_dump( readfile('') ); // empty string as $filename var_dump( readfile(false) ); // boolean false as $filename -var_dump( readfile(__FILE__, false, '') ); // empty string as $context -var_dump( readfile(__FILE__, true, false) ); // boolean false as $context echo "\n-- Testing readfile() with non-existent file --\n"; $non_existent_file = dirname(__FILE__)."/non_existent_file.tmp"; @@ -29,13 +24,6 @@ echo "Done\n"; ?> --EXPECTF-- *** Test readfile(): error conditions *** --- Testing readfile() with unexpected no. of arguments -- - -Warning: readfile() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: readfile() expects at most 3 parameters, 4 given in %s on line %d -bool(false) -- Testing readfile() with invalid arguments -- @@ -48,12 +36,6 @@ bool(false) Warning: readfile(): Filename cannot be empty in %s on line %d bool(false) -Warning: readfile() expects parameter 3 to be resource, string given in %s on line %d -bool(false) - -Warning: readfile() expects parameter 3 to be resource, bool given in %s on line %d -bool(false) - -- Testing readfile() with non-existent file -- Warning: readfile(%s/non_existent_file.tmp): failed to open stream: %s in %s on line %d diff --git a/ext/standard/tests/file/readfile_variation10-win32.phpt b/ext/standard/tests/file/readfile_variation10-win32.phpt index a240a826b967b..04fdafca794ca 100644 --- a/ext/standard/tests/file/readfile_variation10-win32.phpt +++ b/ext/standard/tests/file/readfile_variation10-win32.phpt @@ -36,8 +36,12 @@ $names_arr = array( ); foreach($names_arr as $key => $value) { - echo "\n-- Filename: $key --\n"; - readfile($value); + echo "\n-- Filename: $key --\n"; + try { + readfile($value); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } }; ?> @@ -70,12 +74,10 @@ Warning: readfile(): Filename cannot be empty in %s on line %d Warning: readfile( ): failed to open stream: Permission denied in %s on line %d -- Filename: \0 -- - -Warning: readfile() expects parameter 1 to be a valid path, string given in %s on line %d +readfile() expects parameter 1 to be a valid path, string given -- Filename: array() -- - -Warning: readfile() expects parameter 1 to be a valid path, array given in %s on line %d +readfile() expects parameter 1 to be a valid path, array given -- Filename: /no/such/file/dir -- diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt index 59b92ad365827..5a0070c04fb16 100644 Binary files a/ext/standard/tests/file/readfile_variation10.phpt and b/ext/standard/tests/file/readfile_variation10.phpt differ diff --git a/ext/standard/tests/file/readlink_realpath_error.phpt b/ext/standard/tests/file/readlink_realpath_error.phpt index dc042bfff592c..f7fd340aabbf4 100644 --- a/ext/standard/tests/file/readlink_realpath_error.phpt +++ b/ext/standard/tests/file/readlink_realpath_error.phpt @@ -15,10 +15,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { Description: Returns canonicalized absolute pathname */ -echo "*** Testing readlink(): error conditions ***\n"; -var_dump( readlink() ); // args < expected -var_dump( readlink(__FILE__, 2) ); // args > expected - echo "\n*** Testing readlink() on a non-existent link ***\n"; var_dump( readlink(dirname(__FILE__)."/readlink_error.tmp") ); @@ -28,24 +24,12 @@ var_dump( readlink(__FILE__) ); echo "\n*** Testing readlink() on existing directory ***\n"; var_dump( readlink(dirname(__FILE__)) ); -echo "*** Testing realpath(): error conditions ***\n"; -var_dump( realpath() ); // args < expected -var_dump( realpath(1, 2) ); // args > expected - echo "\n*** Testing realpath() on a non-existent file ***\n"; var_dump( realpath(dirname(__FILE__)."/realpath_error.tmp") ); echo "Done\n"; ?> --EXPECTF-- -*** Testing readlink(): error conditions *** - -Warning: readlink() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: readlink() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing readlink() on a non-existent link *** Warning: readlink(): No such file or directory in %s on line %d @@ -60,13 +44,6 @@ bool(false) Warning: readlink(): Invalid argument in %s on line %d bool(false) -*** Testing realpath(): error conditions *** - -Warning: realpath() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: realpath() expects exactly 1 parameter, 2 given in %s on line %d -NULL *** Testing realpath() on a non-existent file *** %s diff --git a/ext/standard/tests/file/readlink_variation1.phpt b/ext/standard/tests/file/readlink_variation1.phpt index c350a94c7719d..eef16630d254c 100644 --- a/ext/standard/tests/file/readlink_variation1.phpt +++ b/ext/standard/tests/file/readlink_variation1.phpt @@ -16,7 +16,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { /* Testing readlink() with invalid arguments -int, float, bool, NULL, resource */ $file_path = dirname(__FILE__); -$file_handle = fopen($file_path."/readlink_variation2.tmp", "w"); echo "*** Testing Invalid file types ***\n"; $filenames = array( @@ -26,7 +25,6 @@ $filenames = array( TRUE, FALSE, NULL, - $file_handle, /* scalars */ 1234, @@ -38,7 +36,6 @@ foreach( $filenames as $filename ) { var_dump( readlink($filename) ); clearstatcache(); } -fclose($file_handle); echo "\n*** Done ***"; ?> @@ -65,9 +62,6 @@ bool(false) Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink() expects parameter 1 to be a valid path, resource given in %s on line %d -NULL - Warning: readlink(): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/file/realpath_error-win32.phpt b/ext/standard/tests/file/realpath_error-win32.phpt deleted file mode 100644 index 2fd221e45a1ec..0000000000000 --- a/ext/standard/tests/file/realpath_error-win32.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test realpath() function: error conditions ---SKIPIF-- - ---FILE-- - expected - -echo "Done\n"; -?> ---EXPECTF-- -*** Testing realpath() for error conditions *** - -Warning: realpath() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: realpath() expects exactly 1 parameter, 2 given in %s on line %d -NULL -Done diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt index 6319d4ad6192f..977746a21d433 100644 Binary files a/ext/standard/tests/file/rename_variation13-win32.phpt and b/ext/standard/tests/file/rename_variation13-win32.phpt differ diff --git a/ext/standard/tests/file/rename_variation13.phpt b/ext/standard/tests/file/rename_variation13.phpt index 2686150f23c9d..07ee8aa9d8607 100644 --- a/ext/standard/tests/file/rename_variation13.phpt +++ b/ext/standard/tests/file/rename_variation13.phpt @@ -30,8 +30,6 @@ $names_arr = array( NULL, "", " ", - "\0", - array(), /* prefix with path separator of a non existing directory*/ "/no/such/file/dir", @@ -97,24 +95,6 @@ bool(true) Warning: rename( ,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d bool(false) --- testing '%s' -- - -Warning: rename() %s in %s on line %d -bool(false) - -Warning: file_exists() expects parameter 1 to be a valid path, string given in %s on line %d - -Warning: rename() expects parameter 1 to be a valid path, string given in %s on line %d -bool(false) --- testing 'Array' -- - -Warning: rename() expects parameter 2 to be a valid path, array given in %s on line %d -bool(false) - -Warning: file_exists() expects parameter 1 to be a valid path, array given in %s on line %d - -Warning: rename() expects parameter 1 to be a valid path, array given in %s on line %d -bool(false) -- testing '/no/such/file/dir' -- Warning: rename(%s/renameVar13/afile.tmp,/no/such/file/dir): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/stat_error-win32.phpt b/ext/standard/tests/file/stat_error-win32.phpt index 20bffc79df26f..59c4fd6deedb5 100644 --- a/ext/standard/tests/file/stat_error-win32.phpt +++ b/ext/standard/tests/file/stat_error-win32.phpt @@ -17,29 +17,16 @@ $file_path = dirname(__FILE__); $arr = array(__FILE__); echo "\n*** Testing stat() for error conditions ***\n"; -var_dump( stat() ); // args < expected -var_dump( stat(__FILE__, 2) ); // file, args > expected -var_dump( stat(dirname(__FILE__), 2) ); //dir, args > expected var_dump( stat("$file_path/temp.tmp") ); // non existing file var_dump( stat("$file_path/temp/") ); // non existing dir var_dump( stat(22) ); // scalar argument -var_dump( stat($arr) ); // array argument echo "Done\n"; ?> --EXPECTF-- *** Testing stat() for error conditions *** -Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: stat(): stat failed for %s in %s on line %d bool(false) @@ -48,7 +35,4 @@ bool(false) Warning: stat(): stat failed for 22 in %s on line %d bool(false) - -Warning: stat() expects parameter 1 to be a valid path, array given in %s on line %d -NULL Done diff --git a/ext/standard/tests/file/stream_002.phpt b/ext/standard/tests/file/stream_002.phpt index b18dd85b311e2..84f3b78f06329 100644 --- a/ext/standard/tests/file/stream_002.phpt +++ b/ext/standard/tests/file/stream_002.phpt @@ -15,8 +15,6 @@ var_dump(stream_socket_client(".", $a, $b)); var_dump($a, $b); var_dump(stream_socket_client(1, $a, $b)); var_dump($a, $b); -var_dump(stream_socket_client(array(), $a, $b)); -var_dump($a, $b); echo "Done\n"; ?> @@ -45,9 +43,4 @@ Warning: stream_socket_client(): unable to connect to 1 (Failed to parse address bool(false) int(0) string(27) "Failed to parse address "1"" - -Warning: stream_socket_client() expects parameter 1 to be string, array given in %s on line %d -bool(false) -int(0) -string(27) "Failed to parse address "1"" Done diff --git a/ext/standard/tests/file/stream_rfc2397_002.phpt b/ext/standard/tests/file/stream_rfc2397_002.phpt index 1dce5adf6cc74..6c58d0d7ad95d 100644 --- a/ext/standard/tests/file/stream_rfc2397_002.phpt +++ b/ext/standard/tests/file/stream_rfc2397_002.phpt @@ -24,9 +24,11 @@ $streams = array( foreach($streams as $stream) { $stream = fopen($stream, 'r'); - $meta = @stream_get_meta_data($stream); - var_dump($meta); - var_dump(isset($meta['foo']) ? $meta['foo'] : null); + if ($stream) { + $meta = stream_get_meta_data($stream); + var_dump($meta); + var_dump(isset($meta['foo']) ? $meta['foo'] : null); + } } ?> @@ -52,8 +54,6 @@ array(7) { NULL Warning: fopen(data://): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -NULL -NULL array(7) { ["base64"]=> bool(true) @@ -73,16 +73,10 @@ array(7) { NULL Warning: fopen(data://;base64): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -NULL -NULL Warning: fopen(data://foo,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d -NULL -NULL Warning: fopen(data://foo=bar,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d -NULL -NULL array(8) { ["mediatype"]=> string(10) "text/plain" @@ -104,8 +98,6 @@ array(8) { NULL Warning: fopen(data://text/plain;foo,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d -NULL -NULL array(9) { ["mediatype"]=> string(10) "text/plain" @@ -129,8 +121,6 @@ array(9) { string(3) "bar" Warning: fopen(data://text/plain;foo=bar;bla,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d -NULL -NULL array(9) { ["mediatype"]=> string(10) "text/plain" @@ -154,8 +144,6 @@ array(9) { string(3) "bar" Warning: fopen(data://text/plain;foo=bar;bar=baz): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -NULL -NULL array(10) { ["mediatype"]=> string(10) "text/plain" diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt index f6616a0c886a7..18d1c1b2804fc 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -14,18 +14,19 @@ $streams = array( foreach($streams as $stream) { - var_dump(file_get_contents($stream)); + try { + var_dump(file_get_contents($stream)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> ===DONE=== --EXPECTF-- -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s line %d -NULL - -Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s line %d -NULL +file_get_contents() expects parameter 1 to be a valid path, string given +file_get_contents() expects parameter 1 to be a valid path, string given Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhcg==): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt index 7e8b5b24cf8f7..6a1d026a7915f 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -33,11 +33,6 @@ fclose($fp); $linkname = dirname(__FILE__)."/symlink_link_linkinfo_is_link_link_error1.tmp"; echo "*** Testing symlink() for error conditions ***\n"; -//zero arguments -var_dump( symlink() ); - -//more than expected -var_dump( symlink($filename, $linkname, true) ); //invalid arguments var_dump( symlink(NULL, $linkname) ); // NULL as filename @@ -48,11 +43,6 @@ var_dump( symlink($filename, '') ); // '' as linkname var_dump( symlink($filename, false) ); // false as linkname echo "\n*** Testing linkinfo() for error conditions ***\n"; -//zero arguments -var_dump( linkinfo() ); - -//more than expected -var_dump( linkinfo($linkname, true) ); //invalid arguments var_dump( linkinfo(NULL) ); // NULL as linkname @@ -69,12 +59,6 @@ unlink(dirname(__FILE__)."/symlink_link_linkinfo_is_link_error1.tmp"); --EXPECTF-- *** Testing symlink() for error conditions *** -Warning: symlink() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: symlink() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: symlink(): %s in %s on line %d bool(false) @@ -95,12 +79,6 @@ bool(false) *** Testing linkinfo() for error conditions *** -Warning: linkinfo() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: linkinfo() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Warning: linkinfo(): %s in %s on line %d int(-1) diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt index fc891fde7bf5b..00047cde5ee7e 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt @@ -30,11 +30,6 @@ fclose($fp); $linkname = dirname(__FILE__)."/symlink_link_linkinfo_is_link_link_error2.tmp"; echo "*** Testing link() for error conditions ***\n"; -//zero arguments -var_dump( link() ); - -//more than expected -var_dump( link($filename, $linkname, false) ); //invalid arguments var_dump( link(NULL, $linkname) ); // NULL as filename @@ -46,11 +41,6 @@ var_dump( link($filename, '') ); // '' as linkname var_dump( link($filename, false) ); // false as linkname echo "\n*** Testing is_link() for error conditions ***\n"; -//zero arguments -var_dump( is_link() ); - -//more than expected -var_dump( is_link($linkname, "/") ); //invalid arguments var_dump( is_link(NULL) ); // NULL as linkname @@ -68,12 +58,6 @@ unlink(dirname(__FILE__)."/symlink_link_linkinfo_is_link_error2.tmp"); --EXPECTF-- *** Testing link() for error conditions *** -Warning: link() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: link() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: link(): No such file or directory in %s on line %d bool(false) @@ -96,12 +80,6 @@ Warning: link(): No such file or directory in %s on line %d bool(false) *** Testing is_link() for error conditions *** - -Warning: is_link() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_link() expects exactly 1 parameter, 2 given in %s on line %d -NULL bool(false) bool(false) bool(false) diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index 6d5071b5e5f91..d7602326d9754 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -59,7 +59,12 @@ $res_arr = array( for( $i=0; $igetMessage(), "\n"; + continue; + } /* creating the files in existing dir */ if (file_exists($file_name) && !$res_arr[$i]) { @@ -104,14 +109,9 @@ Notice: tempnam(): file created in the system's temporary directory in %stempnam Failed, not created in the correct directory %s vs %s 0 -- Iteration 6 -- - -Warning: tempnam() expects parameter 2 to be a valid path, string given in %stempnam_variation3-win32.php on line 54 -Failed, not created in the correct directory %s vs %sext\standard\tests\file\tempnamVar3 -0 +tempnam() expects parameter 2 to be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 2 to be a valid path, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d -OK +tempnam() expects parameter 2 to be a valid path, array given -- Iteration 8 -- OK -- Iteration 9 -- diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index 2d95cb0a43833..ccbd35084ff5a 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -37,7 +37,12 @@ $names_arr = array( for( $i=0; $igetMessage(), "\n"; + continue; + } /* creating the files in existing dir */ if( file_exists($file_name) ) { @@ -100,17 +105,9 @@ File name is => %s/%s File permissions are => 100600 File created in => directory specified -- Iteration 6 -- - -Warning: tempnam() expects parameter 2 to be a valid path, string given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam() expects parameter 2 to be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 2 to be a valid path, array given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam() expects parameter 2 to be a valid path, array given -- Iteration 8 -- File name is => %s/dir%s File permissions are => 100600 diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 5bacb5e876a7e..f4b3cf016c5c2 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -34,7 +34,12 @@ $names_arr = array( for( $i=0; $igetMessage(), "\n"; + continue; + } if( file_exists($file_name) ){ @@ -95,17 +100,9 @@ File name is => %s%et%s File permissions are => 100666 File created in => temp dir -- Iteration 6 -- - -Warning: tempnam() expects parameter 1 to be a valid path, string given in %stempnam_variation7-win32.php on line %d --- File is not created -- - -Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d +tempnam() expects parameter 1 to be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d --- File is not created -- - -Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d +tempnam() expects parameter 1 to be a valid path, 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 9ed84f974ae2c..680e207718c5c 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -35,7 +35,12 @@ $names_arr = array( for( $i=0; $igetMessage(), "\n"; + continue; + } if( file_exists($file_name) ){ @@ -100,17 +105,9 @@ File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir -- Iteration 6 -- - -Warning: tempnam() expects parameter 1 to be a valid path, string given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam() expects parameter 1 to be a valid path, string given -- Iteration 7 -- - -Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d --- File is not created -- - -Warning: unlink(): %s in %s on line %d +tempnam() expects parameter 1 to be a valid path, 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 42d1fad1e5b02..119ffd32046a1 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -13,7 +13,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { // output to linux. This could be a php.net bug on windows or a windows querk. $filename = dirname(__FILE__)."/touch.dat"; -var_dump(touch()); var_dump(touch($filename)); var_dump(filemtime($filename)); @unlink($filename); @@ -39,8 +38,6 @@ var_dump(touch("/no/such/file/or/directory")); echo "Done\n"; ?> --EXPECTF-- -Warning: touch() expects at least 1 parameter, 0 given in %s on line %d -NULL bool(true) int(%d) bool(true) diff --git a/ext/standard/tests/file/touch_error.phpt b/ext/standard/tests/file/touch_error.phpt index 0520055a90055..9a4bd01e13d5f 100644 --- a/ext/standard/tests/file/touch_error.phpt +++ b/ext/standard/tests/file/touch_error.phpt @@ -5,17 +5,9 @@ Dave Kelsey --FILE-- --EXPECTF-- -Warning: touch() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: touch() expects at most 3 parameters, 4 given in %s on line %d -NULL - Warning: touch(): Unable to create file /no/such/file/or/directory because No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index efd6ee832360f..2c81e33b727c6 100644 --- a/ext/standard/tests/file/unlink_error-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_error-win32-mb.phpt @@ -25,13 +25,6 @@ $context = stream_context_create(); echo "*** Testing unlink() : error conditions ***\n"; -echo "-- Testing unlink() on unexpected no. of arguments --\n"; -// arg < expected -var_dump( unlink() ); -// args > expected -var_dump( unlink($filename, $context, true) ); -var_dump( file_exists($filename) ); // expected: true - echo "\n-- Testing unlink() on invalid arguments --\n"; // invalid arguments var_dump( unlink('') ); // $filename as empty string @@ -43,9 +36,6 @@ var_dump( file_exists(NULL) ); // confirm file doesnt exist var_dump( unlink(false) ); // $filename as boolean false var_dump( file_exists(false) ); // confirm file doesnt exist -var_dump( unlink($filename, '') ); // $context as empty string -var_dump( unlink($filename, false) ); // $context as boolean false - echo "\n-- Testing unlink() on non-existent file --\n"; var_dump( unlink(dirname(__FILE__)."/non_existent_file.tmp") ); @@ -68,14 +58,6 @@ rmdir(dirname(__FILE__)."/私はガラスを食べられます"); ?> --EXPECTF-- *** Testing unlink() : error conditions *** --- Testing unlink() on unexpected no. of arguments -- - -Warning: unlink() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: unlink() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -bool(true) -- Testing unlink() on invalid arguments -- @@ -91,12 +73,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink() expects parameter 2 to be resource, string given in %s on line %d -bool(false) - -Warning: unlink() expects parameter 2 to be resource, bool given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index 8dde64cff07d8..fe165ec8c65e7 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -23,13 +23,6 @@ $context = stream_context_create(); echo "*** Testing unlink() : error conditions ***\n"; -echo "-- Testing unlink() on unexpected no. of arguments --\n"; -// arg < expected -var_dump( unlink() ); -// args > expected -var_dump( unlink($filename, $context, true) ); -var_dump( file_exists($filename) ); // expected: true - echo "\n-- Testing unlink() on invalid arguments --\n"; // invalid arguments var_dump( unlink('') ); // $filename as empty string @@ -41,9 +34,6 @@ var_dump( file_exists(NULL) ); // confirm file doesnt exist var_dump( unlink(false) ); // $filename as boolean false var_dump( file_exists(false) ); // confirm file doesnt exist -var_dump( unlink($filename, '') ); // $context as empty string -var_dump( unlink($filename, false) ); // $context as boolean false - echo "\n-- Testing unlink() on non-existent file --\n"; var_dump( unlink(dirname(__FILE__)."/non_existent_file.tmp") ); @@ -65,14 +55,6 @@ rmdir(dirname(__FILE__)."/unlink_error"); ?> --EXPECTF-- *** Testing unlink() : error conditions *** --- Testing unlink() on unexpected no. of arguments -- - -Warning: unlink() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: unlink() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -bool(true) -- Testing unlink() on invalid arguments -- @@ -88,12 +70,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink() expects parameter 2 to be resource, string given in %s on line %d -bool(false) - -Warning: unlink() expects parameter 2 to be resource, bool given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index f7f8f008471eb..87b189f3cf815 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -23,13 +23,6 @@ $context = stream_context_create(); echo "*** Testing unlink() : error conditions ***\n"; -echo "-- Testing unlink() on unexpected no. of arguments --\n"; -// arg < expected -var_dump( unlink() ); -// args > expected -var_dump( unlink($filename, $context, true) ); -var_dump( file_exists($filename) ); // expected true - echo "\n-- Testing unlink() on invalid arguments --\n"; // invalid arguments var_dump( unlink('') ); // $filename as empty string @@ -41,10 +34,6 @@ var_dump( file_exists(NULL) ); // confirm file doesnt exist var_dump( unlink(false) ); // $filename as boolean false var_dump( file_exists(false) ); // confirm file doesnt exist -var_dump( unlink($filename, '') ); // $context as empty string -var_dump( unlink($filename, false) ); // $context as boolean false - - echo "\n-- Testing unlink() on non-existent file --\n"; var_dump( unlink(dirname(__FILE__)."/non_existent_file.tmp") ); @@ -65,14 +54,6 @@ rmdir(dirname(__FILE__)."/unlink_error"); ?> --EXPECTF-- *** Testing unlink() : error conditions *** --- Testing unlink() on unexpected no. of arguments -- - -Warning: unlink() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: unlink() expects at most 2 parameters, 3 given in %s on line %d -bool(false) -bool(true) -- Testing unlink() on invalid arguments -- @@ -88,12 +69,6 @@ Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink() expects parameter 2 to be resource, string given in %s on line %d -bool(false) - -Warning: unlink() expects parameter 2 to be resource, bool given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/filters/001.phpt b/ext/standard/tests/filters/001.phpt index fbfdda23851b5..53d9fc2b503a6 100644 --- a/ext/standard/tests/filters/001.phpt +++ b/ext/standard/tests/filters/001.phpt @@ -7,8 +7,6 @@ var_dump(stream_filter_register("", "")); var_dump(stream_filter_register("test", "")); var_dump(stream_filter_register("", "test")); var_dump(stream_filter_register("------", "nonexistentclass")); -var_dump(stream_filter_register(array(), "aa")); -var_dump(stream_filter_register("", array())); echo "Done\n"; ?> @@ -22,10 +20,4 @@ bool(false) Warning: stream_filter_register(): Filter name cannot be empty in %s on line %d bool(false) bool(true) - -Warning: stream_filter_register() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: stream_filter_register() expects parameter 2 to be string, array given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/filters/stream_filter_remove_error.phpt b/ext/standard/tests/filters/stream_filter_remove_error.phpt index 37820a99c4956..e389b20fd81e8 100644 --- a/ext/standard/tests/filters/stream_filter_remove_error.phpt +++ b/ext/standard/tests/filters/stream_filter_remove_error.phpt @@ -20,16 +20,6 @@ $filter = stream_filter_append( $fp, "string.rot13", STREAM_FILTER_WRITE ); echo "*** Testing stream_filter_remove() : error conditions ***\n"; -echo "\n-- Testing stream_filter_remove() function with Zero arguments --\n"; -var_dump( stream_filter_remove() ); - -echo "\n-- Testing stream_filter_remove() function with more than expected no. of arguments --\n"; -$arg = 'bogus arg'; -var_dump( stream_filter_remove( $filter, $arg ) ); - -echo "\n-- Testing stream_filter_remove() function with unexisting stream filter --\n"; -var_dump( stream_filter_remove( "fakefilter" ) ); - echo "\n-- Testing stream_filter_remove() function with bad resource --\n"; var_dump( stream_filter_remove( $fp ) ); @@ -52,21 +42,6 @@ unlink( $file ); --EXPECTF-- *** Testing stream_filter_remove() : error conditions *** --- Testing stream_filter_remove() function with Zero arguments -- - -Warning: stream_filter_remove() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing stream_filter_remove() function with more than expected no. of arguments -- - -Warning: stream_filter_remove() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - --- Testing stream_filter_remove() function with unexisting stream filter -- - -Warning: stream_filter_remove() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -- Testing stream_filter_remove() function with bad resource -- Warning: stream_filter_remove(): Invalid resource given, not a stream filter in %s on line %d diff --git a/ext/standard/tests/general_functions/bug41970.phpt b/ext/standard/tests/general_functions/bug41970.phpt index 6f05137afc1b4..f43bf64380a64 100644 --- a/ext/standard/tests/general_functions/bug41970.phpt +++ b/ext/standard/tests/general_functions/bug41970.phpt @@ -6,22 +6,26 @@ Bug #41970 (call_user_func_*() leaks on failure) $a = array(4,3,2); var_dump(call_user_func_array("sort", array($a))); -var_dump(call_user_func_array("strlen", array($a))); +try { + var_dump(call_user_func_array("strlen", array($a))); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(call_user_func("sort", $a)); -var_dump(call_user_func("strlen", $a)); +try { + var_dump(call_user_func("strlen", $a)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> --EXPECTF-- -Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line 5 +Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line %d bool(true) +strlen() expects parameter 1 to be string, array given -Warning: strlen() expects parameter 1 to be string, array given in %sbug41970.php on line 6 -NULL - -Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line 7 +Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line %d bool(true) - -Warning: strlen() expects parameter 1 to be string, array given in %sbug41970.php on line 8 -NULL +strlen() expects parameter 1 to be string, array given Done diff --git a/ext/standard/tests/general_functions/callbacks_001.phpt b/ext/standard/tests/general_functions/callbacks_001.phpt index a58f19d932b8e..76d0e94c82017 100644 --- a/ext/standard/tests/general_functions/callbacks_001.phpt +++ b/ext/standard/tests/general_functions/callbacks_001.phpt @@ -69,7 +69,11 @@ class P extends O { $this->call(array('parent', 'who')); $this->call(array('P', 'parent::who')); $this->call(array($this, 'O::who')); - $this->call(array($this, 'B::who')); + try { + $this->call(array($this, 'B::who')); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } } @@ -103,6 +107,5 @@ O $this|O::who O $this|B::who - -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'P' is not a subclass of 'B' in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, class 'P' is not a subclass of 'B' ===DONE=== diff --git a/ext/standard/tests/general_functions/callbacks_002.phpt b/ext/standard/tests/general_functions/callbacks_002.phpt index 22130c524a1b4..0d44035e0e558 100644 --- a/ext/standard/tests/general_functions/callbacks_002.phpt +++ b/ext/standard/tests/general_functions/callbacks_002.phpt @@ -3,14 +3,24 @@ call_user_func(): Wrong parameters --FILE-- getMessage(), "\n"; +} +try { + call_user_func(array(NULL, 'bar')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func(array('stdclass', NULL)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Foo' not found in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, second array member is not a valid method in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, class 'Foo' not found +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object +call_user_func() expects parameter 1 to be a valid callback, second array member is not a valid method diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt index 71f068f10476e..e6cea73f4d82a 100644 --- a/ext/standard/tests/general_functions/error_get_last.phpt +++ b/ext/standard/tests/general_functions/error_get_last.phpt @@ -4,7 +4,11 @@ error_get_last() tests getMessage(), "\n"; +} var_dump(error_get_last()); $a = $b; @@ -15,19 +19,8 @@ echo "Done\n"; ?> --EXPECTF-- NULL - -Warning: error_get_last() expects exactly 0 parameters, 1 given in %s on line %d +error_get_last() expects exactly 0 parameters, 1 given NULL -array(4) { - ["type"]=> - int(2) - ["message"]=> - string(54) "error_get_last() expects exactly 0 parameters, 1 given" - ["file"]=> - string(%i) "%s" - ["line"]=> - int(4) -} Notice: Undefined variable: b in %s on line %d array(4) { @@ -38,6 +31,6 @@ array(4) { ["file"]=> string(%i) "%s" ["line"]=> - int(7) + int(11) } Done diff --git a/ext/standard/tests/general_functions/floatval.phpt b/ext/standard/tests/general_functions/floatval.phpt index 1bb4d1151cef7..2b681e631dea0 100644 --- a/ext/standard/tests/general_functions/floatval.phpt +++ b/ext/standard/tests/general_functions/floatval.phpt @@ -91,18 +91,6 @@ foreach ($not_float_types as $type ) { var_dump( doubleval($type) ); } - - - -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( floatval() ); -var_dump( doubleval() ); - -//arguments more than expected -var_dump( floatval(TRUE, FALSE) ); -var_dump( doubleval(TRUE, FALSE) ); - echo "\nDone\n"; @@ -194,18 +182,4 @@ float(1) float(0) float(0) -*** Testing error conditions *** - -Warning: floatval() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: doubleval() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: floatval() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: doubleval() expects exactly 1 parameter, 2 given in %s on line %d -NULL - Done diff --git a/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt b/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt index 33d4af03d207c..c74e4f71feef5 100644 --- a/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt +++ b/ext/standard/tests/general_functions/get_extension_funcs_basic.phpt @@ -14,10 +14,14 @@ $result = get_extension_funcs("standard"); var_dump(gettype($result)); var_dump(in_array("cos", $result)); +// Unknown extension +var_dump(get_extension_funcs("foo")); + ?> ===DONE=== --EXPECT-- Simple testcase for get_extension_funcs() function string(5) "array" bool(true) +bool(false) ===DONE=== diff --git a/ext/standard/tests/general_functions/get_extension_funcs_error.phpt b/ext/standard/tests/general_functions/get_extension_funcs_error.phpt deleted file mode 100644 index 44bd822d12ed1..0000000000000 --- a/ext/standard/tests/general_functions/get_extension_funcs_error.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Test get_extension_funcs() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing get_extension_funcs() : error conditions *** - --- Too few arguments -- - -Warning: get_extension_funcs() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Too many arguments -- - -Warning: get_extension_funcs() expects exactly 1 parameter, 2 given in %s on line %d -NULL - --- Invalid extension name -- -bool(false) -===DONE=== diff --git a/ext/standard/tests/general_functions/get_include_path_basic.phpt b/ext/standard/tests/general_functions/get_include_path_basic.phpt index 2017bf697ad12..5b45c864496f3 100644 --- a/ext/standard/tests/general_functions/get_include_path_basic.phpt +++ b/ext/standard/tests/general_functions/get_include_path_basic.phpt @@ -19,19 +19,10 @@ if (ini_get("include_path") == get_include_path()) { echo "FAILED\n"; } -echo "\nError cases:\n"; -var_dump(get_include_path(TRUE)); - - ?> ===DONE=== --EXPECTF-- *** Testing get_include_path() string(1) "." PASSED - -Error cases: - -Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on line %d -NULL ===DONE=== diff --git a/ext/standard/tests/general_functions/get_included_files.phpt b/ext/standard/tests/general_functions/get_included_files.phpt index e6d00a56a1bc9..e4dfe0f9749c0 100644 --- a/ext/standard/tests/general_functions/get_included_files.phpt +++ b/ext/standard/tests/general_functions/get_included_files.phpt @@ -22,9 +22,6 @@ include(dirname(__FILE__)."/get_included_files_inc2.inc"); echo "\n-- List included files atfter including inc2 which will include inc3 which includes inc1 --\n"; var_dump(get_included_files()); -echo "\n-- Error cases --\n"; -var_dump(get_included_files(true)); - ?> ===DONE=== --EXPECTF-- @@ -55,9 +52,4 @@ array(4) { [3]=> string(%d) "%sget_included_files_inc3.inc" } - --- Error cases -- - -Warning: get_included_files() expects exactly 0 parameters, 1 given in %s on line %d -NULL ===DONE=== diff --git a/ext/standard/tests/general_functions/getrusage.phpt b/ext/standard/tests/general_functions/getrusage.phpt index 4caca88e1b2f1..8ec131809fd5a 100644 --- a/ext/standard/tests/general_functions/getrusage.phpt +++ b/ext/standard/tests/general_functions/getrusage.phpt @@ -8,16 +8,12 @@ getrusage() tests var_dump(gettype(getrusage())); var_dump(gettype(getrusage(1))); var_dump(gettype(getrusage(-1))); -var_dump(getrusage(array())); echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- string(5) "array" string(5) "array" string(5) "array" - -Warning: getrusage() expects parameter 1 to be int, array given in %s on line %d -NULL Done diff --git a/ext/standard/tests/general_functions/getservbyport_variation1.phpt b/ext/standard/tests/general_functions/getservbyport_variation1.phpt index a876ac1fea7ce..f387161bf4fc1 100644 --- a/ext/standard/tests/general_functions/getservbyport_variation1.phpt +++ b/ext/standard/tests/general_functions/getservbyport_variation1.phpt @@ -12,29 +12,13 @@ Simone Gentili (sensorario@gmail.com) var_dump(getservbyport( -1, "tcp" )); var_dump(getservbyport( 80, "ppp" )); var_dump(getservbyport( null, null)); - var_dump(getservbyport( array(), array())); - var_dump(getservbyport( array(80), array("tcp"))); - var_dump(getservbyport( array(2, 3), array("one"=>1, "two"=>2))); var_dump(getservbyport( 2, 2)); var_dump(getservbyport( "80", "tcp")); - var_dump(getservbyport( new stdClass(), new stdClass())); ?> --EXPECTF-- bool(false) bool(false) bool(false) - -Warning: getservbyport() expects parameter 1 to be int, array given in %s on line %d -NULL - -Warning: getservbyport() expects parameter 1 to be int, array given in %s on line %d -NULL - -Warning: getservbyport() expects parameter 1 to be int, array given in %s on line %d -NULL bool(false) string(%d) "%s" - -Warning: getservbyport() expects parameter 1 to be int, object given in %s on line %d -NULL diff --git a/ext/standard/tests/general_functions/gettype_settype_error.phpt b/ext/standard/tests/general_functions/gettype_settype_error.phpt index 325e91e47f681..e204c64d4c7bd 100644 --- a/ext/standard/tests/general_functions/gettype_settype_error.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_error.phpt @@ -13,19 +13,7 @@ Test gettype() & settype() functions : error conditions echo "**** Testing gettype() and settype() functions ****\n"; -echo "\n*** Testing gettype(): error conditions ***\n"; -//Zero arguments -var_dump( gettype() ); -// args more than expected -var_dump( gettype( "1", "2" ) ); - echo "\n*** Testing settype(): error conditions ***\n"; -//Zero arguments -var_dump( settype() ); - -// args more than expected -$var = 10.5; -var_dump( settype( $var, $var, "int" ) ); // passing an invalid type to set var_dump( settype( $var, "unknown" ) ); @@ -35,22 +23,8 @@ echo "Done\n"; --EXPECTF-- **** Testing gettype() and settype() functions **** -*** Testing gettype(): error conditions *** - -Warning: gettype() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: gettype() expects exactly 1 parameter, 2 given in %s on line %d -NULL - *** Testing settype(): error conditions *** -Warning: settype() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: settype() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: settype(): Invalid type in %s on line %d bool(false) Done diff --git a/ext/standard/tests/general_functions/include_path.phpt b/ext/standard/tests/general_functions/include_path.phpt index 8b6626fbc876a..de6aa278eb98e 100644 --- a/ext/standard/tests/general_functions/include_path.phpt +++ b/ext/standard/tests/general_functions/include_path.phpt @@ -6,14 +6,9 @@ include_path=. --EXPECTF-- string(1) "." - -Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on line %d -NULL -NULL - -Warning: restore_include_path() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Warning: set_include_path() expects exactly 1 parameter, 0 given in %s on line %d NULL string(1) "." -string(1) "." string(3) "var" NULL string(1) "." @@ -66,10 +48,6 @@ bool(false) string(1) "." NULL string(1) "." - -Warning: set_include_path() expects parameter 1 to be a valid path, array given in %s on line %d -NULL -string(1) "." NULL string(1) "." Done diff --git a/ext/standard/tests/general_functions/intval.phpt b/ext/standard/tests/general_functions/intval.phpt index 7f3d895fbeacb..00b2dc04ab536 100644 --- a/ext/standard/tests/general_functions/intval.phpt +++ b/ext/standard/tests/general_functions/intval.phpt @@ -146,13 +146,6 @@ foreach ($not_int_types as $type ) { var_dump( intval($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( intval() ); - -//arguments more than expected -var_dump( intval(TRUE, FALSE, TRUE) ); - echo "\n--- Done ---\n"; @@ -295,12 +288,4 @@ int(0) int(0) int(0) -*** Testing error conditions *** - -Warning: intval() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: intval() expects at most 2 parameters, 3 given in %s on line %d -NULL - --- Done --- diff --git a/ext/standard/tests/general_functions/is_array.phpt b/ext/standard/tests/general_functions/is_array.phpt index 223b732904c73..f3b0c75db3b51 100644 --- a/ext/standard/tests/general_functions/is_array.phpt +++ b/ext/standard/tests/general_functions/is_array.phpt @@ -98,13 +98,6 @@ foreach ($varient_arrays as $type ) { var_dump( is_array ($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_array() ); - -//arguments more than expected -var_dump( is_array ($fp, $fp) ); - echo "Done\n"; /* close resources */ fclose($fp); @@ -202,12 +195,4 @@ bool(false) bool(false) -- Iteration 29 -- bool(false) - -*** Testing error conditions *** - -Warning: is_array() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_array() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_bool.phpt b/ext/standard/tests/general_functions/is_bool.phpt index a6c6111fa1d56..4f0ae4fff5640 100644 --- a/ext/standard/tests/general_functions/is_bool.phpt +++ b/ext/standard/tests/general_functions/is_bool.phpt @@ -127,13 +127,6 @@ foreach ($not_bool_types as $type ) { var_dump( is_bool($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_bool() ); - -//arguments more than expected -var_dump( is_bool(TRUE, FALSE) ); - echo "Done\n"; // close resources @@ -283,12 +276,4 @@ bool(false) bool(false) -- Iteration 65 -- bool(false) - -*** Testing error conditions *** - -Warning: is_bool() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_bool() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_countable_with_variables.phpt b/ext/standard/tests/general_functions/is_countable_with_variables.phpt index 700077ef1765c..0cb18769d64b8 100644 --- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt +++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt @@ -7,7 +7,6 @@ Gabriel Caruso (carusogabriel34@gmail.com) var_dump(is_countable([1, 2, 3])); var_dump(is_countable((array) 1)); var_dump(is_countable((object) ['foo', 'bar', 'baz'])); -var_dump(is_countable()); $foo = ['', []]; @@ -24,9 +23,6 @@ if (!is_countable($bar)) { bool(true) bool(true) bool(false) - -Warning: is_countable() expects exactly 1 parameter, 0 given in %s on line %d -NULL int(2) Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d diff --git a/ext/standard/tests/general_functions/is_float.phpt b/ext/standard/tests/general_functions/is_float.phpt index b71a5283dbc6e..0ee1c60959f9c 100644 --- a/ext/standard/tests/general_functions/is_float.phpt +++ b/ext/standard/tests/general_functions/is_float.phpt @@ -127,17 +127,6 @@ foreach ($not_floats as $value ) { var_dump( is_real($value) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_float() ); -var_dump( is_double() ); -var_dump( is_real() ); - -//arguments more than expected -var_dump( is_float( $floats[0], $floats[1]) ); -var_dump( is_double( $floats[0], $floats[1]) ); -var_dump( is_real( $floats[0], $floats[1]) ); - echo "Done\n"; // close the resources used @@ -417,24 +406,4 @@ bool(false) bool(false) bool(false) bool(false) - -*** Testing error conditions *** - -Warning: is_float() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_double() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_real() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_float() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_double() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_real() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_float_64bit.phpt b/ext/standard/tests/general_functions/is_float_64bit.phpt index 9410a21fe259c..76cbf0c5d271e 100644 --- a/ext/standard/tests/general_functions/is_float_64bit.phpt +++ b/ext/standard/tests/general_functions/is_float_64bit.phpt @@ -129,17 +129,6 @@ foreach ($not_floats as $value ) { var_dump( is_real($value) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_float() ); -var_dump( is_double() ); -var_dump( is_real() ); - -//arguments more than expected -var_dump( is_float( $floats[0], $floats[1]) ); -var_dump( is_double( $floats[0], $floats[1]) ); -var_dump( is_real( $floats[0], $floats[1]) ); - echo "Done\n"; ?> --EXPECTF-- @@ -414,24 +403,4 @@ bool(false) bool(false) bool(false) bool(false) - -*** Testing error conditions *** - -Warning: is_float() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_double() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_real() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_float() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_double() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_real() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_int.phpt b/ext/standard/tests/general_functions/is_int.phpt index d154b30748f6e..2f452cd48b254 100644 --- a/ext/standard/tests/general_functions/is_int.phpt +++ b/ext/standard/tests/general_functions/is_int.phpt @@ -132,17 +132,6 @@ foreach ($not_int_types as $type ) { var_dump( is_long($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_int() ); -var_dump( is_integer() ); -var_dump( is_long() ); - -//arguments more than expected -var_dump( is_int(TRUE, FALSE) ); -var_dump( is_integer(TRUE, FALSE) ); -var_dump( is_long(TRUE, FALSE) ); - echo "Done\n"; // close the resources @@ -442,24 +431,4 @@ bool(false) bool(false) bool(false) bool(false) - -*** Testing error conditions *** - -Warning: is_int() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_integer() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_long() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_int() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_integer() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_long() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_int_64bit.phpt b/ext/standard/tests/general_functions/is_int_64bit.phpt index 68ef75b35b06d..ac919ced167e5 100644 --- a/ext/standard/tests/general_functions/is_int_64bit.phpt +++ b/ext/standard/tests/general_functions/is_int_64bit.phpt @@ -134,17 +134,6 @@ foreach ($not_int_types as $type ) { var_dump( is_long($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_int() ); -var_dump( is_integer() ); -var_dump( is_long() ); - -//arguments more than expected -var_dump( is_int(TRUE, FALSE) ); -var_dump( is_integer(TRUE, FALSE) ); -var_dump( is_long(TRUE, FALSE) ); - echo "Done\n"; ?> --EXPECTF-- @@ -439,24 +428,4 @@ bool(false) bool(false) bool(false) bool(false) - -*** Testing error conditions *** - -Warning: is_int() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_integer() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_long() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_int() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_integer() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -Warning: is_long() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_null.phpt b/ext/standard/tests/general_functions/is_null.phpt index fa7c87f791796..5a3269a28aa3e 100644 --- a/ext/standard/tests/general_functions/is_null.phpt +++ b/ext/standard/tests/general_functions/is_null.phpt @@ -127,13 +127,6 @@ foreach ($not_null_types as $type ) { var_dump( is_null($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_null() ); - -//arguments more than expected -var_dump( is_null(NULL, null) ); - echo "Done\n"; // close the resources used @@ -285,12 +278,4 @@ bool(false) bool(false) -- Iteration 59 -- bool(false) - -*** Testing error conditions *** - -Warning: is_null() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_null() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_numeric.phpt b/ext/standard/tests/general_functions/is_numeric.phpt index 0019cf18d2fbe..509ee7e686e57 100644 --- a/ext/standard/tests/general_functions/is_numeric.phpt +++ b/ext/standard/tests/general_functions/is_numeric.phpt @@ -145,13 +145,6 @@ foreach ($not_numerics as $type ) { var_dump( is_numeric($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_numeric() ); - -//arguments more than expected -var_dump( is_numeric("10", "20") ); - echo "Done\n"; // close the resources used @@ -373,12 +366,4 @@ bool(false) bool(false) -- Iteration 29 -- bool(false) - -*** Testing error conditions *** - -Warning: is_numeric() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/general_functions/is_object.phpt b/ext/standard/tests/general_functions/is_object.phpt index 8abc766376e3d..2b5d1ae47545b 100644 --- a/ext/standard/tests/general_functions/is_object.phpt +++ b/ext/standard/tests/general_functions/is_object.phpt @@ -138,13 +138,6 @@ foreach ($not_objects as $type ) { var_dump( is_object($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_object() ); - -//arguments more than expected -var_dump( is_object($myClass_object, $myClass_object) ); - echo "Done\n"; // close the resources used @@ -216,12 +209,4 @@ bool(false) bool(false) -- Iteration 19 -- bool(false) - -*** Testing error conditions *** - -Warning: is_object() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_object() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/is_scalar.phpt b/ext/standard/tests/general_functions/is_scalar.phpt index 53620178c4aa2..f7ef3f5317544 100644 --- a/ext/standard/tests/general_functions/is_scalar.phpt +++ b/ext/standard/tests/general_functions/is_scalar.phpt @@ -105,14 +105,6 @@ foreach( $variation_array as $value ) { var_dump( is_scalar($value) ); } -echo "\n*** Testing error conditions ***\n"; -// Zero arguments -var_dump( is_scalar() ); - -// Arguments more than expected -var_dump( is_scalar( $scalar_variables[2], $scalar_variables[2]) ); -var_dump( is_scalar( new stdclass, new stdclass) ); - echo "Done\n"; // close the resources used @@ -226,15 +218,4 @@ bool(false) bool(false) -- Iteration 18 -- bool(false) - -*** Testing error conditions *** - -Warning: is_scalar() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: is_scalar() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: is_scalar() expects exactly 1 parameter, 2 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/general_functions/is_string.phpt b/ext/standard/tests/general_functions/is_string.phpt index 72a885a57a21e..d48fbd17299a6 100644 --- a/ext/standard/tests/general_functions/is_string.phpt +++ b/ext/standard/tests/general_functions/is_string.phpt @@ -140,13 +140,6 @@ foreach ($not_strings as $type ) { var_dump( is_string($type) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( is_string() ); - -//arguments more than expected -var_dump( is_string("string", "test") ); - echo "Done\n"; // close the resources used @@ -292,12 +285,4 @@ bool(false) bool(false) -- Iteration 45 -- bool(false) - -*** Testing error conditions *** - -Warning: is_string() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: is_string() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/general_functions/ob_get_flush_error.phpt b/ext/standard/tests/general_functions/ob_get_flush_error.phpt index 0664043eba6d8..5603e3d238ffc 100644 --- a/ext/standard/tests/general_functions/ob_get_flush_error.phpt +++ b/ext/standard/tests/general_functions/ob_get_flush_error.phpt @@ -12,10 +12,6 @@ output_buffering=0 echo "*** Testing ob_get_flush() : error conditions ***\n"; -// One extra argument -$extra_arg = 10; -var_dump( ob_get_flush( $extra_arg ) ); - // No ob_start() executed var_dump( ob_get_flush() ); @@ -24,9 +20,6 @@ var_dump( ob_get_flush() ); --EXPECTF-- *** Testing ob_get_flush() : error conditions *** -Warning: ob_get_flush() expects exactly 0 parameters, 1 given in %s on line %d -NULL - Notice: ob_get_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line %d bool(false) ===DONE=== diff --git a/ext/standard/tests/general_functions/ob_get_length_basic.phpt b/ext/standard/tests/general_functions/ob_get_length_basic.phpt index b3470bec5598b..75e22e7741d62 100644 --- a/ext/standard/tests/general_functions/ob_get_length_basic.phpt +++ b/ext/standard/tests/general_functions/ob_get_length_basic.phpt @@ -31,9 +31,6 @@ dump_string_length( ' lsf' ); dump_string_length( '' ); dump_string_length( null ); -// Extra argument -var_dump( ob_get_length( 'foobar' ) ); - ?> ===DONE=== --EXPECTF-- @@ -45,7 +42,4 @@ int(1) int(15) int(0) int(0) - -Warning: ob_get_length() expects exactly 0 parameters, 1 given in %s on line %d -NULL ===DONE=== diff --git a/ext/standard/tests/general_functions/parse_ini_file.phpt b/ext/standard/tests/general_functions/parse_ini_file.phpt index ebc714455dcdc..14c1fc18efe3f 100644 --- a/ext/standard/tests/general_functions/parse_ini_file.phpt +++ b/ext/standard/tests/general_functions/parse_ini_file.phpt @@ -8,8 +8,6 @@ parse_ini_file() multiple calls $filename = dirname(__FILE__)."/parse_ini_file.dat"; @unlink($filename); /* Make sure the file really does not exist! */ -var_dump(parse_ini_file()); -var_dump(parse_ini_file(1,1,1,1)); var_dump(parse_ini_file($filename)); var_dump(parse_ini_file($filename, true)); @@ -121,16 +119,10 @@ var_dump(parse_ini_file($filename, true)); echo "Done\n"; ?> --EXPECTF-- -Warning: parse_ini_file() expects at least 1 parameter, 0 given in %sparse_ini_file.php on line 6 +Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %sparse_ini_file.php on line %d bool(false) -Warning: parse_ini_file() expects at most 3 parameters, 4 given in %sparse_ini_file.php on line 7 -bool(false) - -Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %sparse_ini_file.php on line 8 -bool(false) - -Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %sparse_ini_file.php on line 9 +Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %sparse_ini_file.php on line %d bool(false) array(1) { ["test"]=> @@ -138,11 +130,11 @@ array(1) { } Warning: syntax error, unexpected '='%sparse_ini_file.dat on line 2 - in %sparse_ini_file.php on line 20 + in %sparse_ini_file.php on line %d bool(false) Warning: syntax error, unexpected '='%sparse_ini_file.dat on line 2 - in %sparse_ini_file.php on line 26 + in %sparse_ini_file.php on line %d bool(false) array(1) { ["test"]=> diff --git a/ext/standard/tests/general_functions/parse_ini_string_002.phpt b/ext/standard/tests/general_functions/parse_ini_string_002.phpt index 106cd0c84246c..384398cdb2013 100644 --- a/ext/standard/tests/general_functions/parse_ini_string_002.phpt +++ b/ext/standard/tests/general_functions/parse_ini_string_002.phpt @@ -3,9 +3,6 @@ parse_ini_string() multiple calls --FILE-- --EXPECTF-- -Warning: parse_ini_string() expects at least 1 parameter, 0 given in %s -bool(false) - -Warning: parse_ini_string() expects at most 3 parameters, 4 given in %s -bool(false) array(1) { ["test"]=> string(0) "" diff --git a/ext/standard/tests/general_functions/php_uname_error.phpt b/ext/standard/tests/general_functions/php_uname_error.phpt index 392e1c930e391..ec5b2b5839d16 100644 --- a/ext/standard/tests/general_functions/php_uname_error.phpt +++ b/ext/standard/tests/general_functions/php_uname_error.phpt @@ -8,49 +8,15 @@ Test php_uname() function - error conditions - pass function incorrect argument echo "*** Testing php_uname() - error test\n"; -echo "\n-- Testing php_uname() function with more than expected no. of arguments --\n"; -var_dump( php_uname('a', true) ); - echo "\n-- Testing php_uname() function with invalid mode --\n"; // am invalid mode should result in same o/p as mode 'a' var_dump( php_uname('z') == php_uname('z') ); -class barClass { -} - -$fp = fopen(__FILE__, "r"); - -echo "\n-- Testing php_uname() function with invalid argument types --\n"; -var_dump(php_uname(array())); -var_dump(php_uname(array('color' => 'red', 'item' => 'pen'))); -var_dump(php_uname(new barClass())); -var_dump(php_uname($fp)); - -fclose($fp); ?> ===DONE=== --EXPECTF-- *** Testing php_uname() - error test --- Testing php_uname() function with more than expected no. of arguments -- - -Warning: php_uname() expects at most 1 parameter, 2 given in %s on line %d -NULL - -- Testing php_uname() function with invalid mode -- bool(true) - --- Testing php_uname() function with invalid argument types -- - -Warning: php_uname() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: php_uname() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: php_uname() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: php_uname() expects parameter 1 to be string, resource given in %s on line %d -NULL ===DONE=== diff --git a/ext/standard/tests/general_functions/phpcredits.phpt b/ext/standard/tests/general_functions/phpcredits.phpt index 044232570e994..dfcddc61f39db 100644 --- a/ext/standard/tests/general_functions/phpcredits.phpt +++ b/ext/standard/tests/general_functions/phpcredits.phpt @@ -4,7 +4,6 @@ phpcredits() %s bool(true) - -Warning: phpcredits() expects parameter 1 to be int, array given in %sphpcredits2.php on line 4 -NULL --

PHP Credits

bool(true) diff --git a/ext/standard/tests/general_functions/phpinfo.phpt b/ext/standard/tests/general_functions/phpinfo.phpt index a805876aab4c9..5f4d99ffbaf2e 100644 --- a/ext/standard/tests/general_functions/phpinfo.phpt +++ b/ext/standard/tests/general_functions/phpinfo.phpt @@ -4,9 +4,6 @@ phpinfo() %abool(true) -- - -Warning: phpinfo() expects parameter 1 to be int, array given in %sphpinfo2.php on line 5 -NULL --- %abool(true) -- diff --git a/ext/standard/tests/general_functions/print_r.phpt b/ext/standard/tests/general_functions/print_r.phpt index de58dd1e1e9e1..15155fe0d2420 100644 --- a/ext/standard/tests/general_functions/print_r.phpt +++ b/ext/standard/tests/general_functions/print_r.phpt @@ -271,16 +271,6 @@ $misc_values = array ( /* calling check_printr() to display miscelleneous data using print_r() */ check_printr($misc_values); -echo "\n*** Testing error conditions ***\n"; -//passing zero argument -var_dump( print_r() ); - -//passing more than required no. of arguments -var_dump( print_r(123, true, "abc") ); - -// check when second arg is given other than boolean TRUE -var_dump( print_r ($value, "string") ); - /* closing resource handle used */ closedir($dir_handle); @@ -1706,15 +1696,4 @@ Array -- Iteration 4 -- - -*** Testing error conditions *** - -Warning: print_r() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: print_r() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - -Notice: Undefined variable: value in %s on line %d -string(0) "" Done diff --git a/ext/standard/tests/general_functions/print_r_64bit.phpt b/ext/standard/tests/general_functions/print_r_64bit.phpt index ff9c3c0b9c54e..db5b92bf84eda 100644 --- a/ext/standard/tests/general_functions/print_r_64bit.phpt +++ b/ext/standard/tests/general_functions/print_r_64bit.phpt @@ -275,16 +275,6 @@ $misc_values = array ( /* calling check_printr() to display miscelleneous data using print_r() */ check_printr($misc_values); -echo "\n*** Testing error conditions ***\n"; -//passing zero argument -var_dump( print_r() ); - -//passing more than required no. of arguments -var_dump( print_r(123, true, "abc") ); - -// check when second arg is given other than boolean TRUE -var_dump( print_r ($value, "string") ); - /* closing resource handle used */ closedir($dir_handle); @@ -1710,15 +1700,4 @@ Array -- Iteration 4 -- - -*** Testing error conditions *** - -Warning: print_r() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -Warning: print_r() expects at most 2 parameters, 3 given in %s on line %d -bool(false) - -Notice: Undefined variable: value in %s on line %d -string(0) "" Done diff --git a/ext/standard/tests/general_functions/rand.phpt b/ext/standard/tests/general_functions/rand.phpt index e6639a71c7bf3..73dec4eb75ff1 100644 --- a/ext/standard/tests/general_functions/rand.phpt +++ b/ext/standard/tests/general_functions/rand.phpt @@ -4,60 +4,36 @@ rand() and mt_rand() tests --EXPECTF-- int(%d) - -Warning: mt_rand() expects exactly 2 parameters, 1 given in %s on line %d -NULL int(%i) int(%d) int(%d) - -Warning: rand() expects exactly 2 parameters, 1 given in %s on line %d -NULL int(%i) int(%d) NULL NULL - -Warning: srand() expects parameter 1 to be int, array given in %s on line %d -NULL -NULL NULL - -Warning: mt_srand() expects parameter 1 to be int, array given in %s on line %d NULL int(%d) - -Warning: getrandmax() expects exactly 0 parameters, 1 given in %s on line %d -NULL int(%d) - -Warning: mt_getrandmax() expects exactly 0 parameters, 1 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/general_functions/sleep_error.phpt b/ext/standard/tests/general_functions/sleep_error.phpt index c4f069a3d2a55..3b46a35e5dc36 100644 --- a/ext/standard/tests/general_functions/sleep_error.phpt +++ b/ext/standard/tests/general_functions/sleep_error.phpt @@ -10,14 +10,6 @@ Test sleep() function : error conditions echo "*** Testing sleep() : error conditions ***\n"; -echo "\n-- Testing sleep() function with zero arguments --\n"; -var_dump( sleep() ); - -echo "\n-- Testing sleep() function with more than expected no. of arguments --\n"; -$seconds = 10; -$extra_arg = 10; -var_dump( sleep($seconds, $extra_arg) ); - echo "\n-- Testing sleep() function with negative interval --\n"; $seconds = -10; var_dump( sleep($seconds) ); @@ -27,16 +19,6 @@ var_dump( sleep($seconds) ); --EXPECTF-- *** Testing sleep() : error conditions *** --- Testing sleep() function with zero arguments -- - -Warning: sleep() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - --- Testing sleep() function with more than expected no. of arguments -- - -Warning: sleep() expects exactly 1 parameter, 2 given in %s on line %d -bool(false) - -- Testing sleep() function with negative interval -- Warning: sleep(): Number of seconds must be greater than or equal to 0 in %s on line %d diff --git a/ext/standard/tests/general_functions/strval.phpt b/ext/standard/tests/general_functions/strval.phpt index b814733dd0720..0e513a3c47dc3 100644 --- a/ext/standard/tests/general_functions/strval.phpt +++ b/ext/standard/tests/general_functions/strval.phpt @@ -141,13 +141,6 @@ foreach ($not_scalars as $value ) { var_dump( strval($value) ); } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_dump( strval() ); - -//arguments more than expected -var_dump( strval( $scalars[0], $scalars[1]) ); - echo "Done\n"; // close the resources used @@ -306,12 +299,4 @@ string(0) "" string(0) "" -- Iteration 11 -- string(0) "" - -*** Testing error conditions *** - -Warning: strval() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -Warning: strval() expects exactly 1 parameter, 2 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/general_functions/sys_getloadavg.phpt b/ext/standard/tests/general_functions/sys_getloadavg.phpt index 5763084f700a2..1775978a120d9 100644 --- a/ext/standard/tests/general_functions/sys_getloadavg.phpt +++ b/ext/standard/tests/general_functions/sys_getloadavg.phpt @@ -7,14 +7,11 @@ if (!function_exists("sys_getloadavg")) die("skip"); --FILE-- --EXPECTF-- -Warning: sys_getloadavg() expects exactly 0 parameters, %d given in %s -NULL array(3) { [0]=> float(%f) diff --git a/ext/standard/tests/general_functions/usleep_error.phpt b/ext/standard/tests/general_functions/usleep_error.phpt index 474aab7d5dd57..283e7f30e5bc6 100644 --- a/ext/standard/tests/general_functions/usleep_error.phpt +++ b/ext/standard/tests/general_functions/usleep_error.phpt @@ -11,14 +11,6 @@ set_time_limit(20); echo "*** Testing usleep() : error conditions ***\n"; -echo "\n-- Testing usleep() function with zero arguments --\n"; -var_dump( usleep() ); - -echo "\n-- Testing usleep() function with more than expected no. of arguments --\n"; -$seconds = 10; -$extra_arg = 10; -var_dump( usleep($seconds, $extra_arg) ); - echo "\n-- Testing usleep() function with negative interval --\n"; $seconds = -10; var_dump( usleep($seconds) ); @@ -28,16 +20,6 @@ var_dump( usleep($seconds) ); --EXPECTF-- *** Testing usleep() : error conditions *** --- Testing usleep() function with zero arguments -- - -Warning: usleep() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing usleep() function with more than expected no. of arguments -- - -Warning: usleep() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -- Testing usleep() function with negative interval -- Warning: usleep(): Number of microseconds must be greater than or equal to 0 in %s on line %d diff --git a/ext/standard/tests/general_functions/var_dump.phpt b/ext/standard/tests/general_functions/var_dump.phpt index 74f497da6527f..5de84c531eb9b 100644 --- a/ext/standard/tests/general_functions/var_dump.phpt +++ b/ext/standard/tests/general_functions/var_dump.phpt @@ -274,10 +274,6 @@ echo "\n*** Testing var_dump() on multiple arguments ***\n"; var_dump( $integers, $floats, $strings, $arrays, $booleans, $resources, $objects, $misc_values, $variations ); -echo "\n*** Testing error conditions ***\n"; -//passing zero argument -var_dump(); - /* closing resource handle used */ closedir($dir_handle); @@ -1553,8 +1549,4 @@ array(6) { string(5) "/00\7" } } - -*** Testing error conditions *** - -Warning: var_dump() expects at least 1 parameter, 0 given in %s on line %d Done diff --git a/ext/standard/tests/general_functions/var_dump_64bit.phpt b/ext/standard/tests/general_functions/var_dump_64bit.phpt index 8440ffaf6e508..0815c9d62f32b 100644 --- a/ext/standard/tests/general_functions/var_dump_64bit.phpt +++ b/ext/standard/tests/general_functions/var_dump_64bit.phpt @@ -274,10 +274,6 @@ echo "\n*** Testing var_dump() on multiple arguments ***\n"; var_dump( $integers, $floats, $strings, $arrays, $booleans, $resources, $objects, $misc_values, $variations ); -echo "\n*** Testing error conditions ***\n"; -//passing zero argument -var_dump(); - /* closing resource handle used */ closedir($dir_handle); @@ -1553,8 +1549,4 @@ array(6) { string(5) "/00\7" } } - -*** Testing error conditions *** - -Warning: var_dump() expects at least 1 parameter, 0 given in %s on line %d Done diff --git a/ext/standard/tests/general_functions/var_export-locale.phpt b/ext/standard/tests/general_functions/var_export-locale.phpt index e8939f1d0a2c0..52896eb788f1c 100644 --- a/ext/standard/tests/general_functions/var_export-locale.phpt +++ b/ext/standard/tests/general_functions/var_export-locale.phpt @@ -300,14 +300,7 @@ echo "\n"; $counter++; } -echo "\n*** Testing error conditions ***\n"; -//Zero argument -var_export( var_export() ); - -//arguments more than expected -var_export( var_export(TRUE, FALSE, TRUE) ); - -echo "\n\nDone"; +echo "\nDone"; ?> @@ -1135,11 +1128,4 @@ NULL string(4) "NULL" -*** Testing error conditions *** - -Warning: var_export() expects at least 1 parameter, 0 given in %s on line %d -NULL -Warning: var_export() expects at most 2 parameters, 3 given in %s on line %d -NULL - Done diff --git a/ext/standard/tests/image/image_type_to_extension.phpt b/ext/standard/tests/image/image_type_to_extension.phpt index 8418a4b8c7dfb..249df579436ca 100644 --- a/ext/standard/tests/image/image_type_to_extension.phpt +++ b/ext/standard/tests/image/image_type_to_extension.phpt @@ -29,12 +29,8 @@ image_type_to_extension() printf("Constant: %s\n\tWith dot: %s\n\tWithout dot: %s\n", $name, image_type_to_extension($constant), image_type_to_extension($constant, false)); } - var_dump(image_type_to_extension(-1, array())); - var_dump(image_type_to_extension(new stdclass)); var_dump(image_type_to_extension(1000000, NULL)); - var_dump(image_type_to_extension()); var_dump(image_type_to_extension(0)); - var_dump(image_type_to_extension(0, 0, 0)); ?> Done --EXPECTF-- @@ -89,18 +85,6 @@ Constant: IMAGETYPE_XBM Constant: IMAGETYPE_WEBP With dot: .webp Without dot: webp - -Warning: image_type_to_extension() expects parameter 2 to be bool, array given in %s on line %d -bool(false) - -Warning: image_type_to_extension() expects parameter 1 to be int, object given in %s on line %d -bool(false) bool(false) - -Warning: image_type_to_extension() expects at least 1 parameter, 0 given in %s on line %d -bool(false) -bool(false) - -Warning: image_type_to_extension() expects at most 2 parameters, 3 given in %s on line %d bool(false) Done diff --git a/ext/standard/tests/math/acos_variation.phpt b/ext/standard/tests/math/acos_variation.phpt index 5575ec579601b..4fe8437fd581d 100644 --- a/ext/standard/tests/math/acos_variation.phpt +++ b/ext/standard/tests/math/acos_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(NAN) float(NAN) float(NAN) float(NAN) - -Warning: acos() expects parameter 1 to be float, string given in %s on line %d -NULL float(NAN) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/acosh_variation.phpt b/ext/standard/tests/math/acosh_variation.phpt index cc89ce3e7681e..12200e035cef9 100644 --- a/ext/standard/tests/math/acosh_variation.phpt +++ b/ext/standard/tests/math/acosh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(3.828168471) float(3.828168471) float(3.847562739) float(3.847562739) - -Warning: acosh() expects parameter 1 to be float, string given in %s on line %d -NULL float(7.60090221) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/asin_variation.phpt b/ext/standard/tests/math/asin_variation.phpt index c8063849fd47d..c5d170e8dbdce 100644 --- a/ext/standard/tests/math/asin_variation.phpt +++ b/ext/standard/tests/math/asin_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(NAN) float(NAN) float(NAN) float(NAN) - -Warning: asin() expects parameter 1 to be float, string given in %s on line %d -NULL float(NAN) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/asinh_variation.phpt b/ext/standard/tests/math/asinh_variation.phpt index 5e41a4590050c..2470f7d401f34 100644 --- a/ext/standard/tests/math/asinh_variation.phpt +++ b/ext/standard/tests/math/asinh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(3.829113652) float(3.829113652) float(3.848471992) float(3.848471992) - -Warning: asinh() expects parameter 1 to be float, string given in %s on line %d -NULL float(7.60090271) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/atan_variation.phpt b/ext/standard/tests/math/atan_variation.phpt index b6a9a9ec32f84..625b6d0b8312a 100644 --- a/ext/standard/tests/math/atan_variation.phpt +++ b/ext/standard/tests/math/atan_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(1.527345431) float(1.527345431) float(1.528178225) float(1.528178225) - -Warning: atan() expects parameter 1 to be float, string given in %s on line %d -NULL float(1.569796327) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/atanh_variation.phpt b/ext/standard/tests/math/atanh_variation.phpt index 2b0a4b108547f..f14406bb0d26a 100644 --- a/ext/standard/tests/math/atanh_variation.phpt +++ b/ext/standard/tests/math/atanh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(NAN) float(NAN) float(NAN) float(NAN) - -Warning: atanh() expects parameter 1 to be float, string given in %s on line %d -NULL float(NAN) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/base_convert_error.phpt b/ext/standard/tests/math/base_convert_error.phpt index f27d0a66cf9ea..7e1a12c8bc7c2 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -14,30 +14,18 @@ class classA { } -echo "Incorrect number of arguments\n"; -base_convert(); -base_convert(35); -base_convert(35,2); +echo "Incorrect input\n"; base_convert(1234, 1, 10); base_convert(1234, 10, 37); - -echo "Incorrect input\n"; base_convert(new classA(), 8, 10); ?> --EXPECTF-- *** Testing base_convert() : error conditions *** -Incorrect number of arguments - -Warning: base_convert() expects exactly 3 parameters, 0 given in %s on line %d - -Warning: base_convert() expects exactly 3 parameters, 1 given in %s on line %d - -Warning: base_convert() expects exactly 3 parameters, 2 given in %s on line %d +Incorrect input Warning: base_convert(): Invalid `from base' (1) in %s on line %d Warning: base_convert(): Invalid `to base' (37) in %s on line %d -Incorrect input Recoverable fatal error: Object of class classA could not be converted to string in %s on line %d diff --git a/ext/standard/tests/math/cos_variation.phpt b/ext/standard/tests/math/cos_variation.phpt index 6323042dc7d9a..f9d1b262460a6 100644 --- a/ext/standard/tests/math/cos_variation.phpt +++ b/ext/standard/tests/math/cos_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(-0.5328330203) float(-0.5328330203) float(-0.1117112391) float(-0.1117112391) - -Warning: cos() expects parameter 1 to be float, string given in %s on line %d -NULL float(0.5623790763) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/cosh_variation.phpt b/ext/standard/tests/math/cosh_variation.phpt index cd64670668cc5..ec58c0151f923 100644 --- a/ext/standard/tests/math/cosh_variation.phpt +++ b/ext/standard/tests/math/cosh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(4872401723) float(4872401723) float(7641446995) float(7641446995) - -Warning: cosh() expects parameter 1 to be float, string given in %s on line %d -NULL float(INF) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/deg2rad_variation.phpt b/ext/standard/tests/math/deg2rad_variation.phpt index d5f6920ea7a72..eb3c7eae0e10d 100644 --- a/ext/standard/tests/math/deg2rad_variation.phpt +++ b/ext/standard/tests/math/deg2rad_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(0.401425728) float(0.401425728) float(0.4092797096) float(0.4092797096) - -Warning: deg2rad() expects parameter 1 to be float, string given in %s on line %d -NULL float(17.45329252) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/lcg_value_basic.phpt b/ext/standard/tests/math/lcg_value_basic.phpt index 44304f24754c1..7660f67c2430d 100644 --- a/ext/standard/tests/math/lcg_value_basic.phpt +++ b/ext/standard/tests/math/lcg_value_basic.phpt @@ -21,22 +21,6 @@ if ($i != 100) { echo "PASSED\n"; } -echo "\n lcg_value error cases..\n"; -$res = lcg_value(23); - -if (is_null($res)) { - echo "PASSED\n"; -} else { - echo "FAILED\n"; -} - -$res = lcg_value(10,false); -if (is_null($res)) { - echo "PASSED\n"; -} else { - echo "FAILED\n"; -} - echo "MATHS test script completed\n"; ?> @@ -44,13 +28,5 @@ echo "MATHS test script completed\n"; MATHS test script started lcg_value tests... -PASSED - - lcg_value error cases.. - -Warning: lcg_value() expects exactly 0 parameters, 1 given in %slcg_value_basic.php on line %d -PASSED - -Warning: lcg_value() expects exactly 0 parameters, 2 given in %slcg_value_basic.php on line %d PASSED MATHS test script completed diff --git a/ext/standard/tests/math/log10_variation.phpt b/ext/standard/tests/math/log10_variation.phpt index 5304325952838..8dbea47a84637 100644 --- a/ext/standard/tests/math/log10_variation.phpt +++ b/ext/standard/tests/math/log10_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(1.361727836) float(1.361727836) float(1.370142847) float(1.370142847) - -Warning: log10() expects parameter 1 to be float, string given in %s on line %d -NULL float(3) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/log_error.phpt b/ext/standard/tests/math/log_error.phpt index 48a23df3c0e4d..7c305a4cba86c 100644 --- a/ext/standard/tests/math/log_error.phpt +++ b/ext/standard/tests/math/log_error.phpt @@ -4,13 +4,7 @@ Test log() - wrong params test log() precision=14 --FILE-- --EXPECTF-- -Warning: log() expects at least 1 parameter, 0 given in %s on line %d - -Warning: log() expects at most 2 parameters, 3 given in %s on line %d - Warning: log(): base must be greater than 0 in %s on line %d diff --git a/ext/standard/tests/math/rad2deg_variation.phpt b/ext/standard/tests/math/rad2deg_variation.phpt index 596a1940a41d2..6ea7d0c8a4598 100644 --- a/ext/standard/tests/math/rad2deg_variation.phpt +++ b/ext/standard/tests/math/rad2deg_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(1317.802929) float(1317.802929) float(1343.58603) float(1343.58603) - -Warning: rad2deg() expects parameter 1 to be float, string given in %s on line %d -NULL float(57295.77951) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/sin_variation.phpt b/ext/standard/tests/math/sin_variation.phpt index 5b635dfbdcc2a..d044a16b405e2 100644 --- a/ext/standard/tests/math/sin_variation.phpt +++ b/ext/standard/tests/math/sin_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(-0.8462204042) float(-0.8462204042) float(-0.9937407102) float(-0.9937407102) - -Warning: sin() expects parameter 1 to be float, string given in %s on line %d -NULL float(0.8268795405) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/sinh_variation.phpt b/ext/standard/tests/math/sinh_variation.phpt index e47e94d629f9f..5e576f447f68e 100644 --- a/ext/standard/tests/math/sinh_variation.phpt +++ b/ext/standard/tests/math/sinh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(4872401723) float(4872401723) float(7641446995) float(7641446995) - -Warning: sinh() expects parameter 1 to be float, string given in %s on line %d -NULL float(INF) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/sqrt_variation.phpt b/ext/standard/tests/math/sqrt_variation.phpt index 7369b98dfdac1..6e2304b437d74 100644 --- a/ext/standard/tests/math/sqrt_variation.phpt +++ b/ext/standard/tests/math/sqrt_variation.phpt @@ -22,7 +22,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -47,9 +46,6 @@ float(4.7958315233127) float(4.7958315233127) float(4.8425200051213) float(4.8425200051213) - -Warning: sqrt() expects parameter 1 to be float, string given in %s on line %d -NULL float(31.622776601684) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/tan_variation.phpt b/ext/standard/tests/math/tan_variation.phpt index 81546bbf6fa9b..2c9ede47387ec 100644 --- a/ext/standard/tests/math/tan_variation.phpt +++ b/ext/standard/tests/math/tan_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(1.588153083) float(1.588153083) float(8.895619796) float(8.895619796) - -Warning: tan() expects parameter 1 to be float, string given in %s on line %d -NULL float(1.470324156) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/math/tanh_variation.phpt b/ext/standard/tests/math/tanh_variation.phpt index b1b477c150bc9..907f802b8a328 100644 --- a/ext/standard/tests/math/tanh_variation.phpt +++ b/ext/standard/tests/math/tanh_variation.phpt @@ -21,7 +21,6 @@ $values = array(23, "23", "23.45", "2.345e1", - "nonsense", "1000", "1000ABC", null, @@ -44,9 +43,6 @@ float(1) float(1) float(1) float(1) - -Warning: tanh() expects parameter 1 to be float, string given in %s on line %d -NULL float(1) Notice: A non well formed numeric value encountered in %s on line %d diff --git a/ext/standard/tests/misc/get_browser_error.phpt b/ext/standard/tests/misc/get_browser_error.phpt index 049c8b9431ce6..cf15e3c5ef3bf 100644 --- a/ext/standard/tests/misc/get_browser_error.phpt +++ b/ext/standard/tests/misc/get_browser_error.phpt @@ -30,9 +30,6 @@ echo "*** Testing get_browser() : error functionality ***\n"; /* Unknown browser uses defaults. */ var_dump( get_browser( 'foobar', true ) ); -/* More than expected arguments */ -var_dump( get_browser( 'foobar', true, 15 ) ); - /* Some wrong parameters, no HTTP_USER_AGENT set */ var_dump( get_browser( null, 'foobar' ) ); @@ -111,9 +108,6 @@ array(34) { string(1) "0" } -Warning: get_browser() expects at most 2 parameters, 3 given in %s on line %d -NULL - Warning: get_browser(): HTTP_USER_AGENT variable is not set, cannot determine user agent name in %s on line %d bool(false) ===DONE=== diff --git a/ext/standard/tests/network/fsockopen_error.phpt b/ext/standard/tests/network/fsockopen_error.phpt index 638412b47f4da..ea08335f2df4a 100644 --- a/ext/standard/tests/network/fsockopen_error.phpt +++ b/ext/standard/tests/network/fsockopen_error.phpt @@ -11,21 +11,6 @@ Test fsockopen() function : error conditions echo "*** Testing fsockopen() : basic error conditions ***\n"; - -echo "\n-- Testing fsockopen() function with more than expected no. of arguments --\n"; -$hostname = 'string_val'; -$port = 10; -$errno = 10; -$errstr = 'string_val'; -$timeout = 10.5; -$extra_arg = 10; -var_dump( fsockopen($hostname, $port, $errno, $errstr, $timeout, $extra_arg) ); -var_dump($errstr); -var_dump($errno); - -echo "\n-- Testing fsockopen() function with less than expected no. of arguments --\n"; -var_dump( fsockopen() ); - echo "\n-- Attempting to connect to a non-existent socket --\n"; $hostname = 'tcp://127.0.0.1'; // loopback address $port = 31337; @@ -49,18 +34,6 @@ echo "Done"; --EXPECTF-- *** Testing fsockopen() : basic error conditions *** --- Testing fsockopen() function with more than expected no. of arguments -- - -Warning: fsockopen() expects at most 5 parameters, 6 given in %s on line %d -bool(false) -string(10) "string_val" -int(10) - --- Testing fsockopen() function with less than expected no. of arguments -- - -Warning: fsockopen() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - -- Attempting to connect to a non-existent socket -- Warning: fsockopen(): unable to connect to tcp://127.0.0.1:31337 (%a) in %s on line %d diff --git a/ext/standard/tests/network/gethostbyaddr_error.phpt b/ext/standard/tests/network/gethostbyaddr_error.phpt index f7982d5ca4711..a33a71185f65c 100644 --- a/ext/standard/tests/network/gethostbyaddr_error.phpt +++ b/ext/standard/tests/network/gethostbyaddr_error.phpt @@ -11,16 +11,6 @@ Test gethostbyaddr() function : error conditions echo "Testing gethostbyaddr : error conditions\n"; -// Zero arguments -echo "\n-- Testing gethostbyaddr function with Zero arguments --\n"; -var_dump( gethostbyaddr() ); - -//Test gethostbyaddr with one more than the expected number of arguments -echo "\n-- Testing gethostbyaddr function with more than expected no. of arguments --\n"; -$ip_address = 'string_val'; -$extra_arg = 10; -var_dump( gethostbyaddr($ip_address, $extra_arg) ); - echo "\n-- Testing gethostbyaddr function with invalid addresses --\n"; $ip_address = 'invalid'; @@ -37,16 +27,6 @@ echo "Done"; --EXPECTREGEX-- Testing gethostbyaddr : error conditions --- Testing gethostbyaddr function with Zero arguments -- - -Warning: gethostbyaddr\(\) expects exactly 1 parameter, 0 given in .* on line \d+ -NULL - --- Testing gethostbyaddr function with more than expected no. of arguments -- - -Warning: gethostbyaddr\(\) expects exactly 1 parameter, 2 given in .* on line \d+ -NULL - -- Testing gethostbyaddr function with invalid addresses -- Warning: gethostbyaddr\(\): Address is not (in a.b.c.d form|a valid IPv4 or IPv6 address) in .* on line \d+ diff --git a/ext/standard/tests/network/gethostname.phpt b/ext/standard/tests/network/gethostname.phpt index e7caaf48eb2e2..57f4c498d0f0e 100644 --- a/ext/standard/tests/network/gethostname.phpt +++ b/ext/standard/tests/network/gethostname.phpt @@ -5,10 +5,6 @@ marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao p --FILE-- --EXPECTF-- -%s - -Warning: gethostname() expects exactly %d parameters, %d given in %s on line %d -NULL +string(%d) "%s" diff --git a/ext/standard/tests/network/getprotobyname_error.phpt b/ext/standard/tests/network/getprotobyname_error.phpt index 7ee366ac7afc1..52ef3b8ee08e0 100644 --- a/ext/standard/tests/network/getprotobyname_error.phpt +++ b/ext/standard/tests/network/getprotobyname_error.phpt @@ -4,13 +4,8 @@ getprotobyname function errors test edgarsandi - --FILE-- ---EXPECTF-- -Warning: getprotobyname() expects exactly 1 parameter, 0 given in %s on line %d -NULL +--EXPECT-- bool(false) diff --git a/ext/standard/tests/network/getprotobynumber_error.phpt b/ext/standard/tests/network/getprotobynumber_error.phpt index 7df12e864a92a..dda2661b5adad 100644 --- a/ext/standard/tests/network/getprotobynumber_error.phpt +++ b/ext/standard/tests/network/getprotobynumber_error.phpt @@ -4,13 +4,8 @@ getprotobynumber function errors test edgarsandi - --FILE-- ---EXPECTF-- -Warning: getprotobynumber() expects exactly 1 parameter, 0 given in %s on line %d -NULL +--EXPECT-- bool(false) diff --git a/ext/standard/tests/network/inet.phpt b/ext/standard/tests/network/inet.phpt index a1e70a002038b..81db0016b57c0 100644 --- a/ext/standard/tests/network/inet.phpt +++ b/ext/standard/tests/network/inet.phpt @@ -14,12 +14,10 @@ var_dump(inet_ntop($packed)); $packed = chr(255) . chr(255) . chr(255) . chr(0); var_dump(inet_ntop($packed)); -var_dump(inet_ntop()); var_dump(inet_ntop(-1)); var_dump(inet_ntop("")); var_dump(inet_ntop("blah-blah")); -var_dump(inet_pton()); var_dump(inet_pton("")); var_dump(inet_pton(-1)); var_dump(inet_pton("abra")); @@ -40,15 +38,9 @@ echo "Done\n"; --EXPECTF-- string(9) "127.0.0.1" string(13) "255.255.255.0" - -Warning: inet_ntop() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) bool(false) bool(false) bool(false) - -Warning: inet_pton() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) bool(false) bool(false) bool(false) diff --git a/ext/standard/tests/network/ip.phpt b/ext/standard/tests/network/ip.phpt index 5237c89776956..831eee018a66c 100644 --- a/ext/standard/tests/network/ip.phpt +++ b/ext/standard/tests/network/ip.phpt @@ -21,16 +21,11 @@ foreach ($array as $ip) { var_dump(long2ip($long)); } -var_dump(ip2long()); var_dump(ip2long("")); var_dump(ip2long("777.777.777.777")); var_dump(ip2long("111.111.111.111")); -var_dump(ip2long(array())); -var_dump(long2ip()); var_dump(long2ip(-110000)); -var_dump(long2ip("")); -var_dump(long2ip(array())); echo "Done\n"; ?> @@ -47,23 +42,8 @@ int(0) string(7) "0.0.0.0" int(1118019956) string(14) "66.163.161.116" - -Warning: ip2long() expects exactly 1 parameter, 0 given in %sip.php on line %d -NULL bool(false) bool(false) int(1869573999) - -Warning: ip2long() expects parameter 1 to be string, array given in %sip.php on line %d -NULL - -Warning: long2ip() expects exactly 1 parameter, 0 given in %sip.php on line %d -NULL string(13) "255.254.82.80" - -Warning: long2ip() expects parameter 1 to be int, string given in %sip.php on line %d -NULL - -Warning: long2ip() expects parameter 1 to be int, array given in %sip.php on line %d -NULL Done diff --git a/ext/standard/tests/network/ip_x86_64.phpt b/ext/standard/tests/network/ip_x86_64.phpt index 3c530b8371352..06ed1549a60f8 100644 --- a/ext/standard/tests/network/ip_x86_64.phpt +++ b/ext/standard/tests/network/ip_x86_64.phpt @@ -21,16 +21,11 @@ foreach ($array as $ip) { var_dump(long2ip($long)); } -var_dump(ip2long()); var_dump(ip2long("")); var_dump(ip2long("777.777.777.777")); var_dump(ip2long("111.111.111.111")); -var_dump(ip2long(array())); -var_dump(long2ip()); var_dump(long2ip(-110000)); -var_dump(long2ip("")); -var_dump(long2ip(array())); echo "Done\n"; ?> @@ -47,23 +42,8 @@ int(0) string(7) "0.0.0.0" int(1118019956) string(14) "66.163.161.116" - -Warning: ip2long() expects exactly 1 parameter, 0 given in %sip_x86_64.php on line %d -NULL bool(false) bool(false) int(1869573999) - -Warning: ip2long() expects parameter 1 to be string, array given in %sip_x86_64.php on line %d -NULL - -Warning: long2ip() expects exactly 1 parameter, 0 given in %sip_x86_64.php on line %d -NULL string(13) "255.254.82.80" - -Warning: long2ip() expects parameter 1 to be int, string given in %sip_x86_64.php on line %d -NULL - -Warning: long2ip() expects parameter 1 to be int, array given in %sip_x86_64.php on line %d -NULL Done diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt index 89ca127bc42b1..04a8249ced727 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -4,25 +4,31 @@ Test error operation of password_hash() getMessage(), "\n"; +} var_dump(password_hash("foo", array())); var_dump(password_hash("foo", 19, new StdClass)); -var_dump(password_hash("foo", PASSWORD_BCRYPT, "baz")); +try { + var_dump(password_hash("foo", PASSWORD_BCRYPT, "baz")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} -var_dump(password_hash(array(), PASSWORD_BCRYPT)); +try { + var_dump(password_hash(array(), PASSWORD_BCRYPT)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- -Warning: password_hash() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: password_hash() expects at least 2 parameters, 1 given in %s on line %d -NULL +password_hash() expects at least 2 parameters, 1 given Notice: Array to string conversion in %s on line %d @@ -31,9 +37,5 @@ NULL Warning: password_hash(): Unknown password hashing algorithm: 19 in %s on line %d NULL - -Warning: password_hash() expects parameter 3 to be array, string given in %s on line %d -NULL - -Warning: password_hash() expects parameter 1 to be string, array given in %s on line %d -NULL +password_hash() expects parameter 3 to be array, string given +password_hash() expects parameter 1 to be string, array given diff --git a/ext/standard/tests/password/password_needs_rehash_error.phpt b/ext/standard/tests/password/password_needs_rehash_error.phpt index 7180d11de7b9e..f64723ee856d7 100644 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ b/ext/standard/tests/password/password_needs_rehash_error.phpt @@ -3,29 +3,32 @@ Test error operation of password_needs_rehash() --FILE-- getMessage(), "\n"; +} var_dump(password_needs_rehash('', [])); -var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT)); +try { + var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} -var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo")); +try { + var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo")); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "OK!"; ?> --EXPECTF-- -Warning: password_needs_rehash() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: password_needs_rehash() expects at least 2 parameters, 1 given in %s on line %d -NULL +password_needs_rehash() expects at least 2 parameters, 1 given bool(false) - -Warning: password_needs_rehash() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: password_needs_rehash() expects parameter 3 to be array, string given in %s on line %d -NULL +password_needs_rehash() expects parameter 1 to be string, array given +password_needs_rehash() expects parameter 3 to be array, string given OK! diff --git a/ext/standard/tests/password/password_verify_error.phpt b/ext/standard/tests/password/password_verify_error.phpt index 7f680af4484cb..192a4ae288d49 100644 --- a/ext/standard/tests/password/password_verify_error.phpt +++ b/ext/standard/tests/password/password_verify_error.phpt @@ -4,14 +4,12 @@ Test error operation of password_verify() getMessage(), "\n"; +} ?> ---EXPECTF-- -Warning: password_verify() expects exactly 2 parameters, 0 given in %s on line %d -bool(false) - -Warning: password_verify() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) +--EXPECT-- +password_verify() expects exactly 2 parameters, 1 given diff --git a/ext/standard/tests/streams/bug46426.phpt b/ext/standard/tests/streams/bug46426.phpt index 8c95ea456e527..b69c6c557b5ee 100644 --- a/ext/standard/tests/streams/bug46426.phpt +++ b/ext/standard/tests/streams/bug46426.phpt @@ -21,8 +21,6 @@ echo stream_get_contents($tmp, 1, 0); echo "\n"; echo stream_get_contents($tmp, -1); -@unlink($tmp); - ?> --EXPECT-- 23 diff --git a/ext/standard/tests/streams/stream_get_contents_001.phpt b/ext/standard/tests/streams/stream_get_contents_001.phpt index dc7fcb239c00e..6f5abcb782d6e 100644 --- a/ext/standard/tests/streams/stream_get_contents_001.phpt +++ b/ext/standard/tests/streams/stream_get_contents_001.phpt @@ -12,8 +12,6 @@ echo stream_get_contents($tmp, 2), "--\n"; echo stream_get_contents($tmp, 2, 3), "--\n"; echo stream_get_contents($tmp, 2, -1), "--\n"; -@unlink($tmp); - ?> --EXPECT-- -- diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt index bb98d7c6e796a..5530322fec930 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt @@ -10,21 +10,6 @@ Test stream_get_meta_data() function : error conditions echo "*** Testing stream_get_meta_data() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing stream_get_meta_data() function with Zero arguments --\n"; -var_dump( stream_get_meta_data() ); - -//Test stream_get_meta_data with one more than the expected number of arguments -echo "\n-- Testing stream_get_meta_data() function with more than expected no. of arguments --\n"; - -$fp = null; -$extra_arg = 10; -var_dump( stream_get_meta_data($fp, $extra_arg) ); - -echo "\n-- Testing stream_get_meta_data() function with invalid stream resource --\n"; -$fp = null; -var_dump(stream_get_meta_data($fp)); - echo "\n-- Testing stream_get_meta_data() function with closed stream resource --\n"; $fp = fopen(__FILE__, 'r'); fclose($fp); @@ -35,21 +20,6 @@ echo "Done"; --EXPECTF-- *** Testing stream_get_meta_data() : error conditions *** --- Testing stream_get_meta_data() function with Zero arguments -- - -Warning: stream_get_meta_data() expects exactly 1 parameter, 0 given in %s on line %d -NULL - --- Testing stream_get_meta_data() function with more than expected no. of arguments -- - -Warning: stream_get_meta_data() expects exactly 1 parameter, 2 given in %s on line %d -NULL - --- Testing stream_get_meta_data() function with invalid stream resource -- - -Warning: stream_get_meta_data() expects parameter 1 to be resource, null given in %s on line %d -NULL - -- Testing stream_get_meta_data() function with closed stream resource -- Warning: stream_get_meta_data(): supplied resource is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/streams/stream_resolve_include_path.phpt b/ext/standard/tests/streams/stream_resolve_include_path.phpt index 4109b5672e887..f77c0730f3d53 100644 --- a/ext/standard/tests/streams/stream_resolve_include_path.phpt +++ b/ext/standard/tests/streams/stream_resolve_include_path.phpt @@ -14,8 +14,6 @@ mkdir($include_path_nested); file_put_contents($include_path_file, 'include_path'); file_put_contents($include_path_nested_file, 'include_path'); -var_dump(stream_resolve_include_path()); - set_include_path($include_path . PATH_SEPARATOR . $include_path_nested); var_dump(stream_resolve_include_path('file-does-not-exist')); @@ -24,13 +22,20 @@ var_dump(stream_resolve_include_path('file')); set_include_path($include_path_nested . PATH_SEPARATOR . $include_path); var_dump(stream_resolve_include_path('file')); +?> +--CLEAN-- + --EXPECTF-- -Warning: stream_resolve_include_path() expects exactly 1 parameter, 0 given in %s on line %d -NULL bool(false) string(%d) "%stest_path%sfile" string(%d) "%stest_path%snested%sfile" diff --git a/ext/standard/tests/streams/stream_set_chunk_size.phpt b/ext/standard/tests/streams/stream_set_chunk_size.phpt index 8c2ae9865bd8d..851fd2cfcff12 100644 --- a/ext/standard/tests/streams/stream_set_chunk_size.phpt +++ b/ext/standard/tests/streams/stream_set_chunk_size.phpt @@ -51,7 +51,6 @@ var_dump(strlen(fwrite($f, str_repeat('b', 250)))); echo "\nerror conditions\n"; var_dump(stream_set_chunk_size($f, 0)); var_dump(stream_set_chunk_size($f, -1)); -var_dump(stream_set_chunk_size($f, array())); --EXPECTF-- bool(true) should return previous chunk size (8192) @@ -87,6 +86,3 @@ bool(false) Warning: stream_set_chunk_size(): The chunk size must be a positive integer, given -1 in %s on line %d bool(false) - -Warning: stream_set_chunk_size() expects parameter 2 to be int, array given in %s on line %d -bool(false) diff --git a/ext/standard/tests/streams/stream_set_timeout_error.phpt b/ext/standard/tests/streams/stream_set_timeout_error.phpt index 0334b951e02f5..6c5b992dd51fd 100644 --- a/ext/standard/tests/streams/stream_set_timeout_error.phpt +++ b/ext/standard/tests/streams/stream_set_timeout_error.phpt @@ -10,9 +10,6 @@ Test stream_set_timeout() function : error conditions echo "*** Testing stream_set_timeout() : error conditions ***\n"; -//Test stream_set_timeout with one more than the expected number of arguments -echo "\n-- Testing stream_set_timeout() function with more than expected no. of arguments --\n"; - for ($i=0; $i<100; $i++) { $port = rand(10000, 65000); /* Setup socket server */ @@ -26,23 +23,11 @@ $client = fsockopen("tcp://127.0.0.1:$port"); $seconds = 10; $microseconds = 10; -$extra_arg = 10; -var_dump( stream_set_timeout($client, $seconds, $microseconds, $extra_arg) ); - -// Testing stream_set_timeout with one less than the expected number of arguments -echo "\n-- Testing stream_set_timeout() function with less than expected no. of arguments --\n"; - -$seconds = 10; -var_dump( stream_set_timeout($client) ); - echo "\n-- Testing stream_set_timeout() function with a closed socket --\n"; fclose($client); var_dump( stream_set_timeout($client, $seconds) ); -echo "\n-- Testing stream_set_timeout() function with an invalid stream --\n"; -var_dump( stream_set_timeout($seconds, $seconds) ); - echo "\n-- Testing stream_set_timeout() function with a stream that does not support timeouts --\n"; $filestream = fopen(__FILE__, "r"); var_dump( stream_set_timeout($filestream, $seconds) ); @@ -55,26 +40,11 @@ echo "Done"; --EXPECTF-- *** Testing stream_set_timeout() : error conditions *** --- Testing stream_set_timeout() function with more than expected no. of arguments -- - -Warning: stream_set_timeout() expects at most 3 parameters, 4 given in %s on line %d -NULL - --- Testing stream_set_timeout() function with less than expected no. of arguments -- - -Warning: stream_set_timeout() expects at least 2 parameters, 1 given in %s on line %d -NULL - -- Testing stream_set_timeout() function with a closed socket -- Warning: stream_set_timeout(): supplied resource is not a valid stream resource in %s on line %d bool(false) --- Testing stream_set_timeout() function with an invalid stream -- - -Warning: stream_set_timeout() expects parameter 1 to be resource, int given in %s on line %d -NULL - -- Testing stream_set_timeout() function with a stream that does not support timeouts -- bool(false) Done diff --git a/ext/standard/tests/streams/stream_socket_sendto.phpt b/ext/standard/tests/streams/stream_socket_sendto.phpt index 2812d30930eb3..ab223f4314616 100644 --- a/ext/standard/tests/streams/stream_socket_sendto.phpt +++ b/ext/standard/tests/streams/stream_socket_sendto.phpt @@ -16,8 +16,6 @@ $sock = stream_socket_server($serverUri, $errno, $errstr); if (is_resource($sock)) { fwrite($sock, $stringFWrite); - var_dump(stream_socket_sendto()); - var_dump(stream_socket_sendto($sock)); var_dump(stream_socket_sendto($sock, $stringSocket)); var_dump(stream_socket_sendto($sock, $stringSocket, STREAM_OOB)); var_dump(stream_socket_sendto($sock, $stringSocket, STREAM_OOB, $serverUri)); @@ -29,12 +27,6 @@ if (is_resource($sock)) { --EXPECTF-- Notice: fwrite(): send of %i bytes failed with errno=%i Broken pipe in %s on line %d -Warning: stream_socket_sendto() expects at least %i parameters, %i given in %s on line %d -bool(%s) - -Warning: stream_socket_sendto() expects at least %i parameters, %i given in %s on line %d -bool(%s) - Warning: stream_socket_sendto(): Broken pipe in %s on line %d int(%i) diff --git a/ext/standard/tests/strings/addcslashes_001.phpt b/ext/standard/tests/strings/addcslashes_001.phpt index 4080c7214d76d..5b60f6168dd2b 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/bug54322.phpt b/ext/standard/tests/strings/bug54322.phpt index 6b8d10daa71e9..f31f94fd84b70 100644 --- a/ext/standard/tests/strings/bug54322.phpt +++ b/ext/standard/tests/strings/bug54322.phpt @@ -2,9 +2,11 @@ Bug #54322: Null pointer deref in get_html_translation_table due to information loss in long-to-int conversion --FILE-- 0 -); ---EXPECTF-- -Warning: get_html_translation_table() expects parameter 1 to be int, float given in %s on line %d -bool(false) +try { + var_dump(get_html_translation_table(NAN, 0, "UTF-8") > 0); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +?> +--EXPECT-- +get_html_translation_table() expects parameter 1 to be int, float given diff --git a/ext/standard/tests/strings/chr_error.phpt b/ext/standard/tests/strings/chr_error.phpt index d5fb97455921b..7f089ac5b5aa3 100644 --- a/ext/standard/tests/strings/chr_error.phpt +++ b/ext/standard/tests/strings/chr_error.phpt @@ -11,11 +11,19 @@ Test chr() function : error conditions echo "*** Testing chr() : error conditions ***\n"; echo "\n-- Testing chr() function with no arguments --\n"; -var_dump( chr() ); +try { + var_dump( chr() ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "\n-- Testing chr() function with more than expected no. of arguments --\n"; $extra_arg = 10; -var_dump( chr(72, $extra_arg) ); +try { + var_dump( chr(72, $extra_arg) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ===DONE=== @@ -23,12 +31,8 @@ var_dump( chr(72, $extra_arg) ); *** Testing chr() : error conditions *** -- Testing chr() function with no arguments -- - -Warning: Wrong parameter count for chr() in %s on line %d -NULL +Wrong parameter count for chr() -- Testing chr() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for chr() in %s on line %d -NULL +Wrong parameter count for chr() ===DONE=== diff --git a/ext/standard/tests/strings/chr_ord.phpt b/ext/standard/tests/strings/chr_ord.phpt index be0b1a32da543..43e31a20f374c 100644 Binary files a/ext/standard/tests/strings/chr_ord.phpt and b/ext/standard/tests/strings/chr_ord.phpt differ diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt index 8a5a8cd6bb04b..8650f2cb92f80 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 bfafd1af0b38e..9804ee21e13f7 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -46,7 +46,11 @@ $values = array ( // loop through each element of values for 'chunklen' for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count+1). " --\n"; - var_dump( chunk_split($heredoc_str, $values[$count], $ending) ); + try { + var_dump( chunk_split($heredoc_str, $values[$count], $ending) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } echo "Done" @@ -82,9 +86,7 @@ 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 -- - -Warning: chunk_split() expects parameter 2 to be int, float given in %s on line %d -NULL +chunk_split() expects parameter 2 to be int, float given -- Iteration 8 -- Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d diff --git a/ext/standard/tests/strings/convert_cyr_string.phpt b/ext/standard/tests/strings/convert_cyr_string.phpt index af239543c5e9f..a1473ad31651c 100644 --- a/ext/standard/tests/strings/convert_cyr_string.phpt +++ b/ext/standard/tests/strings/convert_cyr_string.phpt @@ -3,11 +3,7 @@ basic convert_cyr_string() tests --FILE-- --EXPECTF-- -Warning: convert_cyr_string() expects exactly 3 parameters, 0 given in %s on line %d -NULL - -Warning: convert_cyr_string() expects exactly 3 parameters, 1 given in %s on line %d -NULL - -Warning: convert_cyr_string() expects exactly 3 parameters, 2 given in %s on line %d -NULL - Warning: convert_cyr_string(): Unknown source charset: in %s on line %d Warning: convert_cyr_string(): Unknown destination charset: in %s on line %d string(0) "" -Warning: convert_cyr_string() expects parameter 1 to be string, array given in %s on line %d -NULL - Warning: convert_cyr_string(): Unknown source charset: q in %s on line %d string(6) "[[[[[[" string(6) "[[[[[[" diff --git a/ext/standard/tests/strings/convert_cyr_string_error.phpt b/ext/standard/tests/strings/convert_cyr_string_error.phpt index 66effea43027b..6ac438efaff22 100644 --- a/ext/standard/tests/strings/convert_cyr_string_error.phpt +++ b/ext/standard/tests/strings/convert_cyr_string_error.phpt @@ -15,15 +15,6 @@ $extra_arg = 10; echo "*** Testing convert_cyr_string() : error conditions ***\n"; -echo "\n-- Testing convert_cyr_string() function with no arguments --\n"; -var_dump( convert_cyr_string() ); - -echo "\n-- Testing convert_cyr_string() function with no 'to' character set --\n"; -var_dump( convert_cyr_string($str, $from) ); - -echo "\n-- Testing convert_cyr_string() function with more than expected no. of arguments --\n"; -var_dump( convert_cyr_string($str, $from, $to, $extra_arg) ); - echo "\n-- Testing convert_cyr_string() function with invalid 'from' character set --\n"; var_dump(bin2hex( convert_cyr_string($str, "?", $to) )); @@ -38,21 +29,6 @@ var_dump(bin2hex( convert_cyr_string($str, ">", "?")) ); --EXPECTF-- *** Testing convert_cyr_string() : error conditions *** --- Testing convert_cyr_string() function with no arguments -- - -Warning: convert_cyr_string() expects exactly 3 parameters, 0 given in %s on line %d -NULL - --- Testing convert_cyr_string() function with no 'to' character set -- - -Warning: convert_cyr_string() expects exactly 3 parameters, 2 given in %s on line %d -NULL - --- Testing convert_cyr_string() function with more than expected no. of arguments -- - -Warning: convert_cyr_string() expects exactly 3 parameters, 4 given in %s on line %d -NULL - -- Testing convert_cyr_string() function with invalid 'from' character set -- Warning: convert_cyr_string(): Unknown source charset: ? in %s on line %d diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt index f64b61cb5ff28..270f0372d13fd 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -19,8 +19,6 @@ echo (CRYPT_MD5) ? ((crypt($str, $salt3) === $res_3) ? 'MD5' : 'MD5 - ERROR echo (CRYPT_BLOWFISH) ? ((crypt($str, $salt4) === $res_4) ? 'BLO' : 'BLO - ERROR') : 'BLO', "\n"; var_dump(crypt($str)); -var_dump(crypt()); -var_dump(crypt("", "", "")); ?> --EXPECTF-- @@ -31,9 +29,3 @@ BLO Notice: crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash. in %s on line %d string(%d) "%s" - -Warning: crypt() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: crypt() expects at most 2 parameters, 3 given in %s on line %d -NULL diff --git a/ext/standard/tests/strings/dirname_error.phpt b/ext/standard/tests/strings/dirname_error.phpt index 98a9ea5b45671..79fac300297fe 100644 --- a/ext/standard/tests/strings/dirname_error.phpt +++ b/ext/standard/tests/strings/dirname_error.phpt @@ -6,26 +6,15 @@ Test dirname() function : error conditions Description: Returns directory name component of path. */ echo "*** Testing error conditions ***\n"; -// zero arguments -var_dump( dirname() ); // Bad arg var_dump( dirname("/var/tmp/bar.gz", 0) ); -// more than expected no. of arguments -var_dump( dirname("/var/tmp/bar.gz", 1, ".gz") ); - echo "Done\n"; ?> --EXPECTF-- *** Testing error conditions *** -Warning: dirname() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: dirname(): Invalid argument, levels must be >= 1 in %s on line %d NULL - -Warning: dirname() expects at most 2 parameters, 3 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/strings/explode1.phpt b/ext/standard/tests/strings/explode1.phpt index 68429476057de..de3049a47b3a8 100644 --- a/ext/standard/tests/strings/explode1.phpt +++ b/ext/standard/tests/strings/explode1.phpt @@ -77,11 +77,6 @@ class string1 { $obj = new string1; var_dump( explode("b", $obj) ); -echo "\n*** Testing error conditions ***\n"; -/* checking for arguments <2 and >3 */ -var_dump( explode(":", "array1:array2:array3", -1, -33) ); -var_dump( explode(":") ); - echo "Done\n"; ?> --EXPECTF-- @@ -498,12 +493,4 @@ array(2) { [1]=> string(4) "ject" } - -*** Testing error conditions *** - -Warning: explode() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: explode() expects at least 2 parameters, 1 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/strings/fprintf_error.phpt b/ext/standard/tests/strings/fprintf_error.phpt index ccc37407e82b4..1ffc188051167 100644 --- a/ext/standard/tests/strings/fprintf_error.phpt +++ b/ext/standard/tests/strings/fprintf_error.phpt @@ -7,25 +7,31 @@ Test fprintf() function (errors) echo "*** Testing Error Conditions ***\n"; /* zero argument */ -var_dump( fprintf() ); +try { + var_dump( fprintf() ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} /* scalar argument */ -var_dump( fprintf(3) ); +try { + var_dump( fprintf(3) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} /* NULL argument */ -var_dump( fprintf(NULL) ); +try { + var_dump( fprintf(NULL) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done\n"; ?> --EXPECTF-- *** Testing Error Conditions *** - -Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d -NULL - -Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d -NULL - -Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d -NULL +Wrong parameter count for fprintf() +Wrong parameter count for fprintf() +Wrong parameter count for fprintf() Done diff --git a/ext/standard/tests/strings/highlight_file.phpt b/ext/standard/tests/strings/highlight_file.phpt index 65636908e612f..10ea752291ddd 100644 --- a/ext/standard/tests/strings/highlight_file.phpt +++ b/ext/standard/tests/strings/highlight_file.phpt @@ -13,7 +13,6 @@ allow_url_fopen=1 $filename = dirname(__FILE__)."/highlight_file.dat"; -var_dump(highlight_file()); var_dump(highlight_file($filename)); var_dump(highlight_file('data:,')); @@ -37,9 +36,6 @@ var_dump(highlight_file($filename)); echo "Done\n"; ?> --EXPECTF-- -Warning: highlight_file() expects at least 1 parameter, 0 given in %s on line %d -bool(false) - Warning: highlight_file(%shighlight_file.dat): failed to open stream: No such file or directory in %s on line %d Warning: highlight_file(): Failed opening '%shighlight_file.dat' for highlighting in %s on line %d diff --git a/ext/standard/tests/strings/htmlentities24.phpt b/ext/standard/tests/strings/htmlentities24.phpt index 5a023df7011ce..f2abfd5ba81c1 100644 --- a/ext/standard/tests/strings/htmlentities24.phpt +++ b/ext/standard/tests/strings/htmlentities24.phpt @@ -35,12 +35,6 @@ var_dump( htmlentities($str, ENT_QUOTES) ); var_dump( htmlentities($str, ENT_NOQUOTES) ); var_dump( htmlentities($str, ENT_COMPAT) ); -echo "\n*** Testing error conditions ***\n"; -/* zero argument */ -var_dump( htmlentities() ); -/* arguments more than expected */ -var_dump( htmlentities("\x84\x91",ENT_QUOTES, 'cp1252', "test1") ); - echo "Done\n"; ?> --EXPECTF-- @@ -320,10 +314,4 @@ string(36) "A 'quote' is <b>bold</b>" string(46) "A 'quote' is <b>bold</b>" string(36) "A 'quote' is <b>bold</b>" string(36) "A 'quote' is <b>bold</b>" - -*** Testing error conditions *** - -Warning: htmlentities() expects at least 1 parameter, 0 given in %s on line %d -NULL -string(14) "„‘" Done diff --git a/ext/standard/tests/strings/htmlspecialchars.phpt b/ext/standard/tests/strings/htmlspecialchars.phpt index 8506c73e72ce1..6e5c5fac36a58 100644 --- a/ext/standard/tests/strings/htmlspecialchars.phpt +++ b/ext/standard/tests/strings/htmlspecialchars.phpt @@ -35,13 +35,6 @@ var_dump( htmlspecialchars($str, ENT_QUOTES) ); var_dump( htmlspecialchars($str, ENT_NOQUOTES) ); var_dump( htmlspecialchars($str, ENT_COMPAT) ); -echo "\n*** Testing error conditions ***\n"; -/* zero argument */ -var_dump( htmlspecialchars() ); - -/* giving arguments more than expected */ -var_dump( htmlspecialchars("
",ENT_QUOTES,'iso-8859-1', "test2") ); - echo "Done\n" ?> --EXPECTF-- @@ -321,10 +314,4 @@ string(36) "A 'quote' is <b>bold</b>" string(46) "A 'quote' is <b>bold</b>" string(36) "A 'quote' is <b>bold</b>" string(36) "A 'quote' is <b>bold</b>" - -*** Testing error conditions *** - -Warning: htmlspecialchars() expects at least 1 parameter, 0 given in %s on line %d -NULL -string(10) "<br>" Done diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt index d5de391e9677b..9d9afc6f3c8e7 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_error.phpt b/ext/standard/tests/strings/join_error.phpt index 36ee9d7ba6cfc..832fb58c05aa0 100644 --- a/ext/standard/tests/strings/join_error.phpt +++ b/ext/standard/tests/strings/join_error.phpt @@ -10,18 +10,6 @@ Test join() function: error conditions echo "*** Testing join() : error conditions ***\n"; -// Zero argument -echo "\n-- Testing join() function with Zero arguments --\n"; -var_dump( join() ); - -// More than expected number of arguments -echo "\n-- Testing join() function with more than expected no. of arguments --\n"; -$glue = 'string_val'; -$pieces = array(1, 2); -$extra_arg = 10; - -var_dump( join($glue, $pieces, $extra_arg) ); - // Less than expected number of arguments echo "\n-- Testing join() with less than expected no. of arguments --\n"; $glue = 'string_val'; @@ -33,16 +21,6 @@ echo "Done\n"; --EXPECTF-- *** Testing join() : error conditions *** --- Testing join() function with Zero arguments -- - -Warning: join() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing join() function with more than expected no. of arguments -- - -Warning: join() expects at most 2 parameters, 3 given in %s on line %d -NULL - -- Testing join() with less than expected no. of arguments -- Warning: join(): Argument must be an array in %s on line %d diff --git a/ext/standard/tests/strings/lcfirst.phpt b/ext/standard/tests/strings/lcfirst.phpt index 97dfc4153b798..38cb7e566fe88 100644 Binary files a/ext/standard/tests/strings/lcfirst.phpt and b/ext/standard/tests/strings/lcfirst.phpt differ diff --git a/ext/standard/tests/strings/levenshtein.phpt b/ext/standard/tests/strings/levenshtein.phpt index 1ac05cf2ae727..b4b7c03e7f580 100644 --- a/ext/standard/tests/strings/levenshtein.phpt +++ b/ext/standard/tests/strings/levenshtein.phpt @@ -63,10 +63,8 @@ $n += test_me("gt maxlength2", -1, "A", "AbcdefghijklmnopqrstuvwxyzAbcdefghijkl echo ($n==0)?"all passed\n":"$n failed\n"; -var_dump(levenshtein(array(), array())); var_dump(levenshtein("", "", -1, -1, -1)); var_dump(levenshtein("", "", 10, 10, 10)); -var_dump(levenshtein("")); ?> --EXPECTF-- @@ -76,11 +74,5 @@ Warning: levenshtein(): Argument string(s) too long in %s on line %d Warning: levenshtein(): Argument string(s) too long in %s on line %d all passed - -Warning: levenshtein() expects parameter 1 to be string, array given in %s on line %d -NULL int(0) int(0) - -Warning: Wrong parameter count for levenshtein() in %s on line %d -NULL diff --git a/ext/standard/tests/strings/ltrim.phpt b/ext/standard/tests/strings/ltrim.phpt index 638c93557f124..51287e04d7f02 100644 --- a/ext/standard/tests/strings/ltrim.phpt +++ b/ext/standard/tests/strings/ltrim.phpt @@ -9,12 +9,6 @@ Test ltrim() function echo "\n *** Output for Error Conditions ***\n"; - echo "\n *** Output for zero argument ***\n"; - var_dump( ltrim() ); - - echo "\n *** Output for more than valid number of arguments (Valid are 1 or 2 arguments) ***\n"; - var_dump( ltrim("", " ", 1) ); - /* heredoc string */ $str = << --EXPECTF-- -Warning: metaphone() expects at least 1 parameter, 0 given in %s on line %d -NULL string(0) "" string(0) "" bool(false) diff --git a/ext/standard/tests/strings/money_format_error.phpt b/ext/standard/tests/strings/money_format_error.phpt index 454b593537706..8a4366f1bb443 100644 --- a/ext/standard/tests/strings/money_format_error.phpt +++ b/ext/standard/tests/strings/money_format_error.phpt @@ -23,15 +23,6 @@ $extra_arg = 10; echo "*** Testing money_format() : error conditions ***\n"; -echo "\n-- Testing money_format() function with no arguments --\n"; -var_dump( money_format() ); - -echo "\n-- Testing money_format() function with insufficient arguments --\n"; -var_dump( money_format($string) ); - -echo "\n-- Testing money_format() function with more than expected no. of arguments --\n"; -var_dump( money_format($string, $value, $extra_arg) ); - echo "\n-- Testing money_format() function with more than one token --\n"; var_dump( money_format($string . $string, $value) ); ?> @@ -39,21 +30,6 @@ var_dump( money_format($string . $string, $value) ); --EXPECTF-- *** Testing money_format() : error conditions *** --- Testing money_format() function with no arguments -- - -Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d -NULL - --- Testing money_format() function with insufficient arguments -- - -Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d -NULL - --- Testing money_format() function with more than expected no. of arguments -- - -Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -- Testing money_format() function with more than one token -- Warning: money_format(): Only a single %ci or %cn token can be used in %s on line %d diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt index a3d735069d593..2bbea73588cb2 100644 --- a/ext/standard/tests/strings/pathinfo.phpt +++ b/ext/standard/tests/strings/pathinfo.phpt @@ -3,7 +3,6 @@ pathinfo() tests --FILE-- --EXPECTF-- -Warning: pathinfo() expects at least 1 parameter, 0 given in %s on line %d -NULL array(2) { ["basename"]=> string(0) "" diff --git a/ext/standard/tests/strings/php_strip_whitespace.phpt b/ext/standard/tests/strings/php_strip_whitespace.phpt index d9376b101ad62..caab3bc1d20d8 100644 --- a/ext/standard/tests/strings/php_strip_whitespace.phpt +++ b/ext/standard/tests/strings/php_strip_whitespace.phpt @@ -5,7 +5,6 @@ php_strip_whitespace() tests $filename = dirname(__FILE__)."/php_strip_whitespace.dat"; -var_dump(php_strip_whitespace()); var_dump(php_strip_whitespace($filename)); $data = '/* test comment */'; @@ -40,9 +39,6 @@ var_dump(php_strip_whitespace($filename)); echo "Done\n"; ?> --EXPECTF-- -Warning: php_strip_whitespace() expects exactly 1 parameter, 0 given in %s on line %d -bool(false) - Warning: php_strip_whitespace(%sphp_strip_whitespace.dat): failed to open stream: No such file or directory in %s on line %d string(0) "" string(18) "/* test comment */" diff --git a/ext/standard/tests/strings/printf.phpt b/ext/standard/tests/strings/printf.phpt index eab44a4a65720..89b1b9ace2930 100644 --- a/ext/standard/tests/strings/printf.phpt +++ b/ext/standard/tests/strings/printf.phpt @@ -28,7 +28,11 @@ $strings = array( NULL, "abc", 'aaa' ); /* Zero argument */ echo "\n*** Output for zero argument ***\n"; -printf(); +try { + printf(); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} /* Number of arguments not matching as specified in format field */ echo "\n*** Output for insufficient number of arguments ***\n"; @@ -226,8 +230,7 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** - -Warning: printf() expects at least %d parameter, %d given in %s on line %d +printf() expects at least %d parameter, %d given *** Output for insufficient number of arguments *** diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 1a90970371376..0106f71445bd4 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -28,7 +28,11 @@ $strings = array( NULL, "abc", 'aaa' ); /* Zero argument */ echo "\n*** Output for zero argument ***\n"; -printf(); +try { + printf(); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} /* Number of arguments not matching as specified in format field */ echo "\n*** Output for insufficient number of arguments ***\n"; @@ -226,8 +230,7 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** - -Warning: printf() expects at least 1 parameter, 0 given in %s on line %d +printf() expects at least 1 parameter, 0 given *** Output for insufficient number of arguments *** diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt index a88390bc04c4f..aff95426e6ab7 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -11,7 +11,11 @@ echo "*** Testing printf() : error conditions ***\n"; // Zero arguments echo "\n-- Testing printf() function with Zero arguments --\n"; -var_dump( printf() ); +try { + var_dump( printf() ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "\n-- Testing printf() function with less than expected no. of arguments --\n"; $format1 = '%s'; @@ -38,9 +42,7 @@ var_dump( printf($format3) ); *** Testing printf() : error conditions *** -- Testing printf() function with Zero arguments -- - -Warning: printf() expects at least 1 parameter, 0 given in %s on line %d -bool(false) +printf() expects at least 1 parameter, 0 given -- Testing printf() function with less than expected no. of arguments -- diff --git a/ext/standard/tests/strings/quoted_printable_encode_001.phpt b/ext/standard/tests/strings/quoted_printable_encode_001.phpt index 1ce7d791dca01..df26d5cf4b26a 100644 --- a/ext/standard/tests/strings/quoted_printable_encode_001.phpt +++ b/ext/standard/tests/strings/quoted_printable_encode_001.phpt @@ -3,30 +3,18 @@ quoted_printable_encode() tests - 1 --FILE-- ---EXPECTF-- -Warning: quoted_printable_encode() expects exactly 1 parameter, 0 given in %s on line %d -NULL +--EXPECT-- string(0) "" string(4) "test" - -Warning: quoted_printable_encode() expects exactly 1 parameter, 2 given in %s on line %d -NULL - -Warning: quoted_printable_encode() expects parameter 1 to be string, array given in %s on line %d -NULL string(1) "1" string(0) "" string(0) "" diff --git a/ext/standard/tests/strings/rtrim.phpt b/ext/standard/tests/strings/rtrim.phpt index 5f57b0e850f45..223a839f580c5 100644 Binary files a/ext/standard/tests/strings/rtrim.phpt and b/ext/standard/tests/strings/rtrim.phpt differ diff --git a/ext/standard/tests/strings/rtrim_error.phpt b/ext/standard/tests/strings/rtrim_error.phpt index 108f96a1f05b1..210fb58c4ea70 100644 --- a/ext/standard/tests/strings/rtrim_error.phpt +++ b/ext/standard/tests/strings/rtrim_error.phpt @@ -11,14 +11,6 @@ Test rtrim() function : error conditions echo "*** Testing rtrim() : error conditions ***\n"; -echo "\n-- Testing rtrim() function with no arguments --\n"; -var_dump( rtrim() ); - -echo "\n-- Testing rtrim() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( rtrim("Hello World", "Heo", $extra_arg) ); - - $hello = " Hello World\n"; echo "\n-- Test rtrim function with various invalid charlists\n"; var_dump(rtrim($hello, "..a")); @@ -31,16 +23,6 @@ var_dump(rtrim($hello, "a..b..c")); --EXPECTF-- *** Testing rtrim() : error conditions *** --- Testing rtrim() function with no arguments -- - -Warning: rtrim() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing rtrim() function with more than expected no. of arguments -- - -Warning: rtrim() expects at most 2 parameters, 3 given in %s on line %d -NULL - -- Test rtrim function with various invalid charlists Warning: rtrim(): Invalid '..'-range, no character to the left of '..' in %s on line %d diff --git a/ext/standard/tests/strings/setlocale_error.phpt b/ext/standard/tests/strings/setlocale_error.phpt index 14bb7d7ed55d2..c2b18b1992413 100644 --- a/ext/standard/tests/strings/setlocale_error.phpt +++ b/ext/standard/tests/strings/setlocale_error.phpt @@ -18,14 +18,6 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { echo "*** Testing setlocale() : error conditions ***\n"; -// Zero argument -echo "\n-- Testing setlocale() function with Zero arguments --"; -var_dump( setlocale()); - -// One argument -echo "\n-- Testing setlocale() function with One argument, 'category' = LC_ALL --"; -var_dump( setlocale(LC_ALL) ); - echo "\n-- Testing setlocale() function with invalid locale array, 'category' = LC_ALL --\n"; //Invalid array of locales $invalid_locales = array("en_US.invalid", "en_AU.invalid", "ko_KR.invalid"); @@ -44,14 +36,6 @@ echo "\nDone"; --EXPECTF-- *** Testing setlocale() : error conditions *** --- Testing setlocale() function with Zero arguments -- -Warning: setlocale() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing setlocale() function with One argument, 'category' = LC_ALL -- -Warning: setlocale() expects at least 2 parameters, 1 given in %s on line %d -NULL - -- Testing setlocale() function with invalid locale array, 'category' = LC_ALL -- bool(false) diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 102dab75ff6f9..09e81be014870 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -46,12 +46,6 @@ var_dump( sha1_file(12) ); echo "\n-- NULL as filename --\n"; var_dump( sha1_file(NULL) ); -echo "\n-- Zero arguments --\n"; - var_dump ( sha1_file() ); - -echo "\n-- More than valid number of arguments ( valid is 2) --\n"; -var_dump ( sha1_file("EmptyFileSHA1.txt", true, NULL) ); - echo "\n-- Hexadecimal Output for Empty file as Argument --\n"; var_dump( sha1_file("EmptyFileSHA1.txt") ); @@ -95,16 +89,6 @@ bool(false) Warning: sha1_file(): Filename cannot be empty in %s on line %d bool(false) --- Zero arguments -- - -Warning: sha1_file() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- More than valid number of arguments ( valid is 2) -- - -Warning: sha1_file() expects at most 2 parameters, 3 given in %s on line %d -NULL - -- Hexadecimal Output for Empty file as Argument -- string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709" diff --git a/ext/standard/tests/strings/soundex.phpt b/ext/standard/tests/strings/soundex.phpt index 650236c2e5c3e..744f71c17a2b9 100644 --- a/ext/standard/tests/strings/soundex.phpt +++ b/ext/standard/tests/strings/soundex.phpt @@ -5,7 +5,6 @@ soundex() tests var_dump(soundex("")); var_dump(soundex(-1)); -var_dump(soundex(array())); $array = array( "From", @@ -34,9 +33,6 @@ echo "Done\n"; --EXPECTF-- bool(false) string(4) "0000" - -Warning: soundex() expects parameter 1 to be string, array given in %s on line %d -NULL string(4) "F650" string(4) "T300" string(4) "T500" diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt index 1c12cd31686a0..1b21b8b141cfb 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -11,7 +11,11 @@ echo "*** Testing sprintf() : error conditions ***\n"; // Zero arguments echo "\n-- Testing sprintf() function with Zero arguments --\n"; -var_dump( sprintf() ); +try { + var_dump( sprintf() ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "\n-- Testing sprintf() function with less than expected no. of arguments --\n"; $format1 = '%s'; @@ -38,9 +42,7 @@ echo "Done"; *** Testing sprintf() : error conditions *** -- Testing sprintf() function with Zero arguments -- - -Warning: sprintf() expects at least %d parameter, %d given in %s on line %d -bool(false) +sprintf() expects at least %d parameter, %d given -- Testing sprintf() function with less than expected no. of arguments -- diff --git a/ext/standard/tests/strings/sscanf_error.phpt b/ext/standard/tests/strings/sscanf_error.phpt index ca967758abdf4..3e54a42f1e5f3 100644 --- a/ext/standard/tests/strings/sscanf_error.phpt +++ b/ext/standard/tests/strings/sscanf_error.phpt @@ -12,12 +12,6 @@ echo "*** Testing sscanf() : error conditions ***\n"; $str = "Hello World"; $format = "%s %s"; -echo "\n-- Testing sscanf() function with no arguments --\n"; -var_dump( sscanf() ); - -echo "\n-- Testing sscanf() function with one argument --\n"; -var_dump( sscanf($str) ); - echo "\n-- Testing sscanf() function with more than expected no. of arguments --\n"; var_dump( sscanf($str, $format, $str1, $str2, $extra_str) ); @@ -27,16 +21,6 @@ var_dump( sscanf($str, $format, $str1, $str2, $extra_str) ); --EXPECTF-- *** Testing sscanf() : error conditions *** --- Testing sscanf() function with no arguments -- - -Warning: sscanf() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing sscanf() function with one argument -- - -Warning: sscanf() expects at least 2 parameters, 1 given in %s on line %d -NULL - -- Testing sscanf() function with more than expected no. of arguments -- Warning: sscanf(): Variable is not assigned by any conversion specifiers in %s on line %d diff --git a/ext/standard/tests/strings/str_ireplace.phpt b/ext/standard/tests/strings/str_ireplace.phpt index 526b8ac723547..71a9d1e12791a 100644 --- a/ext/standard/tests/strings/str_ireplace.phpt +++ b/ext/standard/tests/strings/str_ireplace.phpt @@ -3,9 +3,6 @@ str_ireplace() tests --FILE-- ", $Data)); echo "Done\n"; ?> --EXPECTF-- -Warning: str_ireplace() expects at least 3 parameters, 0 given in %s on line %d -NULL - -Warning: str_ireplace() expects at least 3 parameters, 1 given in %s on line %d -NULL - -Warning: str_ireplace() expects at least 3 parameters, 2 given in %s on line %d -NULL string(0) "" string(8) "aaaaaaaT" string(8) "aaaaaaaT" diff --git a/ext/standard/tests/strings/str_pad.phpt b/ext/standard/tests/strings/str_pad.phpt index b44a9517ab750..be4c9ed942869 100644 Binary files a/ext/standard/tests/strings/str_pad.phpt and b/ext/standard/tests/strings/str_pad.phpt differ diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt index 306b7d381af16..766bea1f9c32d 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_replace.phpt b/ext/standard/tests/strings/str_replace.phpt index 7b411abac54e7..bef11f872a51b 100644 --- a/ext/standard/tests/strings/str_replace.phpt +++ b/ext/standard/tests/strings/str_replace.phpt @@ -223,15 +223,6 @@ var_dump( str_replace("worldS", "FOUND", "$strS") ); var_dump( str_replace("worldS", "FOUND", "${str}S") ); var_dump( str_replace("worldS", "FOUND", "{$str}S") ); - -echo "\n*** Testing error conditions ***"; -/* Invalid arguments */ -var_dump( str_replace() ); -var_dump( str_replace("") ); -var_dump( str_replace(NULL) ); -var_dump( str_replace(1, 2) ); -var_dump( str_replace(1,2,3,$var,5) ); - fclose($resource1); closedir($resource2); echo "Done\n"; @@ -938,20 +929,4 @@ Notice: Undefined variable: strS in %s on line %d string(0) "" string(5) "FOUND" string(5) "FOUND" - -*** Testing error conditions *** -Warning: str_replace() expects at least 3 parameters, 0 given in %s on line %d -NULL - -Warning: str_replace() expects at least 3 parameters, 1 given in %s on line %d -NULL - -Warning: str_replace() expects at least 3 parameters, 1 given in %s on line %d -NULL - -Warning: str_replace() expects at least 3 parameters, 2 given in %s on line %d -NULL - -Warning: str_replace() expects at most 4 parameters, 5 given in %s on line %d -NULL Done diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt index a477800a26239..1aea668026310 100644 --- a/ext/standard/tests/strings/str_split_variation6.phpt +++ b/ext/standard/tests/strings/str_split_variation6.phpt @@ -30,7 +30,6 @@ $values = array ( 0234, //octal number 0x1A, //hexadecimal number 2147483647, //max positive integer number - 2147483648, //max positive integer+1 -2147483648, //min negative integer ); @@ -157,10 +156,6 @@ array(1) { } -- Iteration 7 -- -Warning: str_split() expects parameter 2 to be int, float given in %s line %d -NULL --- Iteration 8 -- - Warning: str_split(): The length of each segment must be greater than zero in %s on line %d bool(false) Done diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt index 5082c7ba2f45d..1a2471a20a88b 100644 --- a/ext/standard/tests/strings/str_split_variation7.phpt +++ b/ext/standard/tests/strings/str_split_variation7.phpt @@ -32,7 +32,6 @@ $values = array ( 0234, //octal number 0x1A, //hexadecimal number 2147483647, //max positive integer number - 2147483648, //max positive integer+1 -2147483648, //min negative integer ); @@ -135,10 +134,6 @@ array(1) { } -- Iteration 7 -- -Warning: str_split() expects parameter 2 to be int, float given in %s on line %d -NULL --- Iteration 8 -- - Warning: str_split(): The length of each segment must be greater than zero in %s on line %d bool(false) Done diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt index f88646370bfb5..e8fa12aca6d7c 100644 --- a/ext/standard/tests/strings/str_word_count.phpt +++ b/ext/standard/tests/strings/str_word_count.phpt @@ -13,28 +13,20 @@ var_dump(str_word_count($str, 3)); var_dump(str_word_count($str, 123)); var_dump(str_word_count($str, -1)); var_dump(str_word_count($str, 999999999)); -var_dump(str_word_count($str, array())); -var_dump(str_word_count($str, $b)); var_dump($str); $str2 = "F0o B4r 1s bar foo"; var_dump(str_word_count($str2, NULL, "04")); var_dump(str_word_count($str2, NULL, "01")); var_dump(str_word_count($str2, NULL, "014")); -var_dump(str_word_count($str2, NULL, array())); -var_dump(str_word_count($str2, NULL, new stdClass)); var_dump(str_word_count($str2, NULL, "")); var_dump(str_word_count($str2, 1, "04")); var_dump(str_word_count($str2, 1, "01")); var_dump(str_word_count($str2, 1, "014")); -var_dump(str_word_count($str2, 1, array())); -var_dump(str_word_count($str2, 1, new stdClass)); var_dump(str_word_count($str2, 1, "")); var_dump(str_word_count($str2, 2, "04")); var_dump(str_word_count($str2, 2, "01")); var_dump(str_word_count($str2, 2, "014")); -var_dump(str_word_count($str2, 2, array())); -var_dump(str_word_count($str2, 2, new stdClass)); var_dump(str_word_count($str2, 2, "")); var_dump(str_word_count("foo'0 bar-0var", 2, "0")); var_dump(str_word_count("'foo'", 2)); @@ -86,23 +78,11 @@ bool(false) Warning: str_word_count(): Invalid format value 999999999 in %s on line %d bool(false) - -Warning: str_word_count() expects parameter 2 to be int, array given in %s on line %d -NULL - -Warning: str_word_count() expects parameter 2 to be int, string given in %s on line %d -NULL string(55) "Hello friend, you're looking good today!" int(5) int(6) int(5) - -Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d -NULL int(7) array(5) { [0]=> @@ -142,12 +122,6 @@ array(5) { [4]=> string(3) "foo" } - -Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d -NULL array(7) { [0]=> string(1) "F" @@ -202,12 +176,6 @@ array(5) { [15]=> string(3) "foo" } - -Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d -NULL - -Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d -NULL array(7) { [0]=> string(1) "F" diff --git a/ext/standard/tests/strings/strcasecmp.phpt b/ext/standard/tests/strings/strcasecmp.phpt index 3086c2be92da6..d9063cc9decc9 100644 Binary files a/ext/standard/tests/strings/strcasecmp.phpt and b/ext/standard/tests/strings/strcasecmp.phpt differ diff --git a/ext/standard/tests/strings/strcmp.phpt b/ext/standard/tests/strings/strcmp.phpt index 397e072c5239f..fd20e501958cd 100644 Binary files a/ext/standard/tests/strings/strcmp.phpt and b/ext/standard/tests/strings/strcmp.phpt differ diff --git a/ext/standard/tests/strings/stripos_error.phpt b/ext/standard/tests/strings/stripos_error.phpt index 324014cf6da09..0420bb090b268 100644 --- a/ext/standard/tests/strings/stripos_error.phpt +++ b/ext/standard/tests/strings/stripos_error.phpt @@ -8,14 +8,6 @@ Test stripos() function : error conditions */ echo "*** Testing stripos() function: error conditions ***\n"; -echo "\n-- With Zero arguments --"; -var_dump( stripos() ); - -echo "\n-- With less than expected number of arguments --"; -var_dump( stripos("String") ); - -echo "\n-- With more than expected number of arguments --"; -var_dump( stripos("string", "String", 1, 'extra_arg') ); echo "\n-- Offset beyond the end of the string --"; var_dump( stripos("Hello World", "o", 12) ); @@ -28,18 +20,6 @@ echo "*** Done ***"; --EXPECTF-- *** Testing stripos() function: error conditions *** --- With Zero arguments -- -Warning: stripos() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- With less than expected number of arguments -- -Warning: stripos() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- With more than expected number of arguments -- -Warning: stripos() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Offset beyond the end of the string -- Warning: stripos(): Offset not contained in string in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/stripos_variation10.phpt b/ext/standard/tests/strings/stripos_variation10.phpt index 81d3b35a20795..6792b4d0b2980 100644 --- a/ext/standard/tests/strings/stripos_variation10.phpt +++ b/ext/standard/tests/strings/stripos_variation10.phpt @@ -83,7 +83,11 @@ $needles = array ( $counter = 1; for($index = 0; $index < count($needles); $index ++) { echo "\n-- Iteration $counter --\n"; - var_dump( stripos($haystack, $needles[$index]) ); + try { + var_dump( stripos($haystack, $needles[$index]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter ++; } @@ -122,29 +126,19 @@ bool(false) int(17) -- Iteration 10 -- - -Warning: stripos() expects parameter 2 to be string, array given in %s on line %d -NULL +stripos() expects parameter 2 to be string, array given -- Iteration 11 -- - -Warning: stripos() expects parameter 2 to be string, array given in %s on line %d -NULL +stripos() expects parameter 2 to be string, array given -- Iteration 12 -- - -Warning: stripos() expects parameter 2 to be string, array given in %s on line %d -NULL +stripos() expects parameter 2 to be string, array given -- Iteration 13 -- - -Warning: stripos() expects parameter 2 to be string, array given in %s on line %d -NULL +stripos() expects parameter 2 to be string, array given -- Iteration 14 -- - -Warning: stripos() expects parameter 2 to be string, array given in %s on line %d -NULL +stripos() expects parameter 2 to be string, array given -- Iteration 15 -- int(9) @@ -174,9 +168,7 @@ bool(false) bool(false) -- Iteration 24 -- - -Warning: stripos() expects parameter 2 to be string, resource given in %s on line %d -NULL +stripos() expects parameter 2 to be string, resource given -- Iteration 25 -- bool(false) diff --git a/ext/standard/tests/strings/stripos_variation11.phpt b/ext/standard/tests/strings/stripos_variation11.phpt index 1f79b61d1aa5e..aab3181df35b3 100644 --- a/ext/standard/tests/strings/stripos_variation11.phpt +++ b/ext/standard/tests/strings/stripos_variation11.phpt @@ -81,8 +81,16 @@ $counter = 1; for($index = 0; $index < count($values); $index ++) { echo "-- Iteration $counter --\n"; $haystack = $values[$index]; - var_dump( stripos($values[$index], $values[$index]) ); - var_dump( stripos($values[$index], $values[$index], 1) ); + try { + var_dump( stripos($values[$index], $values[$index]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( stripos($values[$index], $values[$index], 1) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter ++; } @@ -118,40 +126,20 @@ bool(false) int(0) bool(false) -- Iteration 10 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL +stripos() expects parameter 1 to be string, array given +stripos() expects parameter 1 to be string, array given -- Iteration 11 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL +stripos() expects parameter 1 to be string, array given +stripos() expects parameter 1 to be string, array given -- Iteration 12 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL +stripos() expects parameter 1 to be string, array given +stripos() expects parameter 1 to be string, array given -- Iteration 13 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL +stripos() expects parameter 1 to be string, array given +stripos() expects parameter 1 to be string, array given -- Iteration 14 -- - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, array given in %s on line %d -NULL +stripos() expects parameter 1 to be string, array given +stripos() expects parameter 1 to be string, array given -- Iteration 15 -- int(0) bool(false) @@ -192,12 +180,8 @@ bool(false) Warning: stripos(): Offset not contained in string in %s on line %d bool(false) -- Iteration 24 -- - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL - -Warning: stripos() expects parameter 1 to be string, resource given in %s on line %d -NULL +stripos() expects parameter 1 to be string, resource given +stripos() expects parameter 1 to be string, resource given -- Iteration 25 -- bool(false) diff --git a/ext/standard/tests/strings/stristr.phpt b/ext/standard/tests/strings/stristr.phpt index a0f0cc3497983..92cfa09eb1e17 100644 --- a/ext/standard/tests/strings/stristr.phpt +++ b/ext/standard/tests/strings/stristr.phpt @@ -2,10 +2,6 @@ stristr() function --FILE-- --EXPECTF-- -Warning: stristr() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: stristr() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: stristr() expects parameter 2 to be string, array given in %s on line %d -NULL - -Warning: stristr() expects parameter 1 to be string, array given in %s on line %d -NULL string(11) "tEsT sTrInG" string(6) "sTrInG" string(6) "sTrInG" diff --git a/ext/standard/tests/strings/stristr_error.phpt b/ext/standard/tests/strings/stristr_error.phpt index a0057574f9167..a7b683d3b8681 100644 --- a/ext/standard/tests/strings/stristr_error.phpt +++ b/ext/standard/tests/strings/stristr_error.phpt @@ -8,17 +8,6 @@ Test stristr() function : error conditions */ echo "*** Testing stristr() : error conditions ***\n"; -echo "\n-- Testing stristr() function with no arguments --\n"; -var_dump( stristr() ); -var_dump( stristr("") ); - -echo "\n-- Testing stristr() function with no needle --\n"; -var_dump( stristr("Hello World") ); // without "needle" - -echo "\n-- Testing stristr() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( stristr("Hello World", "World", true, $extra_arg) ); - echo "\n-- Testing stristr() function with empty haystack --\n"; var_dump( stristr(NULL, "") ); @@ -30,24 +19,6 @@ var_dump( stristr("Hello World", "") ); --EXPECTF-- *** Testing stristr() : error conditions *** --- Testing stristr() function with no arguments -- - -Warning: stristr() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: stristr() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing stristr() function with no needle -- - -Warning: stristr() expects at least 2 parameters, 1 given in %s on line %d -NULL - --- Testing stristr() function with more than expected no. of arguments -- - -Warning: stristr() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Testing stristr() function with empty haystack -- Warning: stristr(): Empty needle in %s on line %d diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt index 8ca09db66c2ce..fd842d1106441 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -72,7 +72,11 @@ $pad_length = "20"; $count = 1; foreach($inputs as $input) { echo "-- Iteration $count --\n"; - var_dump( stristr("Hello World", $input) ); + try { + var_dump( stristr("Hello World", $input) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count ++; } @@ -97,17 +101,11 @@ bool(false) -- Iteration 7 -- bool(false) -- Iteration 8 -- - -Warning: stristr() expects parameter 2 to be string, array given in %s on line %d -NULL +stristr() expects parameter 2 to be string, array given -- Iteration 9 -- - -Warning: stristr() expects parameter 2 to be string, array given in %s on line %d -NULL +stristr() expects parameter 2 to be string, array given -- Iteration 10 -- - -Warning: stristr() expects parameter 2 to be string, array given in %s on line %d -NULL +stristr() expects parameter 2 to be string, array given -- Iteration 11 -- bool(false) -- Iteration 12 -- @@ -131,9 +129,7 @@ bool(false) -- Iteration 17 -- bool(false) -- Iteration 18 -- - -Warning: stristr() expects parameter 2 to be string, resource given in %s on line %d -NULL +stristr() expects parameter 2 to be string, resource given -- Iteration 19 -- Warning: stristr(): Empty needle in %s on line %d diff --git a/ext/standard/tests/strings/strlen.phpt b/ext/standard/tests/strings/strlen.phpt index a546bdb8d29db..156038ed7b491 100644 Binary files a/ext/standard/tests/strings/strlen.phpt and b/ext/standard/tests/strings/strlen.phpt differ diff --git a/ext/standard/tests/strings/strncasecmp_error.phpt b/ext/standard/tests/strings/strncasecmp_error.phpt index d443f8113b99a..00ddfaed9bdf2 100644 --- a/ext/standard/tests/strings/strncasecmp_error.phpt +++ b/ext/standard/tests/strings/strncasecmp_error.phpt @@ -10,18 +10,6 @@ Test strncasecmp() function : error conditions echo "*** Testing strncasecmp() function: error conditions ***\n"; $str1 = 'string_val'; $str2 = 'string_val'; -$len = 10; -$extra_arg = 10; - -echo "\n-- Testing strncasecmp() function with Zero arguments --"; -var_dump( strncasecmp() ); - -echo "\n-- Testing strncasecmp() function with less than expected number of arguments --"; -var_dump( strncasecmp($str1) ); -var_dump( strncasecmp($str1, $str2) ); - -echo "\n-- Testing strncasecmp() function with more than expected number of arguments --"; -var_dump( strncasecmp($str1, $str2, $len, $extra_arg) ); echo "\n-- Testing strncasecmp() function with invalid argument --"; $len = -10; @@ -31,21 +19,6 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing strncasecmp() function: error conditions *** --- Testing strncasecmp() function with Zero arguments -- -Warning: strncasecmp() expects exactly 3 parameters, 0 given in %s on line %d -NULL - --- Testing strncasecmp() function with less than expected number of arguments -- -Warning: strncasecmp() expects exactly 3 parameters, 1 given in %s on line %d -NULL - -Warning: strncasecmp() expects exactly 3 parameters, 2 given in %s on line %d -NULL - --- Testing strncasecmp() function with more than expected number of arguments -- -Warning: strncasecmp() expects exactly 3 parameters, 4 given in %s on line %d -NULL - -- Testing strncasecmp() function with invalid argument -- Warning: Length must be greater than or equal to 0 in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/strncmp_error.phpt b/ext/standard/tests/strings/strncmp_error.phpt index 4eb73eb3182d1..13a4cb0350ac3 100644 --- a/ext/standard/tests/strings/strncmp_error.phpt +++ b/ext/standard/tests/strings/strncmp_error.phpt @@ -12,13 +12,6 @@ Test strncmp() function : error conditions echo "*** Testing strncmp() function: error conditions ***\n"; $str1 = 'string_val'; $str2 = 'string_val'; -$len = 10; -$extra_arg = 10; - -var_dump( strncmp() ); //Zero argument -var_dump( strncmp($str1) ); //One argument, less than expected no. of args -var_dump( strncmp($str1, $str2) ); //Two arguments, less than expected no. of args -var_dump( strncmp($str1, $str2, $len, $extra_arg) ); //Four arguments, greater than expected no. of args /* Invalid argument for $len */ $len = -10; @@ -28,18 +21,6 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing strncmp() function: error conditions *** -Warning: strncmp() expects exactly 3 parameters, 0 given in %s on line %d -NULL - -Warning: strncmp() expects exactly 3 parameters, 1 given in %s on line %d -NULL - -Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d -NULL - -Warning: strncmp() expects exactly 3 parameters, 4 given in %s on line %d -NULL - Warning: Length must be greater than or equal to 0 in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/strings/strpbrk_error.phpt b/ext/standard/tests/strings/strpbrk_error.phpt index 658e2f429e0ea..cce843c2f1858 100644 --- a/ext/standard/tests/strings/strpbrk_error.phpt +++ b/ext/standard/tests/strings/strpbrk_error.phpt @@ -11,47 +11,17 @@ Test strpbrk() function : error conditions echo "*** Testing strpbrk() : error conditions ***\n"; $haystack = 'This is a Simple text.'; -$char_list = 'string_val'; -$extra_arg = 10; - -echo "\n-- Testing strpbrk() function with more than expected no. of arguments --\n"; -var_dump( strpbrk($haystack, $char_list, $extra_arg) ); - -echo "\n-- Testing strpbrk() function with less than expected no. of arguments --\n"; -var_dump( strpbrk($haystack) ); echo "\n-- Testing strpbrk() function with empty second argument --\n"; var_dump( strpbrk($haystack, '') ); -echo "\n-- Testing strpbrk() function with arrays --\n"; -var_dump( strpbrk($haystack, array('a', 'b', 'c') ) ); -var_dump( strpbrk(array('foo', 'bar'), 'b') ); - ?> ===DONE=== --EXPECTF-- *** Testing strpbrk() : error conditions *** --- Testing strpbrk() function with more than expected no. of arguments -- - -Warning: strpbrk() expects exactly 2 parameters, 3 given in %s on line %d -bool(false) - --- Testing strpbrk() function with less than expected no. of arguments -- - -Warning: strpbrk() expects exactly 2 parameters, 1 given in %s on line %d -bool(false) - -- Testing strpbrk() function with empty second argument -- Warning: strpbrk(): The character list cannot be empty in %s on line %d bool(false) - --- Testing strpbrk() function with arrays -- - -Warning: strpbrk() expects parameter 2 to be string, array given in %s on line %d -bool(false) - -Warning: strpbrk() expects parameter 1 to be string, array given in %s on line %d -bool(false) ===DONE=== diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt index a4c3a9c7813a3..4640b670f3163 100644 Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ diff --git a/ext/standard/tests/strings/strrchr_variation10.phpt b/ext/standard/tests/strings/strrchr_variation10.phpt index 478ac80300333..1004a3d91578b 100644 --- a/ext/standard/tests/strings/strrchr_variation10.phpt +++ b/ext/standard/tests/strings/strrchr_variation10.phpt @@ -121,7 +121,11 @@ $needles = array ( $count = 1; for($index = 0; $index < count($haystacks); $index++) { echo "-- Iteration $count --\n"; - var_dump( strrchr($haystacks[$index], $needles[$index]) ); + try { + var_dump( strrchr($haystacks[$index], $needles[$index]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $count ++; } @@ -129,7 +133,7 @@ fclose($file_handle); //closing the file handle echo "*** Done ***"; ?> ---EXPECTF-- +--EXPECT-- *** Testing strrchr() function with unexpected inputs for needle *** -- Iteration 1 -- string(1) "0" @@ -150,25 +154,15 @@ string(2) "10" -- Iteration 9 -- bool(false) -- Iteration 10 -- - -Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 2 to be string, array given -- Iteration 11 -- - -Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 2 to be string, array given -- Iteration 12 -- - -Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 2 to be string, array given -- Iteration 13 -- - -Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 2 to be string, array given -- Iteration 14 -- - -Warning: strrchr() expects parameter 2 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 2 to be string, array given -- Iteration 15 -- bool(false) -- Iteration 16 -- @@ -188,9 +182,7 @@ bool(false) -- Iteration 23 -- bool(false) -- Iteration 24 -- - -Warning: strrchr() expects parameter 2 to be string, resource given in %s on line %d -NULL +strrchr() expects parameter 2 to be string, resource given -- Iteration 25 -- bool(false) -- Iteration 26 -- diff --git a/ext/standard/tests/strings/strrchr_variation11.phpt b/ext/standard/tests/strings/strrchr_variation11.phpt index 92a9c07eee26f..79ffe4c2ecac9 100644 --- a/ext/standard/tests/strings/strrchr_variation11.phpt +++ b/ext/standard/tests/strings/strrchr_variation11.phpt @@ -80,7 +80,11 @@ $values = array ( $counter = 1; for($index = 0; $index < count($values); $index ++) { echo "-- Iteration $counter --\n"; - var_dump( strrchr($values[$index], $values[$index]) ); + try { + var_dump( strrchr($values[$index], $values[$index]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter ++; } @@ -88,7 +92,7 @@ fclose($file_handle); //closing the file handle echo "*** Done ***"; ?> ---EXPECTF-- +--EXPECT-- *** Testing strrchr() function: with unexpected inputs for haystack and needle *** -- Iteration 1 -- string(1) "0" @@ -109,25 +113,15 @@ string(4) "1E-9" -- Iteration 9 -- string(3) "0.5" -- Iteration 10 -- - -Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 1 to be string, array given -- Iteration 11 -- - -Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 1 to be string, array given -- Iteration 12 -- - -Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 1 to be string, array given -- Iteration 13 -- - -Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 1 to be string, array given -- Iteration 14 -- - -Warning: strrchr() expects parameter 1 to be string, array given in %s on line %d -NULL +strrchr() expects parameter 1 to be string, array given -- Iteration 15 -- string(1) "1" -- Iteration 16 -- @@ -147,9 +141,7 @@ bool(false) -- Iteration 23 -- bool(false) -- Iteration 24 -- - -Warning: strrchr() expects parameter 1 to be string, resource given in %s on line %d -NULL +strrchr() expects parameter 1 to be string, resource given -- Iteration 25 -- bool(false) -- Iteration 26 -- diff --git a/ext/standard/tests/strings/strripos.phpt b/ext/standard/tests/strings/strripos.phpt index 291ff78cd7abb..fa15e2fcacae7 100644 --- a/ext/standard/tests/strings/strripos.phpt +++ b/ext/standard/tests/strings/strripos.phpt @@ -15,9 +15,6 @@ strripos() function var_dump(@strripos("a", "")); var_dump(@strripos("", "a")); var_dump(@strripos("\\\\a", "\\a")); - - $fp = fopen(__FILE__, "r"); - var_dump(@strripos("", $fp)); ?> --EXPECT-- int(5) @@ -33,4 +30,3 @@ bool(false) bool(false) bool(false) int(1) -bool(false) diff --git a/ext/standard/tests/strings/strripos_offset.phpt b/ext/standard/tests/strings/strripos_offset.phpt index b5d09d79461f8..5981c9b6cb319 100644 --- a/ext/standard/tests/strings/strripos_offset.phpt +++ b/ext/standard/tests/strings/strripos_offset.phpt @@ -3,11 +3,12 @@ strripos() offset integer overflow --FILE-- getMessage(), "\n"; +} + var_dump(strripos(1024, 1024, -PHP_INT_MAX)); var_dump(strripos(1024, "te", -PHP_INT_MAX)); var_dump(strripos(1024, 1024, -PHP_INT_MAX-1)); @@ -16,20 +17,7 @@ var_dump(strripos(1024, "te", -PHP_INT_MAX-1)); echo "Done\n"; ?> --EXPECTF-- -Warning: strripos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strripos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strripos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strripos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strripos() expects parameter 1 to be string, array given in %s on line %d -bool(false) +strripos() expects parameter 3 to be int, float given Warning: strripos(): Offset is greater than the length of haystack string in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/strrpos_offset.phpt b/ext/standard/tests/strings/strrpos_offset.phpt index 1399b6098573e..d1bbc856a322b 100644 --- a/ext/standard/tests/strings/strrpos_offset.phpt +++ b/ext/standard/tests/strings/strrpos_offset.phpt @@ -3,10 +3,12 @@ strrpos() offset integer overflow --FILE-- getMessage(), "\n"; +} + var_dump(strrpos(1024, 1024, -PHP_INT_MAX)); var_dump(strrpos(1024, "te", -PHP_INT_MAX)); var_dump(strrpos(1024, 1024, -PHP_INT_MAX-1)); @@ -15,17 +17,7 @@ var_dump(strrpos(1024, "te", -PHP_INT_MAX-1)); echo "Done\n"; ?> --EXPECTF-- -Warning: strrpos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 3 to be int, float given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 3 to be int, float given in %s on line %d -bool(false) +strrpos() expects parameter 3 to be int, float given Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/strrpos_variation10.phpt b/ext/standard/tests/strings/strrpos_variation10.phpt index b374e7f9f6ce0..440605d43055a 100644 --- a/ext/standard/tests/strings/strrpos_variation10.phpt +++ b/ext/standard/tests/strings/strrpos_variation10.phpt @@ -83,7 +83,11 @@ $needles = array ( $counter = 1; for($index = 0; $index < count($needles); $index ++) { echo "-- Iteration $counter --\n"; - var_dump( strrpos($haystack, $needles[$index]) ); + try { + var_dump( strrpos($haystack, $needles[$index]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter ++; } @@ -91,7 +95,7 @@ fclose($file_handle); //closing the file handle echo "*** Done ***"; ?> ---EXPECTF-- +--EXPECT-- *** Testing strrpos() function with unexpected values for needle *** -- Iteration 1 -- int(42) @@ -112,25 +116,15 @@ bool(false) -- Iteration 9 -- int(28) -- Iteration 10 -- - -Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 2 to be string, array given -- Iteration 11 -- - -Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 2 to be string, array given -- Iteration 12 -- - -Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 2 to be string, array given -- Iteration 13 -- - -Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 2 to be string, array given -- Iteration 14 -- - -Warning: strrpos() expects parameter 2 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 2 to be string, array given -- Iteration 15 -- int(41) -- Iteration 16 -- @@ -150,9 +144,7 @@ bool(false) -- Iteration 23 -- bool(false) -- Iteration 24 -- - -Warning: strrpos() expects parameter 2 to be string, resource given in %s on line %d -bool(false) +strrpos() expects parameter 2 to be string, resource given -- Iteration 25 -- bool(false) -- Iteration 26 -- diff --git a/ext/standard/tests/strings/strrpos_variation11.phpt b/ext/standard/tests/strings/strrpos_variation11.phpt index f628427f08139..71201a1c21f7c 100644 --- a/ext/standard/tests/strings/strrpos_variation11.phpt +++ b/ext/standard/tests/strings/strrpos_variation11.phpt @@ -81,14 +81,22 @@ $counter = 1; for($index = 0; $index < count($values); $index ++) { echo "-- Iteration $counter --\n"; $haystack = $values[$index]; - var_dump( strrpos($values[$index], $values[$index]) ); - var_dump( strrpos($values[$index], $values[$index], 1) ); + try { + var_dump( strrpos($values[$index], $values[$index]) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( strrpos($values[$index], $values[$index], 1) ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } $counter ++; } echo "*** Done ***"; ?> ---EXPECTF-- +--EXPECT-- *** Testing strrpos() function with unexpected values for haystack and needle *** -- Iteration 1 -- int(0) @@ -118,40 +126,20 @@ bool(false) int(0) bool(false) -- Iteration 10 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 1 to be string, array given +strrpos() expects parameter 1 to be string, array given -- Iteration 11 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 1 to be string, array given +strrpos() expects parameter 1 to be string, array given -- Iteration 12 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 1 to be string, array given +strrpos() expects parameter 1 to be string, array given -- Iteration 13 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 1 to be string, array given +strrpos() expects parameter 1 to be string, array given -- Iteration 14 -- - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, array given in %s on line %d -bool(false) +strrpos() expects parameter 1 to be string, array given +strrpos() expects parameter 1 to be string, array given -- Iteration 15 -- int(0) bool(false) @@ -180,12 +168,8 @@ bool(false) bool(false) bool(false) -- Iteration 24 -- - -Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d -bool(false) - -Warning: strrpos() expects parameter 1 to be string, resource given in %s on line %d -bool(false) +strrpos() expects parameter 1 to be string, resource given +strrpos() expects parameter 1 to be string, resource given -- Iteration 25 -- bool(false) bool(false) diff --git a/ext/standard/tests/strings/strstr.phpt b/ext/standard/tests/strings/strstr.phpt index cc3b7c5453160..6bdc3feab1a31 100644 Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ diff --git a/ext/standard/tests/strings/strtolower-win32.phpt b/ext/standard/tests/strings/strtolower-win32.phpt index c0ad1d0115e67..ff631754df6a8 100644 Binary files a/ext/standard/tests/strings/strtolower-win32.phpt and b/ext/standard/tests/strings/strtolower-win32.phpt differ diff --git a/ext/standard/tests/strings/strtolower.phpt b/ext/standard/tests/strings/strtolower.phpt index 47dfe097626ea..7c7e2bb4c7e13 100644 Binary files a/ext/standard/tests/strings/strtolower.phpt and b/ext/standard/tests/strings/strtolower.phpt differ diff --git a/ext/standard/tests/strings/strtoupper1-win32.phpt b/ext/standard/tests/strings/strtoupper1-win32.phpt index 60701652e19b6..7240e5c021dc8 100644 Binary files a/ext/standard/tests/strings/strtoupper1-win32.phpt and b/ext/standard/tests/strings/strtoupper1-win32.phpt differ diff --git a/ext/standard/tests/strings/strtoupper1.phpt b/ext/standard/tests/strings/strtoupper1.phpt index e0ebf42ea767e..c243ff10c76f0 100644 Binary files a/ext/standard/tests/strings/strtoupper1.phpt and b/ext/standard/tests/strings/strtoupper1.phpt differ diff --git a/ext/standard/tests/strings/strval_error.phpt b/ext/standard/tests/strings/strval_error.phpt index 37ecfd14d571d..acf3cc623a8f8 100644 --- a/ext/standard/tests/strings/strval_error.phpt +++ b/ext/standard/tests/strings/strval_error.phpt @@ -16,17 +16,6 @@ class MyClass // no toString() method defined } -$string = "Hello"; -$extra_arg = 10; - -//Test strval with one more than the expected number of arguments -echo "\n-- Testing strval() function with more than expected no. of arguments --\n"; -var_dump( strval($string, $extra_arg) ); - -// Testing strval with one less than the expected number of arguments -echo "\n-- Testing strval() function with less than expected no. of arguments --\n"; -var_dump( strval() ); - // Testing strval with a object which has no toString() method echo "\n-- Testing strval() function with object which has not toString() method --\n"; var_dump( strval(new MyClass()) ); @@ -36,16 +25,6 @@ var_dump( strval(new MyClass()) ); --EXPECTF-- *** Testing strval() : error conditions *** --- Testing strval() function with more than expected no. of arguments -- - -Warning: strval() expects exactly 1 parameter, 2 given in %s on line %d -NULL - --- Testing strval() function with less than expected no. of arguments -- - -Warning: strval() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -- Testing strval() function with object which has not toString() method -- Recoverable fatal error: Object of class MyClass could not be converted to string in %s on line %d diff --git a/ext/standard/tests/strings/substr.phpt b/ext/standard/tests/strings/substr.phpt index 0901d2082e84a..18e7cd1781209 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_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt index 1fdf1b144fc5c..2e3256631c33f 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -12,11 +12,9 @@ var_dump(substr_compare("abcde", "cd", 1, 2) < 0); var_dump(substr_compare("abcde", "abc", 5, 1)); var_dump(substr_compare("abcde", "abcdef", -10, 10) < 0); var_dump(substr_compare("abcde", "abc", 0, 0)); -var_dump(substr_compare("abcde", -1, 0, NULL, new stdClass)); echo "Test\n"; var_dump(substr_compare("abcde", "abc", 0, -1)); var_dump(substr_compare("abcde", "abc", -1, NULL, -5) > 0); -var_dump(substr_compare("abcde", -1, 0, "str", new stdClass)); echo "Done\n"; ?> @@ -32,15 +30,9 @@ Warning: substr_compare(): The start position cannot exceed initial string lengt bool(false) bool(true) int(0) - -Warning: substr_compare() expects parameter 5 to be bool, object given in %s on line %d -bool(false) Test Warning: substr_compare(): The length must be greater than or equal to zero in %s on line %d bool(false) bool(true) - -Warning: substr_compare() expects parameter 4 to be int, string given in %s on line %d -bool(false) Done diff --git a/ext/standard/tests/strings/substr_count_error.phpt b/ext/standard/tests/strings/substr_count_error.phpt index eecc251e6cdd6..246963d13b40e 100644 --- a/ext/standard/tests/strings/substr_count_error.phpt +++ b/ext/standard/tests/strings/substr_count_error.phpt @@ -6,12 +6,6 @@ Test substr_count() function (error conditions) echo "\n*** Testing error conditions ***\n"; $str = 'abcdefghik'; -/* Zero argument */ -var_dump( substr_count() ); - -/* more than expected no. of args */ -var_dump( substr_count($str, "t", 0, 15, 30) ); - /* offset before start */ var_dump(substr_count($str, "t", -20)); @@ -22,9 +16,6 @@ var_dump(substr_count($str, "t", 25)); Warning message expected, as length+offset > length of string */ var_dump( substr_count($str, "i", 5, 7) ); -/* Invalid offset argument */ -var_dump( substr_count($str, "t", "") ); - /* length too small */ var_dump( substr_count($str, "t", 2, -20) ); @@ -34,12 +25,6 @@ echo "Done\n"; --EXPECTF-- *** Testing error conditions *** -Warning: substr_count() expects at least 2 parameters, 0 given in %s on line %d -NULL - -Warning: substr_count() expects at most 4 parameters, 5 given in %s on line %d -NULL - Warning: substr_count(): Offset not contained in string in %s on line %d bool(false) @@ -49,9 +34,6 @@ bool(false) Warning: substr_count(): Invalid length value in %s on line %d bool(false) -Warning: substr_count() expects parameter 3 to be int, string given in %s on line %d -NULL - Warning: substr_count(): Invalid length value in %s on line %d bool(false) Done diff --git a/ext/standard/tests/strings/substr_count_variation_001.phpt b/ext/standard/tests/strings/substr_count_variation_001.phpt index 71f2d223e1040..19a9a0310d0dc 100644 --- a/ext/standard/tests/strings/substr_count_variation_001.phpt +++ b/ext/standard/tests/strings/substr_count_variation_001.phpt @@ -12,9 +12,6 @@ var_dump( substr_count($str, "i", "5t") ); var_dump( substr_count($str, "i", "5t", "10t") ); echo "\n-- 3rd or 4th arg as NULL --\n"; -var_dump( substr_count($str, "t", "") ); -var_dump( substr_count($str, "T", "") ); -var_dump( substr_count($str, "t", "", 15) ); var_dump( substr_count($str, "I", NULL) ); var_dump( substr_count($str, "i", NULL, 10) ); @@ -67,15 +64,6 @@ Notice: A non well formed numeric value encountered in %s on line %d int(2) -- 3rd or 4th arg as NULL -- - -Warning: substr_count() expects parameter 3 to be int, string given %s on line %d -NULL - -Warning: substr_count() expects parameter 3 to be int, string given %s on line %d -NULL - -Warning: substr_count() expects parameter 3 to be int, string given %s on line %d -NULL int(0) int(2) diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt index ac945349fe2c2..936d0fd1d5813 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -15,13 +15,6 @@ echo "*** Testing substr_replace() : error conditions ***\n"; $s1 = "Good morning"; -echo "\n-- Testing substr_replace() function with less than expected no. of arguments --\n"; -var_dump(substr_replace()); -var_dump(substr_replace($s1, "evening")); - -echo "\n-- Testing substr_replace() function with more than expected no. of arguments --\n"; -var_dump(substr_replace($s1, "evening", 5, 7, true)); - 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))); @@ -37,19 +30,6 @@ var_dump(substr_replace($s1, "evening", array(5), array(8))); --EXPECTF-- *** Testing substr_replace() : error conditions *** --- Testing substr_replace() function with less than expected no. of arguments -- - -Warning: substr_replace() expects at least 3 parameters, 0 given in %s on line %d -NULL - -Warning: substr_replace() expects at least 3 parameters, 2 given in %s on line %d -NULL - --- Testing substr_replace() function with more than expected no. of arguments -- - -Warning: substr_replace() expects at most 4 parameters, 5 given in %s on line %d -NULL - -- 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 diff --git a/ext/standard/tests/strings/trim1.phpt b/ext/standard/tests/strings/trim1.phpt index d0e4070d80612..1ad504c61d078 100644 Binary files a/ext/standard/tests/strings/trim1.phpt and b/ext/standard/tests/strings/trim1.phpt differ diff --git a/ext/standard/tests/strings/trim_error.phpt b/ext/standard/tests/strings/trim_error.phpt index b845cee1ac316..046a2b04f98bf 100644 --- a/ext/standard/tests/strings/trim_error.phpt +++ b/ext/standard/tests/strings/trim_error.phpt @@ -11,14 +11,6 @@ Test trim() function : error conditions echo "*** Testing trim() : error conditions ***\n"; -echo "\n-- Testing trim() function with no arguments --\n"; -var_dump( trim() ); - -echo "\n-- Testing trim() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( trim("Hello World", "Heo", $extra_arg) ); - - $hello = " Hello World\n"; echo "\n-- Test trim function with various invalid charlists --\n"; var_dump(trim($hello, "..a")); @@ -31,16 +23,6 @@ var_dump(trim($hello, "a..b..c")); --EXPECTF-- *** Testing trim() : error conditions *** --- Testing trim() function with no arguments -- - -Warning: trim() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing trim() function with more than expected no. of arguments -- - -Warning: trim() expects at most 2 parameters, 3 given in %s on line %d -NULL - -- Test trim function with various invalid charlists -- Warning: trim(): Invalid '..'-range, no character to the left of '..' in %s on line %d diff --git a/ext/standard/tests/strings/ucfirst.phpt b/ext/standard/tests/strings/ucfirst.phpt index 0b177a8565144..3508881d3ca66 100644 Binary files a/ext/standard/tests/strings/ucfirst.phpt and b/ext/standard/tests/strings/ucfirst.phpt differ diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt index f04e493772992..b34be23267851 100644 --- a/ext/standard/tests/strings/unpack_error.phpt +++ b/ext/standard/tests/strings/unpack_error.phpt @@ -10,13 +10,6 @@ Test unpack() function : error conditions echo "*** Testing unpack() : error conditions ***\n"; -echo "\n-- Testing unpack() function with no arguments --\n"; -var_dump( unpack() ); - -echo "\n-- Testing unpack() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump(unpack("I", pack("I", 65534), 0, $extra_arg)); - echo "\n-- Testing unpack() function with invalid format character --\n"; $extra_arg = 10; var_dump(unpack("B", pack("I", 65534))); @@ -25,16 +18,6 @@ var_dump(unpack("B", pack("I", 65534))); --EXPECTF-- *** Testing unpack() : error conditions *** --- Testing unpack() function with no arguments -- - -Warning: unpack() expects at least 2 parameters, 0 given in %s on line %d -NULL - --- Testing unpack() function with more than expected no. of arguments -- - -Warning: unpack() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Testing unpack() function with invalid format character -- Warning: unpack(): Invalid format type B in %s on line %d diff --git a/ext/standard/tests/strings/uuencode.phpt b/ext/standard/tests/strings/uuencode.phpt index 5a1f3d2a244b7..8199a2ed0571b 100644 --- a/ext/standard/tests/strings/uuencode.phpt +++ b/ext/standard/tests/strings/uuencode.phpt @@ -3,9 +3,6 @@ uuencode family tests --FILE-- --EXPECTF-- -Warning: convert_uuencode() expects parameter 1 to be string, array given in %s on line %d -bool(false) - -Warning: convert_uudecode() expects parameter 1 to be string, array given in %s on line %d -bool(false) bool(false) bool(false) string(60) "J?B%`(R0E7B8J*"E??7M03TE5651215=145-$1D=(2DM,.CQ-3D)60UA: diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt index c56631ecd7e9c..b4548e8b49e85 100644 --- a/ext/standard/tests/strings/vfprintf_error1.phpt +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -20,8 +20,16 @@ echo "\n-- Testing vfprintf() function with more than expected no. of arguments $format = 'string_val'; $args = array( 1, 2 ); $extra_arg = 10; -var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); -var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); +try { + var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} // Close handle fclose($fp); @@ -37,10 +45,6 @@ unlink( $file ); ?> --EXPECTF-- -- Testing vfprintf() function with more than expected no. of arguments -- - -Warning: Wrong parameter count for vfprintf() in %s on line %d -NULL - -Warning: Wrong parameter count for vfprintf() in %s on line %d -NULL +Wrong parameter count for vfprintf() +Wrong parameter count for vfprintf() ===DONE=== diff --git a/ext/standard/tests/strings/vfprintf_error4.phpt b/ext/standard/tests/strings/vfprintf_error4.phpt index 2865d42a9e655..e54e34f4cdf63 100644 --- a/ext/standard/tests/strings/vfprintf_error4.phpt +++ b/ext/standard/tests/strings/vfprintf_error4.phpt @@ -17,7 +17,11 @@ $file = 'vfprintf_error4.txt'; $fp = fopen( $file, "a+" ); echo "\n-- Testing vfprintf() function with other strangeties --\n"; -var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) ); +try { + var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump( vfprintf( $fp, 'Foo %$c-0202Sd', array( 2 ) ) ); // Close handle @@ -34,9 +38,7 @@ unlink( $file ); ?> --EXPECTF-- -- Testing vfprintf() function with other strangeties -- - -Warning: vfprintf() expects parameter 1 to be resource, string given in %s on line %d -bool(false) +vfprintf() expects parameter 1 to be resource, string given Warning: vfprintf(): Argument number must be greater than zero in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt index 76422011c2fc3..7c969ffff9fda 100644 --- a/ext/standard/tests/strings/vfprintf_variation1.phpt +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -48,8 +48,6 @@ writeAndDump( $fp, "%s %s %s", array( 'bar', 'bar', 'bar' ) ); writeAndDump( $fp, "%02d", array( 50 ) ); writeAndDump( $fp, "", array() ); writeAndDump( $fp, "Testing %b %d %f %o %s %x %X", array( 9, 6, 2.5502, 24, "foobar", 15, 65 ) ); -@writeAndDump( $funset, "Foo with %s", array( 'string' ) ); -@writeAndDump( new FooClass(), "Foo with %s", array( 'string' ) ); // Close handle fclose( $fp ); @@ -79,8 +77,4 @@ string(0) "" int(0) string(38) "Testing 1001 6 2.550200 30 foobar f 41" int(38) -bool(false) -bool(false) -bool(false) -bool(false) ===DONE=== diff --git a/ext/standard/tests/strings/wordwrap_error.phpt b/ext/standard/tests/strings/wordwrap_error.phpt index 41c5cbdb69e94..ad75461d3d19b 100644 --- a/ext/standard/tests/strings/wordwrap_error.phpt +++ b/ext/standard/tests/strings/wordwrap_error.phpt @@ -9,19 +9,10 @@ Test wordwrap() function : error conditions echo "*** Testing wordwrap() : error conditions ***\n"; -// Zero argument -echo "\n-- Testing wordwrap() function with Zero arguments --\n"; -var_dump( wordwrap() ); - -// More than expected number of arguments -echo "\n-- Testing wordwrap() function with more than expected no. of arguments --\n"; $str = 'testing wordwrap function'; $width = 10; $break = '
\n'; $cut = true; -$extra_arg = "extra_arg"; - -var_dump( wordwrap($str, $width, $break, $cut, $extra_arg) ); // $width arg as negative value echo "\n-- Testing wordwrap() function with negative/zero value for width argument --\n"; @@ -54,16 +45,6 @@ echo "Done\n"; --EXPECTF-- *** Testing wordwrap() : error conditions *** --- Testing wordwrap() function with Zero arguments -- - -Warning: wordwrap() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing wordwrap() function with more than expected no. of arguments -- - -Warning: wordwrap() expects at most 4 parameters, 5 given in %s on line %d -NULL - -- Testing wordwrap() function with negative/zero value for width argument -- -- width = 0 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" diff --git a/ext/standard/tests/time/strptime_error.phpt b/ext/standard/tests/time/strptime_error.phpt index f49025be44491..3f7bbbdb82424 100644 --- a/ext/standard/tests/time/strptime_error.phpt +++ b/ext/standard/tests/time/strptime_error.phpt @@ -19,20 +19,8 @@ date_default_timezone_set("Europe/London"); echo "*** Testing strptime() : error conditions ***\n"; -echo "\n-- Testing strptime() function with Zero arguments --\n"; -var_dump( strptime() ); - -echo "\n-- Testing strptime() function with less than expected no. of arguments --\n"; -$format = '%b %d %Y %H:%M:%S'; -$timestamp = mktime(8, 8, 8, 8, 8, 2008); -$date = strftime($format, $timestamp); -var_dump( strptime($date) ); - -echo "\n-- Testing strptime() function with more than expected no. of arguments --\n"; -$extra_arg = 10; -var_dump( strptime($date, $format, $extra_arg) ); - echo "\n-- Testing strptime() function on failure --\n"; +$format = '%b %d %Y %H:%M:%S'; var_dump( strptime('foo', $format) ); ?> @@ -40,21 +28,6 @@ var_dump( strptime('foo', $format) ); --EXPECTF-- *** Testing strptime() : error conditions *** --- Testing strptime() function with Zero arguments -- - -Warning: strptime() expects exactly 2 parameters, 0 given in %s on line %d -NULL - --- Testing strptime() function with less than expected no. of arguments -- - -Warning: strptime() expects exactly 2 parameters, 1 given in %s on line %d -NULL - --- Testing strptime() function with more than expected no. of arguments -- - -Warning: strptime() expects exactly 2 parameters, 3 given in %s on line %d -NULL - -- Testing strptime() function on failure -- bool(false) ===DONE=== diff --git a/ext/sysvmsg/tests/005.phpt b/ext/sysvmsg/tests/005.phpt index a2680c21c0f4c..0016ab82c2f78 100644 --- a/ext/sysvmsg/tests/005.phpt +++ b/ext/sysvmsg/tests/005.phpt @@ -10,13 +10,12 @@ $tests = array(null, 'foo'); foreach ($tests as $q) { if ($q === null) { - do { - $id = ftok(__FILE__, chr(mt_rand(0, 255))); - } while (msg_queue_exists($id)); + do { + $id = ftok(__FILE__, chr(mt_rand(0, 255))); } while (msg_queue_exists($id)); + } $q = msg_get_queue($id) or die("Failed to create queue"); msg_remove_queue($q) or die("Failed to close queue"); - } echo "Using '$q' as queue resource:\n"; @@ -50,22 +49,16 @@ bool(false) Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d bool(false) bool(true) -Using 'foo' as queue resource: - -Warning: msg_set_queue() expects parameter 1 to be resource, string given in %s on line %d +Using 'Resource id #5' as queue resource: bool(false) - -Warning: msg_stat_queue() expects parameter 1 to be resource, string given in %s on line %d -bool(false) - -Warning: msg_receive() expects parameter 1 to be resource, string given in %s on line %d bool(false) bool(false) +bool(true) -Warning: msg_receive() expects parameter 1 to be resource, string given in %s on line %d +Warning: msg_receive(): maximum size of the message has to be greater than zero in %s on line %d bool(false) -Warning: msg_send() expects parameter 1 to be resource, string given in %s on line %d -bool(false) +Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d bool(false) +bool(true) Done diff --git a/ext/sysvshm/tests/001.phpt b/ext/sysvshm/tests/001.phpt index 55fd8eec1dc8c..55d5444b98c1e 100644 --- a/ext/sysvshm/tests/001.phpt +++ b/ext/sysvshm/tests/001.phpt @@ -8,10 +8,6 @@ if (!function_exists('ftok')){ print 'skip'; } --FILE-- --EXPECTF-- -Warning: ftok() expects exactly 2 parameters, 0 given in %s on line %d -NULL - -Warning: ftok() expects exactly 2 parameters, 1 given in %s on line %d -NULL - -Warning: ftok() expects exactly 2 parameters, 3 given in %s on line %d -NULL - Warning: ftok(): Pathname is invalid in %s on line %d int(-1) diff --git a/ext/sysvshm/tests/002.phpt b/ext/sysvshm/tests/002.phpt index 3bfb28e5c68f4..d558623242993 100644 --- a/ext/sysvshm/tests/002.phpt +++ b/ext/sysvshm/tests/002.phpt @@ -10,19 +10,14 @@ if (!function_exists('ftok')){ print 'skip'; } $key = ftok(__FILE__, 't'); -var_dump(shm_attach()); -var_dump(shm_attach(1,2,3,4)); - var_dump(shm_attach(-1, 0)); var_dump(shm_attach(0, -1)); var_dump(shm_attach(123, -1)); -var_dump($s = shm_attach($key, -1)); -shm_remove($s); -var_dump($s = shm_attach($key, 0)); -shm_remove($s); +var_dump(shm_attach($key, -1)); +var_dump(shm_attach($key, 0)); var_dump($s = shm_attach($key, 1024)); -shm_remove($key); +shm_remove($s); var_dump($s = shm_attach($key, 1024)); shm_remove($s); var_dump($s = shm_attach($key, 1024, 0666)); @@ -36,12 +31,6 @@ shm_remove($s); echo "Done\n"; ?> --EXPECTF-- -Warning: shm_attach() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: shm_attach() expects at most 3 parameters, 4 given in %s on line %d -NULL - Warning: shm_attach(): Segment size must be greater than zero in %s on line %d bool(false) @@ -54,15 +43,9 @@ bool(false) Warning: shm_attach(): Segment size must be greater than zero in %s on line %d bool(false) -Warning: shm_remove() expects parameter 1 to be resource, bool given in %s on line %d - Warning: shm_attach(): Segment size must be greater than zero in %s on line %d bool(false) - -Warning: shm_remove() expects parameter 1 to be resource, bool given in %s on line %d resource(%d) of type (sysvshm) - -Warning: shm_remove() expects parameter 1 to be resource, int given in %s on line %d resource(%d) of type (sysvshm) resource(%d) of type (sysvshm) resource(%d) of type (sysvshm) diff --git a/ext/sysvshm/tests/003.phpt b/ext/sysvshm/tests/003.phpt index 010ac83cd3d6d..fd81c48a67a86 100644 --- a/ext/sysvshm/tests/003.phpt +++ b/ext/sysvshm/tests/003.phpt @@ -10,19 +10,12 @@ if (!function_exists('ftok')){ print 'skip'; } $key = ftok(dirname(__FILE__)."/003.phpt", 'q'); -var_dump(shm_detach()); -var_dump(shm_detach(1,1)); - $s = shm_attach($key); var_dump(shm_detach($s)); var_dump(shm_detach($s)); shm_remove($s); -var_dump(shm_detach(0)); -var_dump(shm_detach(1)); -var_dump(shm_detach(-1)); - echo "Done\n"; ?> --CLEAN-- @@ -34,24 +27,10 @@ shm_remove($s); ?> --EXPECTF-- -Warning: shm_detach() expects exactly 1 parameter, 0 given in %s003.php on line %d -NULL - -Warning: shm_detach() expects exactly 1 parameter, 2 given in %s003.php on line %d -NULL bool(true) Warning: shm_detach(): supplied resource is not a valid sysvshm resource in %s003.php on line %d bool(false) Warning: shm_remove(): supplied resource is not a valid sysvshm resource in %s003.php on line %d - -Warning: shm_detach() expects parameter 1 to be resource, int given in %s003.php on line %d -NULL - -Warning: shm_detach() expects parameter 1 to be resource, int given in %s003.php on line %d -NULL - -Warning: shm_detach() expects parameter 1 to be resource, int given in %s003.php on line %d -NULL Done diff --git a/ext/sysvshm/tests/004.phpt b/ext/sysvshm/tests/004.phpt index ee64491840327..23496f5c1c1a1 100644 --- a/ext/sysvshm/tests/004.phpt +++ b/ext/sysvshm/tests/004.phpt @@ -11,9 +11,6 @@ if (!function_exists('ftok')){ print 'skip'; } $key = ftok(__FILE__, 't'); $s = shm_attach($key, 1024); -var_dump(shm_put_var()); -var_dump(shm_put_var(-1, -1, -1)); -var_dump(shm_put_var(-1, 10, "qwerty")); var_dump(shm_put_var($s, -1, "qwerty")); var_dump(shm_put_var($s, 10, "qwerty")); var_dump(shm_put_var($s, 10, "qwerty")); @@ -26,18 +23,10 @@ shm_remove($s); echo "Done\n"; ?> --EXPECTF-- -Warning: shm_put_var() expects exactly 3 parameters, 0 given in %s004.php on line %d -NULL - -Warning: shm_put_var() expects parameter 1 to be resource, int given in %s004.php on line %d -NULL - -Warning: shm_put_var() expects parameter 1 to be resource, int given in %s004.php on line %d -NULL bool(true) bool(true) bool(true) -Warning: shm_put_var(): not enough shared memory left in %s004.php on line 14 +Warning: shm_put_var(): not enough shared memory left in %s004.php on line %d bool(false) Done diff --git a/ext/sysvshm/tests/005.phpt b/ext/sysvshm/tests/005.phpt index 0a3d3422e823c..879be31c13267 100644 --- a/ext/sysvshm/tests/005.phpt +++ b/ext/sysvshm/tests/005.phpt @@ -17,14 +17,9 @@ shm_put_var($s, 1, array(1,2,3)); shm_put_var($s, 2, false); shm_put_var($s, 3, null); -var_dump(shm_get_var()); - -var_dump(shm_get_var(-1, -1)); - var_dump(shm_get_var($s, 1000)); var_dump(shm_get_var($s, -10000)); -var_dump(shm_get_var($s, array())); var_dump(shm_get_var($s, -1)); var_dump(shm_get_var($s, 0)); var_dump(shm_get_var($s, 1)); @@ -41,20 +36,11 @@ shm_remove($s); echo "Done\n"; ?> --EXPECTF-- -Warning: shm_get_var() expects exactly 2 parameters, 0 given in %s005.php on line %d -NULL - -Warning: shm_get_var() expects parameter 1 to be resource, int given in %s005.php on line %d -NULL - Warning: shm_get_var(): variable key 1000 doesn't exist in %s005.php on line %d bool(false) Warning: shm_get_var(): variable key -10000 doesn't exist in %s005.php on line %d bool(false) - -Warning: shm_get_var() expects parameter 2 to be int, array given in %s005.php on line %d -NULL string(11) "test string" object(stdClass)#%d (0) { } diff --git a/ext/sysvshm/tests/006.phpt b/ext/sysvshm/tests/006.phpt index b38aee02a12b3..278838f063c48 100644 --- a/ext/sysvshm/tests/006.phpt +++ b/ext/sysvshm/tests/006.phpt @@ -13,8 +13,6 @@ $s = shm_attach($key, 1024); shm_put_var($s, 1, "test string"); -var_dump(shm_remove_var()); -var_dump(shm_remove_var(-1, -1)); var_dump(shm_remove_var($s, -10)); var_dump(shm_get_var($s, 1)); @@ -29,12 +27,6 @@ shm_remove($s); echo "Done\n"; ?> --EXPECTF-- -Warning: shm_remove_var() expects exactly 2 parameters, 0 given in %s006.php on line %d -NULL - -Warning: shm_remove_var() expects parameter 1 to be resource, int given in %s006.php on line %d -NULL - Warning: shm_remove_var(): variable key -10 doesn't exist in %s006.php on line %d bool(false) string(11) "test string" diff --git a/ext/sysvshm/tests/007.phpt b/ext/sysvshm/tests/007.phpt index a165a8bfbfbda..747d401333acd 100644 --- a/ext/sysvshm/tests/007.phpt +++ b/ext/sysvshm/tests/007.phpt @@ -11,11 +11,6 @@ if (!function_exists('ftok')){ print 'skip'; } $key = ftok(__FILE__, 't'); $s = shm_attach($key, 1024); -var_dump(shm_remove()); -var_dump(shm_remove(-1)); -var_dump(shm_remove(0)); -var_dump(shm_remove("")); - var_dump(shm_remove($s)); shm_detach($s); @@ -24,17 +19,6 @@ var_dump(shm_remove($s)); echo "Done\n"; ?> --EXPECTF-- -Warning: shm_remove() expects exactly 1 parameter, 0 given in %s007.php on line %d -NULL - -Warning: shm_remove() expects parameter 1 to be resource, int given in %s007.php on line %d -NULL - -Warning: shm_remove() expects parameter 1 to be resource, int given in %s007.php on line %d -NULL - -Warning: shm_remove() expects parameter 1 to be resource, string given in %s007.php on line %d -NULL bool(true) Warning: shm_remove(): supplied resource is not a valid sysvshm resource in %s007.php on line %d diff --git a/ext/tidy/tests/019.phpt b/ext/tidy/tests/019.phpt index 188b8cd4e9e8f..dae23127b5562 100644 --- a/ext/tidy/tests/019.phpt +++ b/ext/tidy/tests/019.phpt @@ -7,17 +7,14 @@ tidy_repair_*() and invalid parameters $l = 1; $s = ""; -$a = array(); tidy_repair_string($s, $l, $l, $l); tidy_repair_string($s, $s, $s, $s); tidy_repair_string($l, $l, $l ,$l); -tidy_repair_string($a, $a, $a, $a); tidy_repair_file($s, $l, $l, $l); tidy_repair_file($s, $s, $s, $s); tidy_repair_file($l, $l, $l ,$l); -tidy_repair_file($a, $a, $a, $a); echo "Done\n"; ?> @@ -32,11 +29,7 @@ Warning: tidy_repair_string(): Could not load configuration file '1' in %s on li Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d -Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d - Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d - -Warning: tidy_repair_file() expects parameter 1 to be a valid path, array given in %s on line %d Done diff --git a/ext/tokenizer/tests/001.phpt b/ext/tokenizer/tests/001.phpt index 4c6295cdf8d7c..8e58c81891963 100644 --- a/ext/tokenizer/tests/001.phpt +++ b/ext/tokenizer/tests/001.phpt @@ -126,8 +126,6 @@ echo token_name(T_HALT_COMPILER), "\n"; echo token_name(-1), "\n"; echo token_name(0x8000000F), "\n"; -echo token_name("string"), "\n"; -echo token_name(array()), "\n"; echo "Done\n"; ?> @@ -251,10 +249,4 @@ T_CLONE T_HALT_COMPILER UNKNOWN UNKNOWN - -Warning: token_name() expects parameter 1 to be int, string given in %s on line %d - - -Warning: token_name() expects parameter 1 to be int, array given in %s on line %d - Done diff --git a/ext/tokenizer/tests/003.phpt b/ext/tokenizer/tests/003.phpt index 3ba6d594dfa7e..6c3cc4c55914c 100644 --- a/ext/tokenizer/tests/003.phpt +++ b/ext/tokenizer/tests/003.phpt @@ -5,8 +5,6 @@ token_get_all() and wrong parameters --FILE-- --EXPECTF-- -Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d -NULL - -Warning: token_get_all() expects parameter 1 to be string, object given in %s on line %d -NULL array(0) { } array(1) { diff --git a/ext/xmlrpc/tests/001.phpt b/ext/xmlrpc/tests/001.phpt index 49dfba8f1049a..af41530ab2076 100644 --- a/ext/xmlrpc/tests/001.phpt +++ b/ext/xmlrpc/tests/001.phpt @@ -7,7 +7,6 @@ xmlrpc_encode_request() with wrong arguments var_dump(xmlrpc_encode_request(-1, 1)); var_dump(xmlrpc_encode_request("", 1)); -var_dump(xmlrpc_encode_request(array(), 1)); var_dump(xmlrpc_encode_request(3.4, 1)); echo "Done\n"; @@ -37,9 +36,6 @@ string(160) " " - -Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d -NULL string(175) " 3.4 diff --git a/ext/xmlrpc/tests/002.phpt b/ext/xmlrpc/tests/002.phpt index cb4b4aa818e26..a79108233757a 100644 --- a/ext/xmlrpc/tests/002.phpt +++ b/ext/xmlrpc/tests/002.phpt @@ -21,10 +21,6 @@ $r = xmlrpc_encode_request(-1, ""); var_dump(xmlrpc_decode_request($r, $method)); var_dump($method); -$r = xmlrpc_encode_request(array(), 1); -var_dump(xmlrpc_decode_request($r, $method)); -var_dump($method); - echo "Done\n"; ?> --EXPECTF-- @@ -46,8 +42,4 @@ array(1) { string(0) "" } string(2) "-1" - -Warning: xmlrpc_encode_request() expects parameter 1 to be string, array given in %s on line %d -NULL -string(2) "-1" Done diff --git a/ext/xmlwriter/tests/bug41326.phpt b/ext/xmlwriter/tests/bug41326.phpt index c87af84722745..886e14926160d 100644 --- a/ext/xmlwriter/tests/bug41326.phpt +++ b/ext/xmlwriter/tests/bug41326.phpt @@ -15,7 +15,6 @@ $xml->writeElement('foo', null); $xml->writeElement('foo2', ""); $xml->writeElement('foo3'); $xml->startElement('bar'); -$xml->endElement('bar'); $xml->endElement(); $xml->endElement(); print $xml->flush(true); @@ -37,7 +36,6 @@ $xw->endDocument(); print $xw->flush(true); ?> --EXPECTF-- -Warning: XMLWriter::endElement() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/zip/tests/oo_getcomment.phpt b/ext/zip/tests/oo_getcomment.phpt index c6b505828dd2b..b3da94e5f81f0 100644 --- a/ext/zip/tests/oo_getcomment.phpt +++ b/ext/zip/tests/oo_getcomment.phpt @@ -20,7 +20,6 @@ echo $zip->getCommentName('foo') . "\n"; echo $zip->getCommentIndex($idx); echo $zip->getCommentName('') . "\n"; -echo $zip->getCommentName() . "\n"; $zip->close(); @@ -30,6 +29,3 @@ Zip archive comment foo comment foo comment Notice: ZipArchive::getCommentName(): Empty string as entry name in %s on line %d - - -Warning: ZipArchive::getCommentName() expects at least 1 parameter, 0 given in %s on line %d diff --git a/ext/zip/tests/zip_open_error.phpt b/ext/zip/tests/zip_open_error.phpt index eaa1d9731e372..068956b81f666 100644 --- a/ext/zip/tests/zip_open_error.phpt +++ b/ext/zip/tests/zip_open_error.phpt @@ -12,10 +12,7 @@ if(!extension_loaded('zip')) die('skip'); echo "Test case 1:"; $zip = zip_open(""); -echo "Test case 2:"; -$zip = zip_open("i_dont_care_about_this_parameter", "this_is_one_to_many"); - -echo "Test case 3:\n"; +echo "Test case 2:\n"; $zip = zip_open("/non_exisitng_directory/test_procedural.zip"); echo is_resource($zip) ? "OK" : "Failure"; ?> @@ -23,6 +20,4 @@ echo is_resource($zip) ? "OK" : "Failure"; Test case 1: Warning: zip_open(): Empty string as source in %s on line %d Test case 2: -Warning: zip_open() expects exactly 1 parameter, 2 given in %s on line %d -Test case 3: Failure diff --git a/ext/zlib/tests/004-mb.phpt b/ext/zlib/tests/004-mb.phpt index 92f7db1b708dd..607228fd6f69b 100644 --- a/ext/zlib/tests/004-mb.phpt +++ b/ext/zlib/tests/004-mb.phpt @@ -5,9 +5,7 @@ gzfile() with various invalid params --FILE-- --EXPECTF-- -Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d bool(false) - -Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d -NULL array(6) { [0]=> string(36) "When you're taught through feelings diff --git a/ext/zlib/tests/004.phpt b/ext/zlib/tests/004.phpt index b8d0f0eccd2c1..4437ab154fc71 100644 --- a/ext/zlib/tests/004.phpt +++ b/ext/zlib/tests/004.phpt @@ -5,9 +5,7 @@ gzfile() with various invalid params --FILE-- --EXPECTF-- -Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d bool(false) - -Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d -NULL array(6) { [0]=> string(36) "When you're taught through feelings diff --git a/ext/zlib/tests/005.phpt b/ext/zlib/tests/005.phpt index 6333612183086..69fe8efe6ae68 100644 --- a/ext/zlib/tests/005.phpt +++ b/ext/zlib/tests/005.phpt @@ -5,7 +5,6 @@ gzcompress()/gzuncompress() and invalid params --FILE-- --EXPECTF-- -Warning: gzcompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gzcompress(): compression level (1000) must be within -1..9 in %s on line %d bool(false) string(%d) "%a" @@ -45,9 +40,6 @@ string(%d) "%a" string(%d) "%a" string(%d) "%a" -Warning: gzuncompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gzuncompress(): %s error in %s on line %d bool(false) diff --git a/ext/zlib/tests/006.phpt b/ext/zlib/tests/006.phpt index 0d082092ca377..2c666390c8915 100644 --- a/ext/zlib/tests/006.phpt +++ b/ext/zlib/tests/006.phpt @@ -5,7 +5,6 @@ gzdeflate()/gzinflate() and invalid params --FILE-- --EXPECTF-- -Warning: gzdeflate() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gzdeflate(): compression level (1000) must be within -1..9 in %s on line %d bool(false) string(%d) "%a" @@ -46,9 +41,6 @@ string(%d) "%a" string(%d) "%a" string(%d) "%a" -Warning: gzinflate() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: gzinflate(): data error in %s on line %d bool(false) diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt index 6c42bf67dbe87..6028104b9ad0d 100644 --- a/ext/zlib/tests/007.phpt +++ b/ext/zlib/tests/007.phpt @@ -5,8 +5,6 @@ gzencode() and invalid params --FILE-- --EXPECTF-- -Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d -NULL - Warning: gzencode(): compression level (-10) must be within -1..9 in %s on line %d bool(false) diff --git a/ext/zlib/tests/gzcompress_error1.phpt b/ext/zlib/tests/gzcompress_error1.phpt index 3f742a4dca5a0..3601c61b53fef 100644 --- a/ext/zlib/tests/gzcompress_error1.phpt +++ b/ext/zlib/tests/gzcompress_error1.phpt @@ -20,53 +20,22 @@ if (!extension_loaded("zlib")) { echo "*** Testing gzcompress() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing gzcompress() function with Zero arguments --\n"; -var_dump( gzcompress() ); - -//Test gzcompress with one more than the expected number of arguments -echo "\n-- Testing gzcompress() function with more than expected no. of arguments --\n"; -$data = 'string_val'; -$level = 2; -$encoding = ZLIB_ENCODING_RAW; -$extra_arg = 10; -var_dump( gzcompress($data, $level, $encoding, $extra_arg) ); - echo "\n-- Testing with incorrect compression level --\n"; +$data = 'string_val'; $bad_level = 99; var_dump(gzcompress($data, $bad_level)); echo "\n-- Testing with invalid encoding --\n"; $data = 'string_val'; +$level = 2; $encoding = 99; var_dump(gzcompress($data, $level, $encoding)); -echo "\n-- Testing with incorrect parameters --\n"; - -class Tester { - function Hello() { - echo "Hello\n"; - } -} - -$testclass = new Tester(); -var_dump(gzcompress($testclass)); - ?> ===Done=== --EXPECTF-- *** Testing gzcompress() : error conditions *** --- Testing gzcompress() function with Zero arguments -- - -Warning: gzcompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing gzcompress() function with more than expected no. of arguments -- - -Warning: gzcompress() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Testing with incorrect compression level -- Warning: gzcompress(): compression level (99) must be within -1..9 in %s on line %d @@ -76,9 +45,4 @@ bool(false) Warning: gzcompress(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d bool(false) - --- Testing with incorrect parameters -- - -Warning: gzcompress() expects parameter 1 to be string, object given in %s on line %d -NULL ===Done=== diff --git a/ext/zlib/tests/gzdeflate_error1.phpt b/ext/zlib/tests/gzdeflate_error1.phpt index 93f8c03b4c7ca..af74d1c771a06 100644 --- a/ext/zlib/tests/gzdeflate_error1.phpt +++ b/ext/zlib/tests/gzdeflate_error1.phpt @@ -20,52 +20,22 @@ if (!extension_loaded("zlib")) { echo "*** Testing gzdeflate() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing gzdeflate() function with Zero arguments --\n"; -var_dump( gzdeflate() ); - -//Test gzdeflate with one more than the expected number of arguments -echo "\n-- Testing gzdeflate() function with more than expected no. of arguments --\n"; $data = 'string_val'; -$level = 2; -$encoding = ZLIB_ENCODING_RAW; -$extra_arg = 10; -var_dump( gzdeflate($data, $level, $encoding, $extra_arg) ); echo "\n-- Testing with incorrect compression level --\n"; $bad_level = 99; var_dump(gzdeflate($data, $bad_level)); echo "\n-- Testing with incorrect encoding --\n"; +$level = 2; $bad_encoding = 99; var_dump(gzdeflate($data, $level, $bad_encoding)); -class Tester { - function Hello() { - echo "Hello\n"; - } -} - -echo "\n-- Testing with incorrect parameters --\n"; -$testclass = new Tester(); -var_dump(gzdeflate($testclass)); -var_dump(gzdeflate($data, $testclass)); - ?> ===Done=== --EXPECTF-- *** Testing gzdeflate() : error conditions *** --- Testing gzdeflate() function with Zero arguments -- - -Warning: gzdeflate() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing gzdeflate() function with more than expected no. of arguments -- - -Warning: gzdeflate() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Testing with incorrect compression level -- Warning: gzdeflate(): compression level (99) must be within -1..9 in %s on line %d @@ -75,12 +45,4 @@ bool(false) Warning: gzdeflate(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d bool(false) - --- Testing with incorrect parameters -- - -Warning: gzdeflate() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: gzdeflate() expects parameter 2 to be int, object given in %s on line %d -NULL ===Done=== diff --git a/ext/zlib/tests/gzencode_error1.phpt b/ext/zlib/tests/gzencode_error1.phpt index ac846866c54f3..15b70afb8a147 100644 --- a/ext/zlib/tests/gzencode_error1.phpt +++ b/ext/zlib/tests/gzencode_error1.phpt @@ -20,17 +20,9 @@ if (!extension_loaded("zlib")) { echo "*** Testing gzencode() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing gzencode() function with Zero arguments --\n"; -var_dump( gzencode() ); - -//Test gzencode with one more than the expected number of arguments -echo "\n-- Testing gzencode() function with more than expected no. of arguments --\n"; $data = 'string_val'; $level = 2; $encoding_mode = FORCE_DEFLATE; -$extra_arg = 10; -var_dump( gzencode($data, $level, $encoding_mode, $extra_arg) ); echo "\n-- Testing with incorrect compression level --\n"; $bad_level = 99; @@ -40,35 +32,11 @@ echo "\n-- Testing with incorrect encoding_mode --\n"; $bad_mode = 99; var_dump(gzencode($data, $level, $bad_mode)); -class Tester { - function Hello() { - echo "Hello\n"; - } -} - -echo "\n-- Testing with incorrect parameters --\n"; -$testclass = new Tester(); -var_dump(gzencode($testclass)); -var_dump(gzencode($data, $testclass)); -var_dump(gzencode($data, -1, 99.99)); -var_dump(gzencode($data, -1, $testclass)); -var_dump(gzencode($data, "a very none numeric string\n")); - ?> ===Done=== --EXPECTF-- *** Testing gzencode() : error conditions *** --- Testing gzencode() function with Zero arguments -- - -Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing gzencode() function with more than expected no. of arguments -- - -Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d -NULL - -- Testing with incorrect compression level -- Warning: gzencode(): compression level (99) must be within -1..9 in %s on line %d @@ -78,21 +46,4 @@ bool(false) Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d bool(false) - --- Testing with incorrect parameters -- - -Warning: gzencode() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: gzencode() expects parameter 2 to be int, object given in %s on line %d -NULL - -Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d -bool(false) - -Warning: gzencode() expects parameter 3 to be int, object given in %s on line %d -NULL - -Warning: gzencode() expects parameter 2 to be int, string given in %s on line %d -NULL ===Done=== diff --git a/ext/zlib/tests/gzinflate_error1.phpt b/ext/zlib/tests/gzinflate_error1.phpt index cbfe615511005..5b8e40620ccde 100644 --- a/ext/zlib/tests/gzinflate_error1.phpt +++ b/ext/zlib/tests/gzinflate_error1.phpt @@ -18,58 +18,20 @@ include(dirname(__FILE__) . '/data.inc'); echo "*** Testing gzinflate() : error conditions ***\n"; -echo "\n-- Testing gzcompress() function with Zero arguments --\n"; -var_dump( gzinflate() ); - -echo "\n-- Testing gzcompress() function with more than expected no. of arguments --\n"; -$data = 'string_val'; -$length = 10; -$extra_arg = 10; -var_dump( gzinflate($data, $length, $extra_arg) ); - echo "\n-- Testing with a buffer that is too small --\n"; +$data = 'string_val'; $short_len = strlen($data) - 1; $compressed = gzcompress($data); var_dump(gzinflate($compressed, $short_len)); -echo "\n-- Testing with incorrect parameters --\n"; - -class Tester { - function Hello() { - echo "Hello\n"; - } -} - -$testclass = new Tester(); -var_dump(gzinflate($testclass)); -var_dump(gzinflate($data, $testclass)); - ?> ===DONE=== --EXPECTF-- *** Testing gzinflate() : error conditions *** --- Testing gzcompress() function with Zero arguments -- - -Warning: gzinflate() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing gzcompress() function with more than expected no. of arguments -- - -Warning: gzinflate() expects at most 2 parameters, 3 given in %s on line %d -NULL - -- Testing with a buffer that is too small -- Warning: gzinflate(): data error in %s on line %d bool(false) - --- Testing with incorrect parameters -- - -Warning: gzinflate() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: gzinflate() expects parameter 2 to be int, object given in %s on line %d -NULL ===DONE=== diff --git a/ext/zlib/tests/gzopen_variation4.phpt b/ext/zlib/tests/gzopen_variation4.phpt index baa9c715aeb54..b02c7152a884f 100644 --- a/ext/zlib/tests/gzopen_variation4.phpt +++ b/ext/zlib/tests/gzopen_variation4.phpt @@ -32,73 +32,82 @@ restore_include_path(); chdir($baseDir); rmdir($workingDir); foreach($newdirs as $newdir) { - rmdir($newdir); + rmdir($newdir); } chdir(".."); rmdir($thisTestDir); function test_gzopen($mode) { - global $scriptFile, $secondFile, $firstFile, $filename; - - // create a file in the middle directory - $h = gzopen($secondFile, "w"); - gzwrite($h, "This is a file in dir2"); - gzclose($h); - - echo "\n** testing with mode=$mode **\n"; - // should read dir2 file - $h = gzopen($filename, $mode, true); - gzpassthru($h); - gzclose($h); - echo "\n"; - - //create a file in dir1 - $h = gzopen($firstFile, "w"); - gzwrite($h, "This is a file in dir1"); - gzclose($h); - - //should now read dir1 file - $h = gzopen($filename, $mode, true); - gzpassthru($h); - gzclose($h); - echo "\n"; - - // create a file in working directory - $h = gzopen($filename, "w"); - gzwrite($h, "This is a file in working dir"); - gzclose($h); - - //should still read dir1 file - $h = gzopen($filename, $mode, true); - gzpassthru($h); - gzclose($h); - echo "\n"; - - unlink($firstFile); - unlink($secondFile); - - //should read the file in working dir - $h = gzopen($filename, $mode, true); - gzpassthru($h); - gzclose($h); - echo "\n"; - - // create a file in the script directory - $h = gzopen($scriptFile, "w"); - gzwrite($h, "This is a file in script dir"); - gzclose($h); - - //should read the file in script dir - $h = gzopen($filename, $mode, true); - gzpassthru($h); - gzclose($h); - echo "\n"; - - //cleanup - unlink($filename); - unlink($scriptFile); - + global $scriptFile, $secondFile, $firstFile, $filename; + + // create a file in the middle directory + $h = gzopen($secondFile, "w"); + gzwrite($h, "This is a file in dir2"); + gzclose($h); + + echo "\n** testing with mode=$mode **\n"; + // should read dir2 file + $h = gzopen($filename, $mode, true); + if ($h) { + gzpassthru($h); + gzclose($h); + echo "\n"; + } + + //create a file in dir1 + $h = gzopen($firstFile, "w"); + gzwrite($h, "This is a file in dir1"); + gzclose($h); + + //should now read dir1 file + $h = gzopen($filename, $mode, true); + if ($h) { + gzpassthru($h); + gzclose($h); + echo "\n"; + } + + // create a file in working directory + $h = gzopen($filename, "w"); + gzwrite($h, "This is a file in working dir"); + gzclose($h); + + //should still read dir1 file + $h = gzopen($filename, $mode, true); + if ($h) { + gzpassthru($h); + gzclose($h); + echo "\n"; + } + + unlink($firstFile); + unlink($secondFile); + + //should read the file in working dir + $h = gzopen($filename, $mode, true); + if ($h) { + gzpassthru($h); + gzclose($h); + echo "\n"; + } + + // create a file in the script directory + $h = gzopen($scriptFile, "w"); + gzwrite($h, "This is a file in script dir"); + gzclose($h); + + //should read the file in script dir + $h = gzopen($filename, $mode, true); + if ($h) { + gzpassthru($h); + gzclose($h); + echo "\n"; + } + + //cleanup + unlink($filename); + unlink($scriptFile); } ?> @@ -119,39 +128,14 @@ This is a file in script dir Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d -Warning: gzpassthru() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: gzclose() expects parameter 1 to be resource, bool given in %s on line %d - - Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d -Warning: gzpassthru() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: gzclose() expects parameter 1 to be resource, bool given in %s on line %d - - Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d -Warning: gzpassthru() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: gzclose() expects parameter 1 to be resource, bool given in %s on line %d - - Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d -Warning: gzpassthru() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: gzclose() expects parameter 1 to be resource, bool given in %s on line %d - - Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d -Warning: gzpassthru() expects parameter 1 to be resource, bool given in %s on line %d - -Warning: gzclose() expects parameter 1 to be resource, bool given in %s on line %d - - ** testing with mode=rt ** This is a file in dir2 This is a file in dir1 diff --git a/ext/zlib/tests/gzuncompress_error1.phpt b/ext/zlib/tests/gzuncompress_error1.phpt index f200951d4c9ff..8683a6c829b4e 100644 --- a/ext/zlib/tests/gzuncompress_error1.phpt +++ b/ext/zlib/tests/gzuncompress_error1.phpt @@ -16,18 +16,8 @@ if (!extension_loaded("zlib")) { echo "*** Testing gzuncompress() : error conditions ***\n"; -// Zero arguments -echo "\n-- Testing gzuncompress() function with Zero arguments --\n"; -var_dump( gzuncompress() ); - -//Test gzuncompress with one more than the expected number of arguments -echo "\n-- Testing gzuncompress() function with more than expected no. of arguments --\n"; -$data = 'string_val'; -$length = 10; -$extra_arg = 10; -var_dump( gzuncompress($data, $length, $extra_arg) ); - echo "\n-- Testing with a buffer that is too small --\n"; +$data = 'string_val'; $short_len = strlen($data) - 1; $compressed = gzcompress($data); @@ -36,32 +26,11 @@ var_dump(gzuncompress($compressed, $short_len)); echo "\n-- Testing with incorrect arguments --\n"; var_dump(gzuncompress(123)); -class Tester { - function Hello() { - echo "Hello\n"; - } -} - -$testclass = new Tester(); -var_dump(gzuncompress($testclass)); - -var_dump(gzuncompress($compressed, "this is not a number\n")); - ?> ===DONE=== --EXPECTF-- *** Testing gzuncompress() : error conditions *** --- Testing gzuncompress() function with Zero arguments -- - -Warning: gzuncompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing gzuncompress() function with more than expected no. of arguments -- - -Warning: gzuncompress() expects at most 2 parameters, 3 given in %s on line %d -NULL - -- Testing with a buffer that is too small -- Warning: gzuncompress(): insufficient memory in %s on line %d @@ -71,10 +40,4 @@ bool(false) Warning: gzuncompress(): data error in %s on line %d bool(false) - -Warning: gzuncompress() expects parameter 1 to be string, object given in %s on line %d -NULL - -Warning: gzuncompress() expects parameter 2 to be int, string given in %s on line %d -NULL ===DONE=== diff --git a/ext/zlib/tests/inflate_init_error.phpt b/ext/zlib/tests/inflate_init_error.phpt index 58773e61d34ba..504f795aec65b 100644 --- a/ext/zlib/tests/inflate_init_error.phpt +++ b/ext/zlib/tests/inflate_init_error.phpt @@ -8,12 +8,8 @@ if (!extension_loaded("zlib")) { ?> --FILE-- --EXPECTF-- -Warning: inflate_init() expects at least 1 parameter, 0 given in %s on line %d -NULL - Warning: inflate_init(): encoding mode must be ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d bool(false) diff --git a/ext/zlib/tests/readgzfile_variation10.phpt b/ext/zlib/tests/readgzfile_variation10.phpt deleted file mode 100644 index 004a07775a480..0000000000000 --- a/ext/zlib/tests/readgzfile_variation10.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -Test function readgzfile() by substituting argument 2 with emptyUnsetUndefNull values. ---SKIPIF-- - ---FILE-- - @$unset_var, - 'undefined var' => @$undefined_var, - 'empty string DQ' => "", - 'empty string SQ' => '', - 'uppercase NULL' => NULL, - 'lowercase null' => null, - ); - - -foreach ( $variation as $var ) { - var_dump(readgzfile( $filename, $var ) ); -} -?> -===DONE=== ---EXPECTF-- -When you're taught through feelings -Destiny flying high above -all I know is that you can realize it -Destiny who cares -as it turns around -and I know that it descends down on me -int(176) -When you're taught through feelings -Destiny flying high above -all I know is that you can realize it -Destiny who cares -as it turns around -and I know that it descends down on me -int(176) - -Warning: readgzfile() expects parameter 2 to be int, string given in %s on line %d -NULL - -Warning: readgzfile() expects parameter 2 to be int, string given in %s on line %d -NULL -When you're taught through feelings -Destiny flying high above -all I know is that you can realize it -Destiny who cares -as it turns around -and I know that it descends down on me -int(176) -When you're taught through feelings -Destiny flying high above -all I know is that you can realize it -Destiny who cares -as it turns around -and I know that it descends down on me -int(176) -===DONE=== diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt index 6ce810c836ec1..c69eaa458ce4b 100644 --- a/tests/classes/abstract_user_call.phpt +++ b/tests/classes/abstract_user_call.phpt @@ -20,12 +20,15 @@ $o = new test; $o->func(); -call_user_func(array($o, 'test_base::func')); +try { + call_user_func(array($o, 'test_base::func')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ===DONE=== ---EXPECTF-- +--EXPECT-- test::func() - -Warning: call_user_func() expects parameter 1 to be a valid callback, cannot call abstract method test_base::func() in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, cannot call abstract method test_base::func() ===DONE=== diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt index 4fc41c85f5a3c..c5b32debae17c 100644 --- a/tests/classes/autoload_012.phpt +++ b/tests/classes/autoload_012.phpt @@ -3,12 +3,15 @@ Ensure callback methods in unknown classes trigger autoload. --FILE-- getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- In autoload: string(6) "UndefC" - -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt index ba44806bfec86..4e227a1075c10 100644 --- a/tests/classes/bug27504.phpt +++ b/tests/classes/bug27504.phpt @@ -2,27 +2,30 @@ Bug #27504 (call_user_func_array allows calling of private/protected methods) --FILE-- bar('1'); - } - private function bar ( $param ) { - echo 'Called function foo:bar('.$param.')'."\n"; - } - } +class foo { + function __construct () { + $this->bar('1'); + } + private function bar ( $param ) { + echo 'Called function foo:bar('.$param.')'."\n"; + } +} - $foo = new foo(); +$foo = new foo(); - call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); +try { + call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $foo->bar('3'); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} - $foo->bar('3'); ?> ---EXPECTF-- +--EXPECT-- Called function foo:bar(1) - -Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method foo::bar() in %s on line %d - -Fatal error: Uncaught Error: Call to private method foo::bar() from context '' in %s:%d -Stack trace: -#0 {main} - thrown in %s on line %d +call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method foo::bar() +Call to private method foo::bar() from context '' diff --git a/tests/lang/func_get_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt index 741b6604c0d37..bd1fa5b4c5c3c 100644 --- a/tests/lang/func_get_arg_variation.phpt +++ b/tests/lang/func_get_arg_variation.phpt @@ -6,9 +6,6 @@ func_get_arg test function foo($a) { $a=5; - echo func_get_arg(); - echo func_get_arg(2,2); - echo func_get_arg("hello"); echo func_get_arg(-1); echo func_get_arg(2); } @@ -16,12 +13,6 @@ foo(2); echo "\n"; ?> --EXPECTF-- -Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d - -Warning: func_get_arg() expects parameter 1 to be int, string given in %s on line %d - Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d diff --git a/tests/output/ob_014.phpt b/tests/output/ob_014.phpt index 09534270f3677..bc46f2ae580c1 100644 --- a/tests/output/ob_014.phpt +++ b/tests/output/ob_014.phpt @@ -4,19 +4,12 @@ output buffering - failure getMessage(), "\n"; +} ?> ---EXPECTF-- -Array -( - [type] => 2 - [message] => str_rot13() expects exactly 1 parameter, 2 given - [file] => %s - [line] => 7 -) +--EXPECT-- +foo +str_rot13() expects exactly 1 parameter, 2 given diff --git a/tests/output/ob_015.phpt b/tests/output/ob_015.phpt index 2acdb40d0a09d..2bc08687d77fd 100644 --- a/tests/output/ob_015.phpt +++ b/tests/output/ob_015.phpt @@ -3,20 +3,13 @@ output buffering - failure --FILE-- getMessage(), "\n"; +} ob_end_flush(); - -// Show the error. -print_r(error_get_last()); ?> ---EXPECTF-- -Array -( - [type] => 2 - [message] => str_rot13() expects exactly 1 parameter, 2 given - [file] => %s - [line] => 7 -) +--EXPECT-- +foo +str_rot13() expects exactly 1 parameter, 2 given diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt index 29288e2028e46..83b3a4186d4ce 100644 --- a/tests/output/ob_start_error_001.phpt +++ b/tests/output/ob_start_error_001.phpt @@ -16,38 +16,14 @@ $arg_2 = 0; $arg_3 = false; $extra_arg = 1; -echo "\n- Too many arguments\n"; -var_dump(ob_start($arg_1, $arg_2, $arg_3, $extra_arg)); - -echo "\n- Arg 1 wrong type\n"; +echo "\nArg 1 wrong type\n"; var_dump(ob_start(1.5)); -echo "\n- Arg 2 wrong type\n"; -var_dump(ob_start("justPrint", "this should be an int")); - -echo "\n- Arg 3 wrong type\n"; -var_dump(ob_start("justPrint", 0, "this should be a bool")); - ?> --EXPECTF-- -- Too many arguments - -Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17 -NULL - -- Arg 1 wrong type +Arg 1 wrong type -Warning: ob_start(): no array or string given in %s on line 20 +Warning: ob_start(): no array or string given in %s on line 17 -Notice: ob_start(): failed to create buffer in %s on line 20 +Notice: ob_start(): failed to create buffer in %s on line 17 bool(false) - -- Arg 2 wrong type - -Warning: ob_start() expects parameter 2 to be int, string given in %s on line 23 -NULL - -- Arg 3 wrong type - -Warning: ob_start() expects parameter 3 to be int, string given in %s on line 26 -NULL diff --git a/tests/output/stream_isatty.inc b/tests/output/stream_isatty.inc index 4b7f39986f4af..9700fd98f15f3 100644 --- a/tests/output/stream_isatty.inc +++ b/tests/output/stream_isatty.inc @@ -12,7 +12,6 @@ function testToStdOut() 'STDERR (constant)' => STDERR, 'STDERR (fopen)' => fopen('php://stderr', 'wb'), 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), - 'Not a stream' => 'foo', 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), 'Invalid stream (php://input)' => fopen('php://input', 'wb'), 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), diff --git a/tests/output/stream_isatty_err.phpt b/tests/output/stream_isatty_err.phpt index b071862c93a99..614d9205af9c8 100644 --- a/tests/output/stream_isatty_err.phpt +++ b/tests/output/stream_isatty_err.phpt @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(true) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_in-err.phpt b/tests/output/stream_isatty_in-err.phpt index fac84efb57e3e..1b3de7db8d55c 100644 --- a/tests/output/stream_isatty_in-err.phpt +++ b/tests/output/stream_isatty_in-err.phpt @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(true) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_in-out-err.phpt b/tests/output/stream_isatty_in-out-err.phpt index 56c49f70a8e86..b83c2d2199886 100644 --- a/tests/output/stream_isatty_in-out-err.phpt +++ b/tests/output/stream_isatty_in-out-err.phpt @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_in-out.phpt b/tests/output/stream_isatty_in-out.phpt index 70f2c030f4f6e..f047eff297c71 100644 --- a/tests/output/stream_isatty_in-out.phpt +++ b/tests/output/stream_isatty_in-out.phpt @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(true) STDERR (fopen): bool(true) STDERR (php://fd/2): bool(true) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_out-err.phpt b/tests/output/stream_isatty_out-err.phpt index 4bd06d124d7ab..c0003d85490cc 100644 --- a/tests/output/stream_isatty_out-err.phpt +++ b/tests/output/stream_isatty_out-err.phpt @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_out.phpt b/tests/output/stream_isatty_out.phpt index 14e1fb8607b92..442a603c30405 100644 --- a/tests/output/stream_isatty_out.phpt +++ b/tests/output/stream_isatty_out.phpt @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(true) STDERR (fopen): bool(true) STDERR (php://fd/2): bool(true) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false)