summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/gettype_settype_variation1.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/general_functions/gettype_settype_variation1.phpt')
-rw-r--r--ext/standard/tests/general_functions/gettype_settype_variation1.phpt42
1 files changed, 21 insertions, 21 deletions
diff --git a/ext/standard/tests/general_functions/gettype_settype_variation1.phpt b/ext/standard/tests/general_functions/gettype_settype_variation1.phpt
index 440443bca2..ada73f0159 100644
--- a/ext/standard/tests/general_functions/gettype_settype_variation1.phpt
+++ b/ext/standard/tests/general_functions/gettype_settype_variation1.phpt
@@ -12,19 +12,19 @@ precision=14
Description: Returns the type of the PHP variable var
Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
+ Description: Set the type of variable var to type
*/
-/* Test usage variation of gettype() and settype() functions:
- settype() to null type.
+/* Test usage variation of gettype() and settype() functions:
+ settype() to null type.
Set type of the data to "null" and verify using gettype
Following are performed in the listed sequence:
- get the current type of the variable
+ get the current type of the variable
set the type of the variable to "null type"
dump the variable to see its new data
get the new type of the variable
*/
-
+
/* function to handle catchable errors */
function foo($errno, $errstr, $errfile, $errline) {
// var_dump($errstr);
@@ -32,8 +32,8 @@ function foo($errno, $errstr, $errfile, $errline) {
echo "$errno: $errstr\n";
}
//set the error handler, this is required as
-// settype() would fail with catachable fatal error
-set_error_handler("foo");
+// settype() would fail with catachable fatal error
+set_error_handler("foo");
$var1 = "another string";
$var2 = array(2,3,4);
@@ -57,15 +57,15 @@ class point
}
}
-$var_values = array (
+$var_values = array (
/* nulls */
- null,
+ null,
/* boolean */
- FALSE,
+ FALSE,
TRUE,
true,
-
+
/* strings */
"\xFF",
"\x66",
@@ -79,7 +79,7 @@ $var_values = array (
"10",
"10string",
'10string',
- "1",
+ "1",
"-1",
"1e2",
" 1",
@@ -125,11 +125,11 @@ $var_values = array (
0555,
-0555,
02224242434343152, // an octal value > than max int
-
+
/* floats */
1e5,
-1e5,
- 1E5,
+ 1E5,
-1E5,
-1.5,
.5,
@@ -155,7 +155,7 @@ $var_values = array (
$undef_var
);
-/* test conversion to null type */
+/* test conversion to null type */
$type = "null";
echo "\n*** Testing gettype() & settype() functions : usage variations ***\n";
@@ -164,22 +164,22 @@ $loop_count = 1;
foreach ($var_values as $var) {
echo "-- Iteration $loop_count --\n"; $loop_count++;
- // get the current data type
+ // get the current data type
var_dump( gettype($var) );
-
- // convert it to null
+
+ // convert it to null
var_dump( settype($var, $type) );
- // dump the converted data
+ // dump the converted data
var_dump( $var );
-
+
// check the new type after conversion
var_dump( gettype($var) );
}
echo "Done\n";
?>
---EXPECTF--
+--EXPECTF--
8: Undefined variable: unset_var
8: Undefined variable: undef_var