Annotation of embedaddon/php/ext/standard/tests/general_functions/get_cfg_var_variation6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test function get_cfg_var() by substituting argument 1 with object values.
3: --CREDITS--
4: Francesco Fullone ff@ideato.it
5: #PHPTestFest Cesena Italia on 2009-06-20
6: --INI--
7: session.use_cookies=0
8: session.serialize_handler=php
9: session.save_handler=files
10: --FILE--
11: <?php
12:
13:
14: echo "*** Test substituting argument 1 with object values ***\n";
15:
16:
17:
18: class classWithToString
19: {
20: public function __toString() {
21: return "session.use_cookies";
22: }
23: }
24:
25: class classWithoutToString
26: {
27: }
28:
29: $variation_array = array(
30: 'instance of classWithToString' => new classWithToString(),
31: 'instance of classWithoutToString' => new classWithoutToString(),
32: );
33:
34:
35: foreach ( $variation_array as $var ) {
36: var_dump(get_cfg_var( $var ) );
37: }
38: ?>
39: --EXPECTF--
40: *** Test substituting argument 1 with object values ***
41: string(1) "0"
42:
43: Warning: get_cfg_var() expects parameter 1 to be string, object given in %s.php on line %d
44: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>