summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/gettype_settype_error.phpt
blob: a495ff6c29176008bac7246b9ad824d46026b70c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
Test gettype() & settype() functions : error conditions
--FILE--
<?php
/* Test different error conditions of settype() and gettype() functions */

echo "**** Testing gettype() and settype() functions ****\n";

echo "\n*** Testing settype(): error conditions ***\n";

// passing an invalid type to set
try {
    settype( $var, "unknown" );
} catch (ValueError $exception) {
    echo $exception->getMessage() . "\n";
}

echo "Done\n";
?>
--EXPECT--
**** Testing gettype() and settype() functions ****

*** Testing settype(): error conditions ***
settype(): Argument #2 ($type) must be a valid type
Done