xref: /PHP-7.0/ext/standard/tests/strings/strval.phpt (revision d81ea16e)
1--TEST--
2strval() function
3--FILE--
4<?php
5$foo = 'bar';
6var_dump(strval($foo));
7define('FOO', 'BAR');
8var_dump(strval(FOO));
9var_dump(strval('foobar'));
10var_dump(strval(1));
11var_dump(strval(1.1));
12var_dump(strval(true));
13var_dump(strval(false));
14var_dump(strval(array('foo')));
15?>
16--EXPECTF--
17string(3) "bar"
18string(3) "BAR"
19string(6) "foobar"
20string(1) "1"
21string(3) "1.1"
22string(1) "1"
23string(0) ""
24
25Notice: Array to string conversion in %sstrval.php on line %d
26string(5) "Array"
27