xref: /PHP-7.4/sapi/cli/tests/005.phpt (revision d0fd2be6)
1--TEST--
2show information about class
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9
10$php = getenv('TEST_PHP_EXECUTABLE');
11
12var_dump(`"$php" -n --rc unknown`);
13var_dump(`"$php" -n --rc stdclass`);
14var_dump(`"$php" -n --rc exception`);
15
16echo "Done\n";
17?>
18--EXPECT--
19string(40) "Exception: Class unknown does not exist
20"
21string(183) "Class [ <internal:Core> class stdClass ] {
22
23  - Constants [0] {
24  }
25
26  - Static properties [0] {
27  }
28
29  - Static methods [0] {
30  }
31
32  - Properties [0] {
33  }
34
35  - Methods [0] {
36  }
37}
38
39"
40string(1607) "Class [ <internal:Core> class Exception implements Throwable ] {
41
42  - Constants [0] {
43  }
44
45  - Static properties [0] {
46  }
47
48  - Static methods [0] {
49  }
50
51  - Properties [7] {
52    Property [ <default> protected $message ]
53    Property [ <default> private $string ]
54    Property [ <default> protected $code ]
55    Property [ <default> protected $file ]
56    Property [ <default> protected $line ]
57    Property [ <default> private $trace ]
58    Property [ <default> private $previous ]
59  }
60
61  - Methods [11] {
62    Method [ <internal:Core> final private method __clone ] {
63    }
64
65    Method [ <internal:Core, ctor> public method __construct ] {
66
67      - Parameters [3] {
68        Parameter #0 [ <optional> $message ]
69        Parameter #1 [ <optional> $code ]
70        Parameter #2 [ <optional> $previous ]
71      }
72    }
73
74    Method [ <internal:Core> public method __wakeup ] {
75    }
76
77    Method [ <internal:Core, prototype Throwable> final public method getMessage ] {
78    }
79
80    Method [ <internal:Core, prototype Throwable> final public method getCode ] {
81    }
82
83    Method [ <internal:Core, prototype Throwable> final public method getFile ] {
84    }
85
86    Method [ <internal:Core, prototype Throwable> final public method getLine ] {
87    }
88
89    Method [ <internal:Core, prototype Throwable> final public method getTrace ] {
90    }
91
92    Method [ <internal:Core, prototype Throwable> final public method getPrevious ] {
93    }
94
95    Method [ <internal:Core, prototype Throwable> final public method getTraceAsString ] {
96    }
97
98    Method [ <internal:Core, prototype Throwable> public method __toString ] {
99    }
100  }
101}
102
103"
104Done
105