]> granicus.if.org Git - php/commitdiff
- MFB: New parameter parsing API
authorFelipe Pena <felipe@php.net>
Tue, 19 Aug 2008 02:51:28 +0000 (02:51 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 19 Aug 2008 02:51:28 +0000 (02:51 +0000)
- Fixed tests

19 files changed:
ext/standard/tests/class_object/get_class_variation_001.phpt
ext/standard/tests/class_object/get_object_vars_variation_003.phpt
ext/standard/tests/class_object/is_a_variation_002.phpt
ext/standard/tests/class_object/is_subclass_of_variation_002.phpt
ext/standard/tests/class_object/method_exists_variation_002.phpt
ext/standard/tests/file/fread_error.phpt
ext/standard/tests/file/fscanf.phpt
ext/standard/tests/general_functions/debug_zval_dump_e.phpt
ext/standard/tests/general_functions/floatval.phpt
ext/standard/tests/general_functions/gettype_settype_error.phpt
ext/standard/tests/general_functions/intval.phpt
ext/standard/tests/general_functions/is_numeric.phpt
ext/standard/tests/general_functions/is_scalar.phpt
ext/standard/tests/general_functions/is_string.phpt
ext/standard/tests/general_functions/strval.phpt
ext/standard/tests/general_functions/var_dump.phpt
ext/standard/tests/strings/join_error.phpt
ext/standard/type.c
ext/standard/var.c

index af6fbc55eb25df96701d76ec6855ccad1618d18c..36d7ebb400529474af2aac819d4cc328b055f5d2 100644 (file)
@@ -76,95 +76,147 @@ echo "Done";
 --EXPECTF--
 *** Testing get_class() : usage variations ***
 
-Notice: Undefined variable: undefined_var in %s on line 58
+Notice: Undefined variable: undefined_var in %s on line %d
 
-Notice: Undefined variable: unset_var in %s on line 61
+Notice: Undefined variable: unset_var in %s on line %d
 
 Arg value: 0 (type: integer)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value: 1 (type: integer)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value: 12345 (type: integer)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value: -2345 (type: integer)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value: 10.5 (type: double)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value: -10.5 (type: double)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value: 101234567000 (type: double)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value: 1.07654321E-9 (type: double)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value: 0.5 (type: double)
-bool(false)
 
-Notice: Array to string conversion in %s on line 67
+Warning: get_class() expects parameter 1 to be object, double given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value: Array (type: array)
-bool(false)
 
-Notice: Array to string conversion in %s on line 67
+Warning: get_class() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value: Array (type: array)
-bool(false)
 
-Notice: Array to string conversion in %s on line 67
+Warning: get_class() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value: Array (type: array)
-bool(false)
 
-Notice: Array to string conversion in %s on line 67
+Warning: get_class() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value: Array (type: array)
-bool(false)
 
-Notice: Array to string conversion in %s on line 67
+Warning: get_class() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value: Array (type: array)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, array given in %s on line %d
+NULL
 
 Arg value:  (type: NULL)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+NULL
 
 Arg value:  (type: NULL)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+NULL
 
 Arg value: 1 (type: boolean)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value:  (type: boolean)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value: 1 (type: boolean)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value:  (type: boolean)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value:  (type: unicode)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value:  (type: unicode)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value: string (type: unicode)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value: string (type: unicode)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value:  (type: NULL)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+NULL
 
 Arg value:  (type: NULL)
-bool(false)
+
+Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+NULL
 Done
index 1d0fa90b7b07aef2cb52fc06bed0f598be96179b..50f1dad69d444332b0b85b996196f4523f9d4abe 100644 (file)
@@ -74,95 +74,147 @@ echo "Done";
 --EXPECTF--
 *** Testing get_object_vars() : usage variations ***
 
-Notice: Undefined variable: undefined_var in %s on line 56
+Notice: Undefined variable: undefined_var in %s on line %d
 
-Notice: Undefined variable: unset_var in %s on line 59
+Notice: Undefined variable: unset_var in %s on line %d
 
 Arg value 0 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value 1 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value 12345 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value -2345 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, integer given in %s on line %d
+NULL
 
 Arg value 10.5 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value -10.5 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value 101234567000 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value 1.07654321E-9 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, double given in %s on line %d
+NULL
 
 Arg value 0.5 
-bool(false)
 
-Notice: Array to string conversion in %s on line 65
+Warning: get_object_vars() expects parameter 1 to be object, double given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
-bool(false)
 
-Notice: Array to string conversion in %s on line 65
+Warning: get_object_vars() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
-bool(false)
 
-Notice: Array to string conversion in %s on line 65
+Warning: get_object_vars() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
-bool(false)
 
-Notice: Array to string conversion in %s on line 65
+Warning: get_object_vars() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
-bool(false)
 
-Notice: Array to string conversion in %s on line 65
+Warning: get_object_vars() expects parameter 1 to be object, array given in %s on line %d
+NULL
+
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, array given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, null given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, null given in %s on line %d
+NULL
 
 Arg value 1 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value 1 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, boolean given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value string 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value string 
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, Unicode string given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, null given in %s on line %d
+NULL
 
 Arg value  
-bool(false)
+
+Warning: get_object_vars() expects parameter 1 to be object, null given in %s on line %d
+NULL
 Done
index 7dcc818d07fa224cfbe9290b7eae24fb1d1cc3c2..ae7745d29a760cfa753d4b9b7f58410d253ed2cd 100644 (file)
@@ -84,9 +84,9 @@ echo "Done";
 --EXPECTF--
 *** Testing is_a() : usage variations ***
 
-Notice: Undefined variable: undefined_var in %s on line 64
+Notice: Undefined variable: undefined_var in %s on line %d
 
-Notice: Undefined variable: unset_var in %s on line 67
+Notice: Undefined variable: unset_var in %s on line %d
 
 Arg value 0 
 bool(false)
@@ -115,40 +115,40 @@ bool(false)
 Arg value 0.5 
 bool(false)
 
-Notice: Array to string conversion in %s on line 73
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
 
-Notice: Array to string conversion in %s on line 74
-bool(false)
+Warning: is_a() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line 73
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
 
-Notice: Array to string conversion in %s on line 74
-bool(false)
+Warning: is_a() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line 73
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
 
-Notice: Array to string conversion in %s on line 74
-bool(false)
+Warning: is_a() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line 73
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
 
-Notice: Array to string conversion in %s on line 74
-bool(false)
+Warning: is_a() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
-Notice: Array to string conversion in %s on line 73
+Notice: Array to string conversion in %s on line %d
 
 Arg value Array 
 
-Notice: Array to string conversion in %s on line 74
-bool(false)
+Warning: is_a() expects parameter 2 to be string (Unicode or binary), array given in %s on line %d
+NULL
 
 Arg value  
 bool(false)
index 829731bf6c6020ecc388e2250e8f2f7a413125a6..8fe17aafef2aa18b074fa02fb76b8940695e44de 100644 (file)
@@ -84,8 +84,8 @@ echo "Done";
 ?>
 --EXPECTF--
 *** Testing is_subclass_of() : usage variations ***
-Error: 8 - Undefined variable: undefined_var, %s(67)
-Error: 8 - Undefined variable: unset_var, %s(70)
+Error: 8 - Undefined variable: undefined_var, %s(%d)
+Error: 8 - Undefined variable: unset_var, %s(%d)
 
 Arg value 0 
 bool(false)
@@ -113,31 +113,31 @@ bool(false)
 
 Arg value 0.5 
 bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - is_subclass_of() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - is_subclass_of() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - is_subclass_of() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - is_subclass_of() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
+Error: 2 - is_subclass_of() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
 
 Arg value  
 bool(false)
@@ -162,12 +162,11 @@ bool(false)
 
 Arg value  
 bool(false)
-Error: 4096 - Object of class stdClass could not be converted to string, %s(76)
+Error: 4096 - Object of class stdClass could not be converted to string, %s(%d)
 
 Arg value  
-Error: 4096 - Object of class stdClass could not be converted to Unicode string, %s(77)
-Error: 8 - Object of class stdClass to string conversion, %s(77)
-bool(false)
+Error: 2 - is_subclass_of() expects parameter 2 to be string (Unicode or binary), object given, %s(%d)
+NULL
 
 Arg value  
 bool(false)
index d56f9cbb8edc1172304f9f7b9bf10e1ca0e14173..79fb98d019b3959f09061d4b889685ef32a4a52c 100644 (file)
@@ -84,8 +84,8 @@ echo "Done";
 ?>
 --EXPECTF--
 *** Testing method_exists() : usage variations ***
-Error: 8 - Undefined variable: undefined_var, %s(67)
-Error: 8 - Undefined variable: unset_var, %s(70)
+Error: 8 - Undefined variable: undefined_var, %s(%d)
+Error: 8 - Undefined variable: unset_var, %s(%d)
 
 Arg value 0 
 bool(false)
@@ -113,31 +113,31 @@ bool(false)
 
 Arg value 0.5 
 bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - method_exists() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - method_exists() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - method_exists() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
-Error: 8 - Array to string conversion, %s(76)
+Error: 2 - method_exists() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
+Error: 8 - Array to string conversion, %s(%d)
 
 Arg value Array 
-Error: 8 - Array to string conversion, %s(77)
-bool(false)
+Error: 2 - method_exists() expects parameter 2 to be string (Unicode or binary), array given, %s(%d)
+NULL
 
 Arg value  
 bool(false)
@@ -162,12 +162,11 @@ bool(false)
 
 Arg value  
 bool(false)
-Error: 4096 - Object of class stdClass could not be converted to string, %s(76)
+Error: 4096 - Object of class stdClass could not be converted to string, %s(%d)
 
 Arg value  
-Error: 4096 - Object of class stdClass could not be converted to Unicode string, %s(77)
-Error: 8 - Object of class stdClass to string conversion, %s(77)
-bool(false)
+Error: 2 - method_exists() expects parameter 2 to be string (Unicode or binary), object given, %s(%d)
+NULL
 
 Arg value  
 bool(false)
index 275985e71a99d04204e38f8d0ec10a64e4633148..ae45f5e274cd3d14bf31f2f2627c5173c717d80b 100644 (file)
@@ -109,6 +109,6 @@ bool(false)
 Warning: fread() expects parameter 1 to be resource, null given in %s on line %d
 NULL
 
-Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d
-bool(false)
+Warning: fclose() expects parameter 1 to be resource, null given in %s on line %d
+NULL
 Done
index f5005b79ced1ea6acf0bc4085efc16517a7b43b2..f9d2cb4955762c80901768c2005f9623fdbe260f 100644 (file)
@@ -61,14 +61,14 @@ var_dump(fscanf($fp, "%s%d", $v));
 --CLEAN--
 <?php unlink(dirname(__FILE__)."/fscanf.dat"); ?>
 --EXPECTF--
-Warning: Wrong parameter count for fscanf() in %s on line %d
+Warning: fscanf() expects at least 2 parameters, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for fscanf() in %s on line %d
+Warning: fscanf() expects at least 2 parameters, 1 given in %s on line %d
 NULL
 
-Warning: fscanf(): supplied argument is not a valid File-Handle resource in %s on line %d
-bool(false)
+Warning: fscanf() expects parameter 1 to be resource, array given in %s on line %d
+NULL
 int(0)
 NULL
 int(1)
index 7b306978d572aac899addfaca7638ce7920452d0..83234db7537c7e68a2feeaf7fa94d589d9876e3b 100644 (file)
@@ -19,5 +19,5 @@ echo "Done\n";
 --EXPECTF--
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for debug_zval_dump() in %s on line %d
+Warning: debug_zval_dump() expects at least 1 parameter, 0 given in %s on line %d
 Done
index dce9c99af5dc4ac68ef8042c04ec9d91f12c60dc..d9788befadc158777249c9ff3f11b6aace714649 100644 (file)
@@ -192,16 +192,16 @@ float(0)
 
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for floatval() in %s on line %d
+Warning: floatval() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for doubleval() in %s on line %d
+Warning: doubleval() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for floatval() in %s on line %d
+Warning: floatval() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for doubleval() in %s on line %d
+Warning: doubleval() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 
 Done
index 8b170de5404a07380774f37ddeee18a7454e45d1..af8959d9fd5e5870b2cd99eaf8877ffbbe6494b5 100644 (file)
@@ -37,18 +37,18 @@ echo "Done\n";
 
 *** Testing gettype(): error conditions ***
 
-Warning: Wrong parameter count for gettype() in %s on line %d
+Warning: gettype() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for gettype() in %s on line %d
+Warning: gettype() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 
 *** Testing settype(): error conditions ***
 
-Warning: Wrong parameter count for settype() in %s on line %d
+Warning: settype() expects exactly 2 parameters, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for settype() in %s on line %d
+Warning: settype() expects exactly 2 parameters, 3 given in %s on line %d
 NULL
 
 Warning: settype(): Invalid type in %s on line %d
index 8898526b7933e66d16bd44001fbbf95275c4b108..d0f071267b8af01eeccfdb1d83ae2fa9d92d265d 100644 (file)
@@ -297,10 +297,10 @@ int(0)
 
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for intval() in %s on line %d
+Warning: intval() expects at least 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for intval() in %s on line %d
+Warning: intval() expects at most 2 parameters, 3 given in %s on line %d
 NULL
 
 --- Done ---
index 8121402661299a8550e853d48a6c0f51dcf96543..1b682014857774cadad271ab2ade94fd9435c938 100644 (file)
@@ -380,9 +380,9 @@ bool(false)
 
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for is_numeric() in %s on line %d
+Warning: is_numeric() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for is_numeric() in %s on line %d
+Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 Done
index f7f142a16ac73b6174945dbc5ab3c6f749eaa122..699057db9c3f6ec79b36794a1a936dc959e324cd 100644 (file)
@@ -230,12 +230,12 @@ bool(false)
 
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for is_scalar() in %s on line %d
+Warning: is_scalar() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for is_scalar() in %s on line %d
+Warning: is_scalar() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for is_scalar() in %s on line %d
+Warning: is_scalar() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 Done
index 92bca6673ae2e8c8eac7e8ee9d174f0bd20c75c7..151e640e1692e7e5948d0fbabc4cbe4a55de261b 100644 (file)
@@ -296,9 +296,9 @@ bool(false)
 
 *** Testing error conditions ***
 
-Warning: is_string(): Only one argument expected in %s on line %d
-bool(false)
+Warning: is_string() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
 
-Warning: is_string(): Only one argument expected in %s on line %d
-bool(false)
+Warning: is_string() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
 Done
index 597801885af5d6264ef6a2d130a0a6b70d739d44..e86f2ed94f874374f742be83b866f7bd0de58415 100644 (file)
@@ -310,9 +310,9 @@ unicode(0) ""
 
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for strval() in %s on line %d
+Warning: strval() expects exactly 1 parameter, 0 given in %s on line %d
 NULL
 
-Warning: Wrong parameter count for strval() in %s on line %d
+Warning: strval() expects exactly 1 parameter, 2 given in %s on line %d
 NULL
 Done
index e72bc0b3c41af20d7b01b524093e715e2eddfbfc..360af71e8eaf02fbfd5cc0783ea4a727ff519b8f 100644 (file)
@@ -1909,5 +1909,5 @@ unicode(9) "\0lambda_2"
 
 *** Testing error conditions ***
 
-Warning: Wrong parameter count for var_dump() in %s on line %d
+Warning: var_dump() expects at least 1 parameter, 0 given in %s on line %d
 Done
index aa6bdc23061ec60067e18b7b4a640e85ae63d40f..b283bf4cdbd867c9e745609db832f3f974689928 100644 (file)
@@ -35,12 +35,12 @@ echo "Done\n";
 
 -- Testing join() function with Zero arguments --
 
-Warning: Wrong parameter count for join() in %s on line %d
+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: Wrong parameter count for join() in %s on line %d
+Warning: join() expects at most 2 parameters, 3 given in %s on line %d
 NULL
 
 -- Testing join() with less than expected no. of arguments --
index 9fde3a4951967c7d2f80549977659158a454254e..2055b2f0a3a29d871eafb5312b9062172268c27a 100644 (file)
@@ -27,8 +27,8 @@ PHP_FUNCTION(gettype)
 {
        zval **arg;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &arg) == FAILURE) {
+               return;
        }
 
        switch (Z_TYPE_PP(arg)) {
@@ -94,16 +94,14 @@ PHP_FUNCTION(gettype)
    Set the type of the variable */
 PHP_FUNCTION(settype)
 {
-       zval **var, **type;
+       zval **var;
        char *new_type;
+       int new_type_len;
 
-       if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &var, &type) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs", &var, &new_type, &new_type_len) == FAILURE) {
+               return;
        }
 
