summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/tests/print_002.phpt
blob: dfec6416722be8e27f3cc4a908d878a01e9c491c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--TEST--
Relative print commands
--INI--
opcache.enable_cli=0
--PHPDBG--
b foo
r
p
p o
q
--EXPECTF--
[Successful compilation of %s]
prompt> [Breakpoint #0 added at foo]
prompt> string(4) "test"
[Breakpoint #0 in foo() at %s:15, hits: 1]
>00015: 		var_dump(strrev($baz));
 00016: 	}
 00017: 
prompt> [Stack in foo() (8 ops)]
L14-16 foo() %s - %s + 8 ops
 L14   #0     RECV                    1                                         $baz                
 L15   #1     INIT_FCALL%s %d %s "var_dump"                               
 L15   #2     INIT_FCALL%s %d %s "strrev"                                 
 L15   #3     SEND_VAR                $baz                 1                                        
 L15   #4     DO_%cCALL                                                          @0                  
 L15   #5     SEND_VAR                @0                   1                                        
 L15   #6     DO_%cCALL                                                                              
 L16   #7     RETURN<-1>              null                                                          
prompt> [L15 %s INIT_FCALL%s %d %s "var_dump"                                %s]
prompt> 
--FILE--
<?php

namespace Foo {
	class Bar {
		function Foo($bar) {
			var_dump($bar);
		}

		function baz() { }
	}
}

namespace {
	function foo($baz) {
		var_dump(strrev($baz));
	}

	(new \Foo\Bar)->Foo("test");
	foo("test");
}