xref: /PHP-8.4/sapi/phpdbg/tests/info_001.phpt (revision 3c68f38f)
1--TEST--
2Test basic info functionality
3--INI--
4auto_globals_jit=0
5--PHPDBG--
6i classes
7i funcs
8b foo
9r
10i v
11i g
12i b
13i d
14i F
15i e
16i l
17c
18i v
19q
20--EXPECTF--
21[Successful compilation of %s]
22prompt> [User Classes (1)]
23User Class Foo\Bar (2)
24|---- in %s on line 4
25prompt> [User Functions (1)]
26|-------- foo in %s on line 14
27prompt> [Breakpoint #0 added at foo]
28prompt> string(4) "test"
29[Breakpoint #0 in foo() at %s:15, hits: 1]
30>00015: 		var_dump(strrev($baz));
31 00016: 	}
32 00017:
33prompt> [Variables in foo() (1)]
34Address            Refs    Type      Variable
35%s %d       string    $baz
36string (4) "test"
37prompt> [Superglobal variables (7)]
38Address            Refs    Type      Variable
39%s 2       array     $_GET
40%s 2       array     $_POST
41%s 2       array     $_COOKIE
42%s 2       array     $_SERVER
43%s 2       array     $_ENV
44%s 1       array     $_REQUEST
45%s 2       array     $_FILES
46prompt> ------------------------------------------------
47Function Breakpoints:
48#0		foo
49prompt> [User-defined constants (0)]
50prompt> [Included files: %d]%A
51prompt> [No error found!]
52prompt> [Literal Constants in foo() (2)]
53|-------- C0 -------> [var_dump]
54|-------- C1 -------> [strrev]
55prompt> string(4) "tset"
56[Script ended normally]
57prompt> [No active op array!]
58prompt>
59--FILE--
60<?php
61
62namespace Foo {
63	class Bar {
64		function Foo($bar) {
65			var_dump($bar);
66		}
67
68		function baz() { }
69	}
70}
71
72namespace {
73	function foo($baz) {
74		var_dump(strrev($baz));
75	}
76
77	(new \Foo\Bar)->Foo("test");
78	foo("test");
79}
80