-       convert_to_string_ex(type);
-       new_type = Z_STRVAL_PP(type);
-
        if (!strcasecmp(new_type, "integer")) {
                convert_to_long(*var);
        } else if (!strcasecmp(new_type, "int")) {
@@ -147,27 +145,16 @@ PHP_FUNCTION(settype)
    Get the integer value of a variable using the optional base for the conversion */
 PHP_FUNCTION(intval)
 {
-       zval **num, **arg_base;
-       int base;
-
-       switch (ZEND_NUM_ARGS()) {
-               case 1:
-                       if (zend_get_parameters_ex(1, &num) == FAILURE) {
-                               WRONG_PARAM_COUNT;
-                       }
-                       base = 10;
-                       break;
-
-               case 2:
-                       if (zend_get_parameters_ex(2, &num, &arg_base) == FAILURE) {
-                               WRONG_PARAM_COUNT;
-                       }
-                       convert_to_long_ex(arg_base);
-                       base = Z_LVAL_PP(arg_base);
-                       break;
+       zval **num;
+       long arg_base = 0;
+       int base = 10;
 
-               default:
-                       WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &num, &arg_base) == FAILURE) {
+               return;
+       }
+       
+       if (ZEND_NUM_ARGS() == 2) {
+               base = arg_base;
        }
 
        RETVAL_ZVAL(*num, 1, 0);
@@ -181,8 +168,8 @@ PHP_FUNCTION(floatval)
 {
        zval **num;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &num) == FAILURE) {
+               return;
        }
 
        RETVAL_ZVAL(*num, 1, 0);
