diff options
Diffstat (limited to 'ext/standard/tests/general_functions')
71 files changed, 153 insertions, 1088 deletions
diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt index 51132c6a15..99971616d2 100644 --- a/ext/standard/tests/general_functions/010.phpt +++ b/ext/standard/tests/general_functions/010.phpt @@ -3,24 +3,19 @@ register_shutdown_function() & __call --FILE-- <?php class test { - function _foo() { - throw new Exception('test'); - } - function __call($name=null, $args=null) { - return test::_foo(); - } + function _foo() { + throw new Exception('test'); + } + function __call($name=null, $args=null) { + return test::_foo(); + } } -try { - var_dump(register_shutdown_function(array("test","__call"))); -} catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; -} +var_dump(register_shutdown_function(array("test","__call"))); echo "Done\n"; ?> --EXPECTF-- -Exception: Non-static method test::__call() cannot be called statically +Warning: register_shutdown_function(): Invalid shutdown callback 'test::__call' passed in %s on line %d +bool(false) Done - -Fatal error: Non-static method test::__call() cannot be called statically in %s on line %d diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt index c6ff94833d..92fa547820 100644 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ b/ext/standard/tests/general_functions/bug32647.phpt @@ -30,11 +30,11 @@ register_shutdown_function(array($obj,'barfoo')); // Valid ?> --EXPECTF-- -Notice: Undefined variable: obj in %s on line %d +Warning: Undefined variable: obj in %s on line %d Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d -Notice: Undefined variable: obj in %s on line %d +Warning: Undefined variable: obj in %s on line %d Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d @@ -46,13 +46,8 @@ Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed Warning: register_shutdown_function(): Invalid shutdown callback 'bar' passed in %s on line %d -Deprecated: Non-static method bar::barfoo() should not be called statically in %sbug32647.php on line %d +Warning: register_shutdown_function(): Invalid shutdown callback 'bar::barfoo' passed in %sbug32647.php on line %d Warning: register_shutdown_function(): Invalid shutdown callback 'bar::foobar' passed in %sbug32647.php on line %d foo! - -Deprecated: Non-static method bar::barfoo() should not be called statically in Unknown on line 0 - -Deprecated: Non-static method bar::barfoo() should not be called statically in Unknown on line 0 -bar! bar! diff --git a/ext/standard/tests/general_functions/bug41970.phpt b/ext/standard/tests/general_functions/bug41970.phpt index 6f05137afc..f43bf64380 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/bug47857.phpt b/ext/standard/tests/general_functions/bug47857.phpt index d19eca7248..c06673bc34 100644 --- a/ext/standard/tests/general_functions/bug47857.phpt +++ b/ext/standard/tests/general_functions/bug47857.phpt @@ -8,18 +8,20 @@ class foo { } } var_dump(is_callable(array('foo','bar'))); -foo::bar(); +try { + foo::bar(); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} var_dump(is_callable(array('Exception','getMessage'))); -Exception::getMessage(); +try { + Exception::getMessage(); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- -bool(true) - -Deprecated: Non-static method foo::bar() should not be called statically in %sbug47857.php on line %d -ok +--EXPECT-- +bool(false) +Non-static method foo::bar() cannot be called statically bool(false) - -Fatal error: Uncaught Error: Non-static method Exception::getMessage() cannot be called statically in %sbug47857.php:%d -Stack trace: -#0 {main} - thrown in %sbug47857.php on line %d +Non-static method Exception::getMessage() cannot be called statically diff --git a/ext/standard/tests/general_functions/bug60723.phpt b/ext/standard/tests/general_functions/bug60723.phpt index 504de7afbf..93381d246c 100644 --- a/ext/standard/tests/general_functions/bug60723.phpt +++ b/ext/standard/tests/general_functions/bug60723.phpt @@ -14,6 +14,6 @@ readfile($log); unlink($log); ?> --EXPECTF-- -Notice: Undefined variable: aa in %sbug60723.php on line %d -[%s ASIA/Chongqing] PHP Notice: Undefined variable: aa in %sbug60723.php on line %d +Warning: Undefined variable: aa in %s on line %d +[%s ASIA/Chongqing] PHP Warning: Undefined variable: aa in %s on line %d [%s ASIA/Chongqing] dummy diff --git a/ext/standard/tests/general_functions/bug70018.phpt b/ext/standard/tests/general_functions/bug70018.phpt index f7aefcc03f..77df0417a6 100644 --- a/ext/standard/tests/general_functions/bug70018.phpt +++ b/ext/standard/tests/general_functions/bug70018.phpt @@ -1,11 +1,5 @@ --TEST-- Bug #70018 (exec does not strip all whitespace) ---SKIPIF-- -<?php -if ("cli" != php_sapi_name()) { - die("skip.. CLI only test"); -} -?> --FILE-- <?php $output = array(); diff --git a/ext/standard/tests/general_functions/callbacks_001.phpt b/ext/standard/tests/general_functions/callbacks_001.phpt index a58f19d932..76d0e94c82 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 22130c524a..0d44035e0e 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-- <?php -call_user_func(array('Foo', 'bar')); -call_user_func(array(NULL, 'bar')); -call_user_func(array('stdclass', NULL)); +try { + call_user_func(array('Foo', 'bar')); +} catch (TypeError $e) { + echo $e->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/debug_zval_dump_v.phpt b/ext/standard/tests/general_functions/debug_zval_dump_v.phpt index 6cb413dc26..d622089cff 100644 --- a/ext/standard/tests/general_functions/debug_zval_dump_v.phpt +++ b/ext/standard/tests/general_functions/debug_zval_dump_v.phpt @@ -147,7 +147,7 @@ int(10) -- Value of $ref_first_var -- -Notice: Undefined variable: ref_first_var in %s on line %d +Warning: Undefined variable: ref_first_var in %s on line %d NULL -- Value of $first_var -- @@ -166,7 +166,7 @@ int(10) -- Value of $var_3: (after unsetting var_3) -- -Notice: Undefined variable: var_3 in %s on line %d +Warning: Undefined variable: var_3 in %s on line %d NULL -- Value of $var_2: -- @@ -177,7 +177,7 @@ int(10) -- Value of $var_1: (after unsetting variable_1) -- -Notice: Undefined variable: var_1 in %s on line %d +Warning: Undefined variable: var_1 in %s on line %d NULL -- Value of $var_2: -- diff --git a/ext/standard/tests/general_functions/error_clear_last.phpt b/ext/standard/tests/general_functions/error_clear_last.phpt index 675affb625..2cfd17793a 100644 --- a/ext/standard/tests/general_functions/error_clear_last.phpt +++ b/ext/standard/tests/general_functions/error_clear_last.phpt @@ -20,7 +20,7 @@ NULL NULL array(4) { ["type"]=> - int(8) + int(2) ["message"]=> string(21) "Undefined variable: b" ["file"]=> diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt index 71f068f104..a4cae412b5 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 <?php var_dump(error_get_last()); -var_dump(error_get_last(true)); +try { + var_dump(error_get_last(true)); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} var_dump(error_get_last()); $a = $b; @@ -15,29 +19,18 @@ 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 +Warning: Undefined variable: b in %s on line %d array(4) { ["type"]=> - int(8) + int(2) ["message"]=> string(21) "Undefined variable: b" ["file"]=> - string(%i) "%s" + string(%d) "%s" ["line"]=> - int(7) + int(11) } Done diff --git a/ext/standard/tests/general_functions/escapeshellarg_bug71039.phpt b/ext/standard/tests/general_functions/escapeshellarg_bug71039.phpt index cbb3f6fcc4..b6bc828a87 100644 --- a/ext/standard/tests/general_functions/escapeshellarg_bug71039.phpt +++ b/ext/standard/tests/general_functions/escapeshellarg_bug71039.phpt @@ -7,4 +7,8 @@ escapeshellarg("hello\0world"); ?> ===DONE=== --EXPECTF-- -Fatal error: escapeshellarg(): Input string contains NULL bytes in %s on line %d +Fatal error: Uncaught TypeError: Input string contains NULL bytes in %s:%d +Stack trace: +#0 %s(%d): escapeshellarg('hello\x00world') +#1 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/general_functions/escapeshellcmd_bug71039.phpt b/ext/standard/tests/general_functions/escapeshellcmd_bug71039.phpt index 0a4d7eacff..7ce31fb8dd 100644 --- a/ext/standard/tests/general_functions/escapeshellcmd_bug71039.phpt +++ b/ext/standard/tests/general_functions/escapeshellcmd_bug71039.phpt @@ -7,4 +7,8 @@ escapeshellcmd("hello\0world"); ?> ===DONE=== --EXPECTF-- -Fatal error: escapeshellcmd(): Input string contains NULL bytes in %s on line %d +Fatal error: Uncaught TypeError: Input string contains NULL bytes in %s:%d +Stack trace: +#0 %s(%d): escapeshellcmd('hello\x00world') +#1 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/general_functions/floatval.phpt b/ext/standard/tests/general_functions/floatval.phpt index a01e01dbf1..f6f354509a 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 33d4af03d2..c74e4f71fe 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 44bd822d12..0000000000 --- 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-- -<?php -/* Prototype : array get_extension_funcs ( string $module_name ) - * Description: Returns an array with the names of the functions of a module. - * Source code: Zend/zend_builtin_functions.c - * Alias to functions: - */ - -echo "*** Testing get_extension_funcs() : error conditions ***\n"; - -echo "\n-- Too few arguments --\n"; -var_dump(get_extension_funcs()); - -$extra_arg = 1; -echo "\n-- Too many arguments --\n"; -var_dump(get_extension_funcs("standard", $extra_arg)); - -echo "\n-- Invalid extension name --\n"; -var_dump(get_extension_funcs("foo")); - -?> -===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 2017bf697a..5b45c86449 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 df41ec8513..36719fa933 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(__DIR__."/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 4caca88e1b..8ec131809f 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 a876ac1fea..f387161bf4 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_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt index f8ff6c4460..fac0327ad5 100644 --- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt @@ -846,7 +846,7 @@ string(6) "object" -- Setting type of data to string -- -- Iteration 1 -- -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" @@ -855,7 +855,7 @@ bool(true) string(14) "another string" string(6) "string" -- Iteration 3 -- -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" diff --git a/ext/standard/tests/general_functions/gettype_settype_error.phpt b/ext/standard/tests/general_functions/gettype_settype_error.phpt index 325e91e47f..e204c64d4c 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/gettype_settype_variation1.phpt b/ext/standard/tests/general_functions/gettype_settype_variation1.phpt index 7fb8789ff3..eb43b85f30 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation1.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation1.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -149,10 +145,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); /* test conversion to null type */ @@ -180,9 +172,6 @@ foreach ($var_values as $var) { echo "Done\n"; ?> --EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - *** Testing gettype() & settype() functions : usage variations *** -- Setting type of data to null -- @@ -576,14 +565,4 @@ string(6) "object" bool(true) NULL string(4) "NULL" --- Iteration 79 -- -string(4) "NULL" -bool(true) -NULL -string(4) "NULL" --- Iteration 80 -- -string(4) "NULL" -bool(true) -NULL -string(4) "NULL" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation2.phpt b/ext/standard/tests/general_functions/gettype_settype_variation2.phpt index d44c04e5dd..5e49821f2c 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation2.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation2.phpt @@ -42,10 +42,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -153,10 +149,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); // test conversion to these types @@ -189,9 +181,6 @@ foreach ($types as $type) { echo "Done\n"; ?> --EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - *** Testing settype() & gettype() : usage variations *** -- Setting type of data to integer -- @@ -588,16 +577,6 @@ string(6) "object" bool(true) int(1) string(7) "integer" --- Iteration 79 -- -string(4) "NULL" -bool(true) -int(0) -string(7) "integer" --- Iteration 80 -- -string(4) "NULL" -bool(true) -int(0) -string(7) "integer" -- Setting type of data to int -- -- Iteration 1 -- @@ -993,14 +972,4 @@ string(6) "object" bool(true) int(1) string(7) "integer" --- Iteration 79 -- -string(4) "NULL" -bool(true) -int(0) -string(7) "integer" --- Iteration 80 -- -string(4) "NULL" -bool(true) -int(0) -string(7) "integer" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation3.phpt b/ext/standard/tests/general_functions/gettype_settype_variation3.phpt index 71b03461eb..f17b261437 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation3.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation3.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -149,10 +145,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); // test conversion to these types @@ -185,9 +177,6 @@ foreach ($types as $type) { echo "Done\n"; ?> --EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - *** Testing settype() & gettype() : usage variations *** -- Setting type of data to float -- @@ -584,16 +573,6 @@ string(6) "object" bool(true) float(1) string(6) "double" --- Iteration 79 -- -string(4) "NULL" -bool(true) -float(0) -string(6) "double" --- Iteration 80 -- -string(4) "NULL" -bool(true) -float(0) -string(6) "double" -- Setting type of data to double -- -- Iteration 1 -- @@ -989,14 +968,4 @@ string(6) "object" bool(true) float(1) string(6) "double" --- Iteration 79 -- -string(4) "NULL" -bool(true) -float(0) -string(6) "double" --- Iteration 80 -- -string(4) "NULL" -bool(true) -float(0) -string(6) "double" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation4.phpt b/ext/standard/tests/general_functions/gettype_settype_variation4.phpt index a14cb73dbb..00da4bf4bb 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation4.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation4.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -160,10 +156,6 @@ $var_values = array ( new point(0, 0), new class_with_no_member, - /* undefined/unset vars */ - $unset_var, - $undef_var, - /* binary strings */ b"0", b'0', @@ -210,9 +202,6 @@ foreach ($types as $type) { echo "Done\n"; ?> --EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - *** Testing settype() & gettype() : usage variations *** -- Setting type of data to boolean -- @@ -632,24 +621,24 @@ bool(true) bool(true) string(7) "boolean" -- Iteration 84 -- -string(4) "NULL" +string(6) "string" bool(true) bool(false) string(7) "boolean" -- Iteration 85 -- -string(4) "NULL" +string(6) "string" bool(true) bool(false) string(7) "boolean" -- Iteration 86 -- string(6) "string" bool(true) -bool(false) +bool(true) string(7) "boolean" -- Iteration 87 -- string(6) "string" bool(true) -bool(false) +bool(true) string(7) "boolean" -- Iteration 88 -- string(6) "string" @@ -696,16 +685,6 @@ string(6) "string" bool(true) bool(true) string(7) "boolean" --- Iteration 97 -- -string(6) "string" -bool(true) -bool(true) -string(7) "boolean" --- Iteration 98 -- -string(6) "string" -bool(true) -bool(true) -string(7) "boolean" -- Setting type of data to bool -- -- Iteration 1 -- @@ -1124,24 +1103,24 @@ bool(true) bool(true) string(7) "boolean" -- Iteration 84 -- -string(4) "NULL" +string(6) "string" bool(true) bool(false) string(7) "boolean" -- Iteration 85 -- -string(4) "NULL" +string(6) "string" bool(true) bool(false) string(7) "boolean" -- Iteration 86 -- string(6) "string" bool(true) -bool(false) +bool(true) string(7) "boolean" -- Iteration 87 -- string(6) "string" bool(true) -bool(false) +bool(true) string(7) "boolean" -- Iteration 88 -- string(6) "string" @@ -1188,14 +1167,4 @@ string(6) "string" bool(true) bool(true) string(7) "boolean" --- Iteration 97 -- -string(6) "string" -bool(true) -bool(true) -string(7) "boolean" --- Iteration 98 -- -string(6) "string" -bool(true) -bool(true) -string(7) "boolean" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation5.phpt b/ext/standard/tests/general_functions/gettype_settype_variation5.phpt index c5e2640f9c..6437baa10b 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation5.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation5.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -149,10 +145,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); /* test conversion to resource type */ @@ -179,10 +171,7 @@ foreach ($var_values as $var) { echo "Done\n"; ?> ---EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - +--EXPECTF-- *** Testing gettype() & settype() functions : usage variations *** -- Setting type of data to resource -- @@ -699,16 +688,4 @@ object(point)#3 (2) { int(0) } string(6) "object" --- Iteration 79 -- -string(4) "NULL" -2: settype(): Cannot convert to resource type -bool(false) -NULL -string(4) "NULL" --- Iteration 80 -- -string(4) "NULL" -2: settype(): Cannot convert to resource type -bool(false) -NULL -string(4) "NULL" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation6.phpt b/ext/standard/tests/general_functions/gettype_settype_variation6.phpt index 27beaa0744..7c5ea5efb6 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation6.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation6.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -149,10 +145,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); /* test conversion to array type */ @@ -181,10 +173,7 @@ foreach ($var_values as $var) { echo "Done\n"; ?> ---EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - +--EXPECTF-- *** Testing gettype() & settype() functions : usage variations *** -- Setting type of data to array -- @@ -831,16 +820,4 @@ array(2) { int(0) } string(5) "array" --- Iteration 79 -- -string(4) "NULL" -bool(true) -array(0) { -} -string(5) "array" --- Iteration 80 -- -string(4) "NULL" -bool(true) -array(0) { -} -string(5) "array" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation7.phpt b/ext/standard/tests/general_functions/gettype_settype_variation7.phpt index dae20a1856..b282cbdab1 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation7.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation7.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -149,10 +145,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); /* test conversion to object type */ @@ -179,10 +171,7 @@ foreach ($var_values as $var) { echo "Done\n"; ?> ---EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - +--EXPECTF-- *** Testing gettype() & settype() functions : usage variations *** -- Setting type of data to object -- @@ -829,16 +818,4 @@ object(point)#3 (2) { int(0) } string(6) "object" --- Iteration 79 -- -string(4) "NULL" -bool(true) -object(stdClass)#4 (0) { -} -string(6) "object" --- Iteration 80 -- -string(4) "NULL" -bool(true) -object(stdClass)#4 (0) { -} -string(6) "object" Done diff --git a/ext/standard/tests/general_functions/gettype_settype_variation8.phpt b/ext/standard/tests/general_functions/gettype_settype_variation8.phpt index 97f550e446..7ddfe54ab6 100644 --- a/ext/standard/tests/general_functions/gettype_settype_variation8.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_variation8.phpt @@ -38,10 +38,6 @@ set_error_handler("foo"); $var1 = "another string"; $var2 = array(2,3,4); -// a variable which is unset -$unset_var = 10.5; -unset( $unset_var ); - class point { var $x; @@ -149,10 +145,6 @@ $var_values = array ( new point(NULL, NULL), new point(2.5, 40.5), new point(0, 0), - - /* undefined/unset vars */ - $unset_var, - $undef_var ); /* test conversion to string type */ @@ -179,10 +171,7 @@ foreach ($var_values as $var) { echo "Done\n"; ?> ---EXPECT-- -8: Undefined variable: unset_var -8: Undefined variable: undef_var - +--EXPECTF-- *** Testing gettype() & settype() functions : usage variations *** -- Setting type of data to string -- @@ -399,31 +388,31 @@ string(12) "@$%#$%^$%^&^" string(6) "string" -- Iteration 43 -- string(5) "array" -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" -- Iteration 44 -- string(5) "array" -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" -- Iteration 45 -- string(5) "array" -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" -- Iteration 46 -- string(5) "array" -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" -- Iteration 47 -- string(5) "array" -8: Array to string conversion +2: Array to string conversion bool(true) string(5) "Array" string(6) "string" @@ -582,14 +571,4 @@ string(6) "object" bool(true) string(11) "ObjectPoint" string(6) "string" --- Iteration 79 -- -string(4) "NULL" -bool(true) -string(0) "" -string(6) "string" --- Iteration 80 -- -string(4) "NULL" -bool(true) -string(0) "" -string(6) "string" Done diff --git a/ext/standard/tests/general_functions/head.phpt b/ext/standard/tests/general_functions/head.phpt index 059c56b258..f8d4c28338 100644 --- a/ext/standard/tests/general_functions/head.phpt +++ b/ext/standard/tests/general_functions/head.phpt @@ -1,11 +1,5 @@ --TEST-- header() and friends ---SKIPIF-- -<?php -if (php_sapi_name() != "cli") { - die("skip this test is for CLI"); -} -?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/include_path.phpt b/ext/standard/tests/general_functions/include_path.phpt index 23c5bc45aa..ffadbc280c 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=. <?php var_dump(get_include_path()); -var_dump(get_include_path("var")); var_dump(restore_include_path()); -var_dump(restore_include_path("")); - -var_dump(set_include_path()); -var_dump(get_include_path()); var_dump(set_include_path("var")); var_dump(get_include_path()); @@ -32,9 +27,6 @@ var_dump(get_include_path()); var_dump(restore_include_path()); var_dump(get_include_path()); -var_dump(set_include_path(array())); -var_dump(get_include_path()); - var_dump(restore_include_path()); var_dump(get_include_path()); @@ -44,21 +36,9 @@ echo "Done\n"; --EXPECTF-- string(1) "." -Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on line %d -NULL - -Deprecated: Function restore_include_path() is deprecated in %s on line %d -NULL - Deprecated: Function restore_include_path() is deprecated in %s on line %d - -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" Deprecated: Function restore_include_path() is deprecated in %s on line %d @@ -77,10 +57,6 @@ Deprecated: Function restore_include_path() is deprecated in %s on line %d 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) "." - Deprecated: Function restore_include_path() is deprecated in %s on line %d NULL string(1) "." diff --git a/ext/standard/tests/general_functions/intval.phpt b/ext/standard/tests/general_functions/intval.phpt index 1650b91c6f..c56bdd7b94 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/intval_variation1.phpt b/ext/standard/tests/general_functions/intval_variation1.phpt index e76d7083d4..e44bc1db80 100644 --- a/ext/standard/tests/general_functions/intval_variation1.phpt +++ b/ext/standard/tests/general_functions/intval_variation1.phpt @@ -11,8 +11,8 @@ Test intval() function : usage variation echo "*** Testing intval() : usage variation ***\n"; // Define error handler -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - if (error_reporting() != 0) { +function test_error_handler($err_no, $err_msg, $filename, $linenum) { + if (error_reporting() & $err_no) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } diff --git a/ext/standard/tests/general_functions/is_array.phpt b/ext/standard/tests/general_functions/is_array.phpt index 66e5b64934..200ecbd6ac 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 34d5e0ef6c..7c8d693a1b 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_callable_basic2.phpt b/ext/standard/tests/general_functions/is_callable_basic2.phpt index 7657875311..7b43191aab 100644 --- a/ext/standard/tests/general_functions/is_callable_basic2.phpt +++ b/ext/standard/tests/general_functions/is_callable_basic2.phpt @@ -207,12 +207,12 @@ object_class::func bool(false) object_class::func -- Innerloop iteration 10 of Outerloop iteration 1 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 2 --- -- Innerloop iteration 1 of Outerloop iteration 2 -- @@ -288,12 +288,12 @@ no_member_class::func bool(false) no_member_class::func -- Innerloop iteration 10 of Outerloop iteration 2 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 3 --- -- Innerloop iteration 1 of Outerloop iteration 3 -- @@ -369,12 +369,12 @@ contains_object_class::func bool(true) contains_object_class::func -- Innerloop iteration 10 of Outerloop iteration 3 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 4 --- -- Innerloop iteration 1 of Outerloop iteration 4 -- @@ -450,12 +450,12 @@ contains_object_class::func bool(true) contains_object_class::func -- Innerloop iteration 10 of Outerloop iteration 4 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 5 --- -- Innerloop iteration 1 of Outerloop iteration 5 -- @@ -531,12 +531,12 @@ object_class::func bool(false) object_class::func -- Innerloop iteration 10 of Outerloop iteration 5 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 6 --- -- Innerloop iteration 1 of Outerloop iteration 6 -- @@ -612,12 +612,12 @@ no_member_class::func bool(false) no_member_class::func -- Innerloop iteration 10 of Outerloop iteration 6 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 7 --- -- Innerloop iteration 1 of Outerloop iteration 7 -- @@ -693,12 +693,12 @@ object_class::func bool(false) object_class::func -- Innerloop iteration 10 of Outerloop iteration 7 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 --- Outerloop iteration 8 --- -- Innerloop iteration 1 of Outerloop iteration 8 -- @@ -774,11 +774,11 @@ Array bool(false) Array -- Innerloop iteration 10 of Outerloop iteration 8 -- +bool(false) bool(true) -bool(true) -bool(true) +bool(false) bool(true) object_class::foo1 -bool(true) +bool(false) object_class::foo1 ===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 700077ef17..0cb18769d6 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 6d4ada6701..76cfa80565 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,28 +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) - -Deprecated: Function is_real() is deprecated in %s on line %d - -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) - -Deprecated: Function is_real() is deprecated in %s on line %d - -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 be5843a7d5..dc6df0f109 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,28 +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) - -Deprecated: Function is_real() is deprecated in %s on line %d - -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) - -Deprecated: Function is_real() is deprecated in %s on line %d - -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 4cfbf653be..25e6c2564e 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 dabc7be705..e5c6ce77e0 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 9082f5fcd1..4fc325c744 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 c23e5e3b8c..491aa5d15b 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 96c515bf65..dd0e7689fd 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 53620178c4..f7ef3f5317 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 ea2fb36a24..a062cc17e1 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 0664043eba..5603e3d238 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 b3470bec55..75e22e7741 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 368d262a6e..201bb481fc 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 = __DIR__."/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 106cd0c842..384398cdb2 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-- <?php -var_dump(parse_ini_string()); -var_dump(parse_ini_string(1,1,1,1)); - $ini = " test = "; @@ -87,11 +84,6 @@ var_dump(parse_ini_string($ini, true)); echo "Done\n"; ?> --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 392e1c930e..ec5b2b5839 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 044232570e..dfcddc61f3 100644 --- a/ext/standard/tests/general_functions/phpcredits.phpt +++ b/ext/standard/tests/general_functions/phpcredits.phpt @@ -4,7 +4,6 @@ phpcredits() <?php var_dump(phpcredits()); -var_dump(phpcredits(array())); echo "--\n"; var_dump(phpcredits(0)); @@ -40,9 +39,6 @@ PHP Quality Assurance Team %wWebsites and Infrastructure team%w %a bool(true) - -Warning: phpcredits() expects parameter 1 to be int, array given in %sphpcredits.php on line 4 -NULL -- PHP Credits bool(true) diff --git a/ext/standard/tests/general_functions/phpcredits2.phpt b/ext/standard/tests/general_functions/phpcredits2.phpt index 9966f23a96..6aa023e919 100644 --- a/ext/standard/tests/general_functions/phpcredits2.phpt +++ b/ext/standard/tests/general_functions/phpcredits2.phpt @@ -6,7 +6,6 @@ dummy=x <?php var_dump(phpcredits()); -var_dump(phpcredits(array())); echo "--\n"; var_dump(phpcredits(0)); @@ -18,9 +17,6 @@ var_dump(phpcredits(CREDITS_GROUP)); --EXPECTF-- <!DOCTYPE %a>%s</html> bool(true) - -Warning: phpcredits() expects parameter 1 to be int, array given in %sphpcredits2.php on line 4 -NULL -- <h1>PHP Credits</h1> bool(true) diff --git a/ext/standard/tests/general_functions/phpinfo.phpt b/ext/standard/tests/general_functions/phpinfo.phpt index a805876aab..5f4d99ffba 100644 --- a/ext/standard/tests/general_functions/phpinfo.phpt +++ b/ext/standard/tests/general_functions/phpinfo.phpt @@ -5,9 +5,6 @@ phpinfo() var_dump(phpinfo()); echo "--\n"; -var_dump(phpinfo(array())); - -echo "--\n"; var_dump(phpinfo(0)); echo "--\n"; @@ -62,10 +59,6 @@ PHP License %A bool(true) -- - -Warning: phpinfo() expects parameter 1 to be int, array given in %sphpinfo.php on line 5 -NULL --- phpinfo() bool(true) -- diff --git a/ext/standard/tests/general_functions/phpinfo2.phpt b/ext/standard/tests/general_functions/phpinfo2.phpt index f422f923d9..5a36aa9d28 100644 --- a/ext/standard/tests/general_functions/phpinfo2.phpt +++ b/ext/standard/tests/general_functions/phpinfo2.phpt @@ -7,9 +7,6 @@ dummy=x var_dump(phpinfo()); echo "--\n"; -var_dump(phpinfo(array())); - -echo "--\n"; var_dump(phpinfo(0)); echo "--\n"; @@ -20,10 +17,6 @@ var_dump(phpinfo(INFO_LICENSE)); <!DOCTYPE %s> %a</html>bool(true) -- - -Warning: phpinfo() expects parameter 1 to be int, array given in %sphpinfo2.php on line 5 -NULL --- <!DOCTYPE %s> %a</html>bool(true) -- diff --git a/ext/standard/tests/general_functions/print_r.phpt b/ext/standard/tests/general_functions/print_r.phpt index bcf5231144..cdb9f338a8 100644 --- a/ext/standard/tests/general_functions/print_r.phpt +++ b/ext/standard/tests/general_functions/print_r.phpt @@ -271,24 +271,6 @@ $misc_values = array ( /* calling check_printr() to display miscelleneous data using print_r() */ check_printr($misc_values); -/* checking print_r() on functions */ -echo "\n*** Testing print_r() on anonymous functions ***\n"; -$newfunc = create_function('$a,$b', 'return "$a * $b = " . ($a * $b);'); -echo "New anonymous function: $newfunc\n"; -print_r( $newfunc(2, 3) ); -/* creating anonymous function dynamically */ -print_r( create_function('$a', 'return "$a * $a = " . ($a * $b);') ); - -echo "\n\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); @@ -1714,23 +1696,4 @@ Array -- Iteration 4 -- - -*** Testing print_r() on anonymous functions *** - -Deprecated: Function create_function() is deprecated in %s on line %d -New anonymous function: -2 * 3 = 6 -Deprecated: Function create_function() is deprecated in %s on line %d - - -*** 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 8584f08758..71f2b5d64c 100644 --- a/ext/standard/tests/general_functions/print_r_64bit.phpt +++ b/ext/standard/tests/general_functions/print_r_64bit.phpt @@ -275,24 +275,6 @@ $misc_values = array ( /* calling check_printr() to display miscelleneous data using print_r() */ check_printr($misc_values); -/* checking print_r() on functions */ -echo "\n*** Testing print_r() on anonymous functions ***\n"; -$newfunc = create_function('$a,$b', 'return "$a * $b = " . ($a * $b);'); -echo "New anonymous function: $newfunc\n"; -print_r( $newfunc(2, 3) ); -/* creating anonymous function dynamically */ -print_r( create_function('$a', 'return "$a * $a = " . ($a * $b);') ); - -echo "\n\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); @@ -1718,23 +1700,4 @@ Array -- Iteration 4 -- - -*** Testing print_r() on anonymous functions *** - -Deprecated: Function create_function() is deprecated in %s on line %d -New anonymous function: -2 * 3 = 6 -Deprecated: Function create_function() is deprecated in %s on line %d - - -*** 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/proc_nice_basic-win.phpt b/ext/standard/tests/general_functions/proc_nice_basic-win.phpt index 87a4545501..37f8e17af2 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic-win.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic-win.phpt @@ -8,10 +8,6 @@ if (!defined('PHP_WINDOWS_VERSION_MAJOR')) { die('skip: Only for Windows'); } -if (PHP_SAPI != 'cli') { - die('skip: Only for CLI'); -} - if (getenv('SKIP_SLOW_TESTS')) { doe('skip: Slow test'); } diff --git a/ext/standard/tests/general_functions/proc_open-mb0.phpt b/ext/standard/tests/general_functions/proc_open-mb0.phpt index 4ff38267ad..03befdfb26 100644 --- a/ext/standard/tests/general_functions/proc_open-mb0.phpt +++ b/ext/standard/tests/general_functions/proc_open-mb0.phpt @@ -2,7 +2,6 @@ proc_open with bypass_shell subprocess parameter passing --SKIPIF-- <?php -if (php_sapi_name() != "cli") die('skip CLI only test'); if (!function_exists("proc_open")) echo "skip proc_open() is not available"; ?> --FILE-- diff --git a/ext/standard/tests/general_functions/proc_open-mb1.phpt b/ext/standard/tests/general_functions/proc_open-mb1.phpt index e7a7a4cbfc..46115c6337 100644 --- a/ext/standard/tests/general_functions/proc_open-mb1.phpt +++ b/ext/standard/tests/general_functions/proc_open-mb1.phpt @@ -2,7 +2,6 @@ proc_open without bypass_shell subprocess parameter passing --SKIPIF-- <?php -if (php_sapi_name() != "cli") die('skip CLI only test'); if (!function_exists("proc_open")) echo "skip proc_open() is not available"; ?> --FILE-- diff --git a/ext/standard/tests/general_functions/rand.phpt b/ext/standard/tests/general_functions/rand.phpt index e6639a71c7..73dec4eb75 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 <?php var_dump(mt_rand()); -var_dump(mt_rand(-1)); var_dump(mt_rand(-1,1)); var_dump(mt_rand(0,3)); var_dump(rand()); -var_dump(rand(-1)); var_dump(rand(-1,1)); var_dump(rand(0,3)); var_dump(srand()); var_dump(srand(-1)); -var_dump(srand(array())); var_dump(mt_srand()); var_dump(mt_srand(-1)); -var_dump(mt_srand(array())); var_dump(getrandmax()); -var_dump(getrandmax(1)); var_dump(mt_getrandmax()); -var_dump(mt_getrandmax(1)); echo "Done\n"; ?> --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 c4f069a3d2..3b46a35e5d 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 e904fdcaa0..a75ac12272 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 @@ -284,19 +277,19 @@ string(14) "Resource id #%d" string(14) "Resource id #%d" -- Iteration 4 -- -Notice: Array to string conversion in %sstrval.php on line %d +Warning: Array to string conversion in %s on line %d string(5) "Array" -- Iteration 5 -- -Notice: Array to string conversion in %sstrval.php on line %d +Warning: Array to string conversion in %s on line %d string(5) "Array" -- Iteration 6 -- -Notice: Array to string conversion in %sstrval.php on line %d +Warning: Array to string conversion in %s on line %d string(5) "Array" -- Iteration 7 -- -Notice: Array to string conversion in %sstrval.php on line %d +Warning: Array to string conversion in %s on line %d string(5) "Array" -- Iteration 8 -- string(0) "" @@ -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 5763084f70..1775978a12 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-- <?php -var_dump(sys_getloadavg("")); var_dump(sys_getloadavg()); echo "Done\n"; ?> --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 474aab7d5d..283e7f30e5 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 4641051541..336abbdf9f 100644 --- a/ext/standard/tests/general_functions/var_dump.phpt +++ b/ext/standard/tests/general_functions/var_dump.phpt @@ -274,18 +274,6 @@ echo "\n*** Testing var_dump() on multiple arguments ***\n"; var_dump( $integers, $floats, $strings, $arrays, $booleans, $resources, $objects, $misc_values, $variations ); -/* checking var_dump() on functions */ -echo "\n*** Testing var_dump() on anonymous functions ***\n"; -$newfunc = create_function('$a,$b', 'return "$a * $b = " . ($a * $b);'); -echo "New anonymous function: $newfunc\n"; -var_dump( $newfunc(2, 3) ); -/* creating anonymous function dynamically */ -var_dump( create_function('$a', 'return "$a * $a = " . ($a * $b);') ); - -echo "\n*** Testing error conditions ***\n"; -//passing zero argument -var_dump(); - /* closing resource handle used */ closedir($dir_handle); @@ -1561,17 +1549,4 @@ array(6) { string(5) "/00\7" } } - -*** Testing var_dump() on anonymous functions *** - -Deprecated: Function create_function() is deprecated in %s on line %d -New anonymous function: -string(9) "2 * 3 = 6" - -Deprecated: Function create_function() is deprecated in %s on line %d -string(9) " - -*** 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 738de410e4..cd74d585bc 100644 --- a/ext/standard/tests/general_functions/var_dump_64bit.phpt +++ b/ext/standard/tests/general_functions/var_dump_64bit.phpt @@ -274,18 +274,6 @@ echo "\n*** Testing var_dump() on multiple arguments ***\n"; var_dump( $integers, $floats, $strings, $arrays, $booleans, $resources, $objects, $misc_values, $variations ); -/* checking var_dump() on functions */ -echo "\n*** Testing var_dump() on anonymous functions ***\n"; -$newfunc = create_function('$a,$b', 'return "$a * $b = " . ($a * $b);'); -echo "New anonymous function: $newfunc\n"; -var_dump( $newfunc(2, 3) ); -/* creating anonymous function dynamically */ -var_dump( create_function('$a', 'return "$a * $a = " . ($a * $b);') ); - -echo "\n*** Testing error conditions ***\n"; -//passing zero argument -var_dump(); - /* closing resource handle used */ closedir($dir_handle); @@ -1561,17 +1549,4 @@ array(6) { string(5) "/00\7" } } - -*** Testing var_dump() on anonymous functions *** - -Deprecated: Function create_function() is deprecated in %s on line %d -New anonymous function: -string(9) "2 * 3 = 6" - -Deprecated: Function create_function() is deprecated in %s on line %d -string(9) " - -*** 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 61d94f83f4..3512006624 100644 --- a/ext/standard/tests/general_functions/var_export-locale.phpt +++ b/ext/standard/tests/general_functions/var_export-locale.phpt @@ -303,14 +303,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"; ?> @@ -1138,11 +1131,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/general_functions/var_export-locale_32.phpt b/ext/standard/tests/general_functions/var_export-locale_32.phpt index af9efd9e24..311b6395cd 100644 --- a/ext/standard/tests/general_functions/var_export-locale_32.phpt +++ b/ext/standard/tests/general_functions/var_export-locale_32.phpt @@ -303,14 +303,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"; ?> @@ -1138,11 +1131,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/general_functions/var_export_error2.phpt b/ext/standard/tests/general_functions/var_export_error2.phpt index eedb757d20..7ce21205b1 100644 --- a/ext/standard/tests/general_functions/var_export_error2.phpt +++ b/ext/standard/tests/general_functions/var_export_error2.phpt @@ -8,11 +8,12 @@ Test var_export() function : error conditions - recursive object * Alias to functions: */ -@$obj->p =& $obj; +$obj = new stdClass; +$obj->p =& $obj; var_export($obj, true); ?> ===DONE=== --EXPECTF-- -Warning: var_export does not handle circular references in %s on line 9 +Warning: var_export does not handle circular references in %s on line 10 ===DONE=== |