1--TEST--
2Test gettype() & settype() functions : error conditions
3--FILE--
4<?php
5/* Test different error conditions of settype() and gettype() functions */
6
7echo "**** Testing gettype() and settype() functions ****\n";
8
9echo "\n*** Testing settype(): error conditions ***\n";
10
11// passing an invalid type to set
12try {
13    settype( $var, "unknown" );
14} catch (ValueError $exception) {
15    echo $exception->getMessage() . "\n";
16}
17
18echo "Done\n";
19?>
20--EXPECT--
21**** Testing gettype() and settype() functions ****
22
23*** Testing settype(): error conditions ***
24settype(): Argument #2 ($type) must be a valid type
25Done
26