@@ -198,8 +185,8 @@ PHP_FUNCTION(strval)
        zval expr_copy;
        int use_copy;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &num) == FAILURE) {
+               return;
        }
 
        if (UG(unicode)) {
@@ -329,14 +316,13 @@ PHP_FUNCTION(is_binary)
    Returns true if variable is a Unicode or binary string */
 PHP_FUNCTION(is_string)
 {
-       zval **arg;
+       zval *arg;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument expected");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+               return;
        }
 
-       if (Z_TYPE_PP(arg) == IS_UNICODE || Z_TYPE_PP(arg) == IS_STRING) {
+       if (Z_TYPE_P(arg) == IS_UNICODE || Z_TYPE_P(arg) == IS_STRING) {
                RETURN_TRUE;
        } else {
                RETURN_FALSE;
@@ -356,14 +342,13 @@ PHP_FUNCTION(is_unicode)
    Returns true if variable is a native, unicode or binary string */
 PHP_FUNCTION(is_buffer)
 {
-       zval **arg;
+       zval *arg;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument expected");
-               RETURN_FALSE;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+               return;
        }
 
-       if (Z_TYPE_PP(arg) == IS_STRING || Z_TYPE_PP(arg) == IS_UNICODE) {
+       if (Z_TYPE_P(arg) == IS_STRING || Z_TYPE_P(arg) == IS_UNICODE) {
                RETURN_TRUE;
        }
        RETURN_FALSE;
@@ -393,8 +378,8 @@ PHP_FUNCTION(is_numeric)
        zval **arg;
        int result;
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &arg) == FAILURE) {
+               return;
        }
 
        switch (Z_TYPE_PP(arg)) {
@@ -433,9 +418,9 @@ PHP_FUNCTION(is_numeric)
 PHP_FUNCTION(is_scalar)
 {
        zval **arg;
-
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &arg) == FAILURE) {
+               return;
        }
 
        switch (Z_TYPE_PP(arg)) {
index aa9e8fc8e554735fa1edae304fd79f78eccc8493..0c8e051a9c4d2a1cb5a7f75d233252f2ead500fd 100644 (file)
@@ -247,16 +247,12 @@ head_done:
    Dumps a string representation of variable to output */
 PHP_FUNCTION(var_dump)
 {
-       zval ***args;
+       zval ***args = NULL;
        int argc;
        int     i;
 
-       argc = ZEND_NUM_ARGS();
-
-       args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
-       if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) {
-               efree(args);
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+               return;
        }
 
        for (i = 0; i < argc; i++) {
@@ -270,16 +266,12 @@ PHP_FUNCTION(var_dump)
    Dumps a string representation of variable to output (verbose form) */
 PHP_FUNCTION(var_inspect)
 {
-       zval ***args;
+       zval ***args = NULL;
        int argc;
        int     i;
-
-       argc = ZEND_NUM_ARGS();
-
-       args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
-       if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) {
-               efree(args);
-               WRONG_PARAM_COUNT;
+       
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+               return;
        }
 
        for (i = 0; i < argc; i++) {
@@ -443,16 +435,12 @@ head_done:
    Dumps a string representation of an internal zend value to output. */
 PHP_FUNCTION(debug_zval_dump)
 {
-       zval ***args;
+       zval ***args = NULL;
        int argc;
        int     i;
 
-       argc = ZEND_NUM_ARGS();
-
-       args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
-       if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) {
-               efree(args);
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+               return;
        }
 
        for (i = 0; i < argc; i++) {
@@ -1139,8 +1127,8 @@ PHP_FUNCTION(serialize)
        php_serialize_data_t var_hash;
        smart_str buf = {0};
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &struc) == FAILURE) {
-               WRONG_PARAM_COUNT;
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &struc) == FAILURE) {
+               return;
        }
 
        Z_TYPE_P(return_value) = IS_STRING;