1--TEST--
2Test function posix_ttyname() by substituting argument 1 with object values.
3--CREDITS--
4Marco Fabbri mrfabbri@gmail.com
5Francesco Fullone ff@ideato.it
6#PHPTestFest Cesena Italia on 2009-06-20
7--EXTENSIONS--
8posix
9--FILE--
10<?php
11
12
13echo "*** Test substituting argument 1 with object values ***\n";
14
15class classWithToString
16{
17        public function __toString() {
18                return "Class A object";
19        }
20}
21
22class classWithoutToString
23{
24}
25
26$variation_array = array(
27  'instance of classWithToString' => new classWithToString(),
28  'instance of classWithoutToString' => new classWithoutToString(),
29  );
30
31
32foreach ( $variation_array as $var ) {
33  var_dump(posix_ttyname( $var  ) );
34}
35?>
36--EXPECTF--
37*** Test substituting argument 1 with object values ***
38
39Warning: Object of class classWithToString could not be converted to int in %s on line %d
40bool(false)
41
42Warning: Object of class classWithoutToString could not be converted to int in %s on line %d
43bool(false)
44