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