Jinyun's Notes 🚀

没什么天赋,爱好也不多,但愿坚持做些喜欢的事情

0%

PHP 源码学习二

🍟 通过 GDB 跟踪调试来了解一下 Zend String 和 Zend Array。

Zend String

Zend String Struct

1
2
3
4
5
6
7
8
9
10
11
12
13
struct _zend_string {
zend_refcounted_h gc;
zend_ulong h; /* hash value */
size_t len;
char val[1];
};

typedef struct _zend_refcounted_h {
uint32_t refcount; /* reference counter 32-bit */
union {
uint32_t type_info;
} u;
} zend_refcounted_h;

Copy-on-write

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

$c = 'Hello World!';
echo $c;

$a = time() . 'String';
echo $a;

// Copy-on-write
$b = $a;
echo $a;
echo $b;

$b = 'Hello';
echo $a;
echo $b;
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# gdb /home/vagrant/codes/php80/bin/php
(gdb) b ZEND_ECHO_SPEC_CV_HANDLER
Breakpoint 1 at 0x5c96a8: file /vagrant/php-8.0.10/Zend/zend_vm_execute.h, line 37184.
(gdb) r copy-on-write.php
Starting program: /home/vagrant/codes/php80/bin/php copy-on-write.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$1 = (zval *) 0x7ffff3814070
(gdb) p *z
$2 = {value = {lval = 140737278651680, dval = 6.9533454470981759e-310, counted = 0x7ffff3802d20, str = 0x7ffff3802d20, arr = 0x7ffff3802d20, obj = 0x7ffff3802d20, res = 0x7ffff3802d20, ref = 0x7ffff3802d20,
ast = 0x7ffff3802d20, zv = 0x7ffff3802d20, ptr = 0x7ffff3802d20, ce = 0x7ffff3802d20, func = 0x7ffff3802d20, ww = {w1 = 4085263648, w2 = 32767}}, u1 = {type_info = 6, v = {type = 6 '\006',
type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p $2.value.str
$3 = (zend_string *) 0x7ffff3802d20
(gdb) p *$2.value.str
$4 = {gc = {refcount = 1, u = {type_info = 86}}, h = 13594750393630990530, len = 12, val = "H"}
(gdb) p *$2.value.str.val@12
$5 = "Hello World!"
(gdb) c
Continuing.
Hello World!
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$6 = (zval *) 0x7ffff3814080
(gdb) p *z
$7 = {value = {lval = 140737278651760, dval = 6.9533454471021284e-310, counted = 0x7ffff3802d70, str = 0x7ffff3802d70, arr = 0x7ffff3802d70, obj = 0x7ffff3802d70, res = 0x7ffff3802d70, ref = 0x7ffff3802d70,
ast = 0x7ffff3802d70, zv = 0x7ffff3802d70, ptr = 0x7ffff3802d70, ce = 0x7ffff3802d70, func = 0x7ffff3802d70, ww = {w1 = 4085263728, w2 = 32767}}, u1 = {type_info = 262, v = {type = 6 '\006',
type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.str
$8 = {gc = {refcount = 1, u = {type_info = 22}}, h = 0, len = 16, val = "1"}
(gdb) p *z.value.str.val@16
$9 = "1631431095String"
(gdb) c
Continuing.
1631431095String
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$10 = (zval *) 0x7ffff3814080
(gdb) p *z
$11 = {value = {lval = 140737278651760, dval = 6.9533454471021284e-310, counted = 0x7ffff3802d70, str = 0x7ffff3802d70, arr = 0x7ffff3802d70, obj = 0x7ffff3802d70, res = 0x7ffff3802d70,
ref = 0x7ffff3802d70, ast = 0x7ffff3802d70, zv = 0x7ffff3802d70, ptr = 0x7ffff3802d70, ce = 0x7ffff3802d70, func = 0x7ffff3802d70, ww = {w1 = 4085263728, w2 = 32767}}, u1 = {type_info = 262, v = {
type = 6 '\006', type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.str
$12 = {gc = {refcount = 2, u = {type_info = 22}}, h = 0, len = 16, val = "1"}
(gdb) p *z.value.str.val@16
$13 = "1631431095String"
(gdb) c
Continuing.
1631431095String
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$14 = (zval *) 0x7ffff3814090
(gdb) p *z
$15 = {value = {lval = 140737278651760, dval = 6.9533454471021284e-310, counted = 0x7ffff3802d70, str = 0x7ffff3802d70, arr = 0x7ffff3802d70, obj = 0x7ffff3802d70, res = 0x7ffff3802d70,
ref = 0x7ffff3802d70, ast = 0x7ffff3802d70, zv = 0x7ffff3802d70, ptr = 0x7ffff3802d70, ce = 0x7ffff3802d70, func = 0x7ffff3802d70, ww = {w1 = 4085263728, w2 = 32767}}, u1 = {type_info = 262, v = {
type = 6 '\006', type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.str
$16 = {gc = {refcount = 2, u = {type_info = 22}}, h = 0, len = 16, val = "1"}
(gdb) p *z.value.str.val@16
$17 = "1631431095String"
(gdb) c
Continuing.
1631431095String
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$18 = (zval *) 0x7ffff3814080
(gdb) p *z
$19 = {value = {lval = 140737278651760, dval = 6.9533454471021284e-310, counted = 0x7ffff3802d70, str = 0x7ffff3802d70, arr = 0x7ffff3802d70, obj = 0x7ffff3802d70, res = 0x7ffff3802d70,
ref = 0x7ffff3802d70, ast = 0x7ffff3802d70, zv = 0x7ffff3802d70, ptr = 0x7ffff3802d70, ce = 0x7ffff3802d70, func = 0x7ffff3802d70, ww = {w1 = 4085263728, w2 = 32767}}, u1 = {type_info = 262, v = {
type = 6 '\006', type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.str
$20 = {gc = {refcount = 1, u = {type_info = 22}}, h = 0, len = 16, val = "1"}
(gdb) p *z.value.str.val@16
$21 = "1631431095String"
(gdb) c
Continuing.
1631431095String
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$22 = (zval *) 0x7ffff3814090
(gdb) p *z
$23 = {value = {lval = 140737278646144, dval = 6.9533454468246611e-310, counted = 0x7ffff3801780, str = 0x7ffff3801780, arr = 0x7ffff3801780, obj = 0x7ffff3801780, res = 0x7ffff3801780,
ref = 0x7ffff3801780, ast = 0x7ffff3801780, zv = 0x7ffff3801780, ptr = 0x7ffff3801780, ce = 0x7ffff3801780, func = 0x7ffff3801780, ww = {w1 = 4085258112, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.str
$24 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372247531462777, len = 5, val = "H"}
(gdb) p *z.value.str.val@5
$25 = "Hello"
(gdb)

引用类型

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

$a = 'String';
$b = &$a;
echo $a . "\n";
echo $b . "\n";

$b = 'Hello';
echo $a . "\n";
echo $b . "\n";

unset($b);
echo $a . "\n";
echo $b . "\n";
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# gdb /home/vagrant/codes/php80/bin/php
(gdb) b ZEND_ECHO_SPEC_CV_HANDLER
Breakpoint 1 at 0x5c96a8: file /vagrant/php-8.0.10/Zend/zend_vm_execute.h, line 37184.
(gdb) r reference.php
Starting program: /home/vagrant/codes/php80/bin/php reference.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$1 = (zval *) 0x7ffff3814070
(gdb) p *z
$2 = {value = {lval = 140737278645952, dval = 6.9533454468151751e-310, counted = 0x7ffff38016c0, str = 0x7ffff38016c0, arr = 0x7ffff38016c0, obj = 0x7ffff38016c0, res = 0x7ffff38016c0, ref = 0x7ffff38016c0,
ast = 0x7ffff38016c0, zv = 0x7ffff38016c0, ptr = 0x7ffff38016c0, ce = 0x7ffff38016c0, func = 0x7ffff38016c0, ww = {w1 = 4085257920, w2 = 32767}}, u1 = {type_info = 266, v = {type = 10 '\n',
type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) c
Continuing.
String
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$3 = (zval *) 0x7ffff3814080
(gdb) p *z
$4 = {value = {lval = 140737278645952, dval = 6.9533454468151751e-310, counted = 0x7ffff38016c0, str = 0x7ffff38016c0, arr = 0x7ffff38016c0, obj = 0x7ffff38016c0, res = 0x7ffff38016c0, ref = 0x7ffff38016c0,
ast = 0x7ffff38016c0, zv = 0x7ffff38016c0, ptr = 0x7ffff38016c0, ce = 0x7ffff38016c0, func = 0x7ffff38016c0, ww = {w1 = 4085257920, w2 = 32767}}, u1 = {type_info = 266, v = {type = 10 '\n',
type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p $4.value.ref
$5 = (zend_reference *) 0x7ffff38016c0
(gdb) p *$4.value.ref
$6 = {gc = {refcount = 2, u = {type_info = 26}}, val = {value = {lval = 140737278646080, dval = 6.9533454468214991e-310, counted = 0x7ffff3801740, str = 0x7ffff3801740, arr = 0x7ffff3801740,
obj = 0x7ffff3801740, res = 0x7ffff3801740, ref = 0x7ffff3801740, ast = 0x7ffff3801740, zv = 0x7ffff3801740, ptr = 0x7ffff3801740, ce = 0x7ffff3801740, func = 0x7ffff3801740, ww = {w1 = 4085258048,
w2 = 32767}}, u1 = {type_info = 6, v = {type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0,
fe_iter_idx = 0, access_flags = 0, property_guard = 0, constant_flags = 0, extra = 0}}, sources = {ptr = 0x0, list = 0}}
(gdb) p *$4.value.ref.val.value.str
$7 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223378989633936348, len = 6, val = "S"}
(gdb) p *$4.value.ref.val.value.str.val@6
$8 = "String"
(gdb) c
Continuing.
String
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$9 = (zval *) 0x7ffff3814070
(gdb) p *z
$10 = {value = {lval = 140737278645952, dval = 6.9533454468151751e-310, counted = 0x7ffff38016c0, str = 0x7ffff38016c0, arr = 0x7ffff38016c0, obj = 0x7ffff38016c0, res = 0x7ffff38016c0,
ref = 0x7ffff38016c0, ast = 0x7ffff38016c0, zv = 0x7ffff38016c0, ptr = 0x7ffff38016c0, ce = 0x7ffff38016c0, func = 0x7ffff38016c0, ww = {w1 = 4085257920, w2 = 32767}}, u1 = {type_info = 266, v = {
type = 10 '\n', type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.ref
$11 = {gc = {refcount = 2, u = {type_info = 26}}, val = {value = {lval = 140737278646144, dval = 6.9533454468246611e-310, counted = 0x7ffff3801780, str = 0x7ffff3801780, arr = 0x7ffff3801780,
obj = 0x7ffff3801780, res = 0x7ffff3801780, ref = 0x7ffff3801780, ast = 0x7ffff3801780, zv = 0x7ffff3801780, ptr = 0x7ffff3801780, ce = 0x7ffff3801780, func = 0x7ffff3801780, ww = {w1 = 4085258112,
w2 = 32767}}, u1 = {type_info = 6, v = {type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0,
fe_iter_idx = 0, access_flags = 0, property_guard = 0, constant_flags = 0, extra = 0}}, sources = {ptr = 0x0, list = 0}}
(gdb) p *z.value.ref.val.value.str
$12 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372247531462777, len = 5, val = "H"}
(gdb) p *z.value.ref.val.value.str.val@5
$13 = "Hello"
(gdb) c
Continuing.
Hello
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$14 = (zval *) 0x7ffff3814080
(gdb) p *z
$15 = {value = {lval = 140737278645952, dval = 6.9533454468151751e-310, counted = 0x7ffff38016c0, str = 0x7ffff38016c0, arr = 0x7ffff38016c0, obj = 0x7ffff38016c0, res = 0x7ffff38016c0,
ref = 0x7ffff38016c0, ast = 0x7ffff38016c0, zv = 0x7ffff38016c0, ptr = 0x7ffff38016c0, ce = 0x7ffff38016c0, func = 0x7ffff38016c0, ww = {w1 = 4085257920, w2 = 32767}}, u1 = {type_info = 266, v = {
type = 10 '\n', type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.ref
$16 = {gc = {refcount = 2, u = {type_info = 26}}, val = {value = {lval = 140737278646144, dval = 6.9533454468246611e-310, counted = 0x7ffff3801780, str = 0x7ffff3801780, arr = 0x7ffff3801780,
obj = 0x7ffff3801780, res = 0x7ffff3801780, ref = 0x7ffff3801780, ast = 0x7ffff3801780, zv = 0x7ffff3801780, ptr = 0x7ffff3801780, ce = 0x7ffff3801780, func = 0x7ffff3801780, ww = {w1 = 4085258112,
w2 = 32767}}, u1 = {type_info = 6, v = {type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0,
fe_iter_idx = 0, access_flags = 0, property_guard = 0, constant_flags = 0, extra = 0}}, sources = {ptr = 0x0, list = 0}}
(gdb) p *z.value.ref.val.value.str
$17 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372247531462777, len = 5, val = "H"}
(gdb) c
Continuing.
Hello
Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$18 = (zval *) 0x7ffff3814080
(gdb) p *z
$19 = {value = {lval = 140737278645952, dval = 6.9533454468151751e-310, counted = 0x7ffff38016c0, str = 0x7ffff38016c0, arr = 0x7ffff38016c0, obj = 0x7ffff38016c0, res = 0x7ffff38016c0,
ref = 0x7ffff38016c0, ast = 0x7ffff38016c0, zv = 0x7ffff38016c0, ptr = 0x7ffff38016c0, ce = 0x7ffff38016c0, func = 0x7ffff38016c0, ww = {w1 = 4085257920, w2 = 32767}}, u1 = {type_info = 0, v = {
type = 0 '\000', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.ref
$20 = {gc = {refcount = 1, u = {type_info = 26}}, val = {value = {lval = 140737278646144, dval = 6.9533454468246611e-310, counted = 0x7ffff3801780, str = 0x7ffff3801780, arr = 0x7ffff3801780,
obj = 0x7ffff3801780, res = 0x7ffff3801780, ref = 0x7ffff3801780, ast = 0x7ffff3801780, zv = 0x7ffff3801780, ptr = 0x7ffff3801780, ce = 0x7ffff3801780, func = 0x7ffff3801780, ww = {w1 = 4085258112,
w2 = 32767}}, u1 = {type_info = 6, v = {type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0,
fe_iter_idx = 0, access_flags = 0, property_guard = 0, constant_flags = 0, extra = 0}}, sources = {ptr = 0x0, list = 0}}
(gdb) p *z.value.ref.val.value.str
$21 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372247531462777, len = 5, val = "H"}
(gdb) p *z.value.ref.val.value.str.val@5
$22 = "Hello"
(gdb) c
Continuing.

Warning: Undefined variable $b in /home/vagrant/codes/tests/reference.php on line 13

Breakpoint 1, ZEND_ECHO_SPEC_CV_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:37184
37184 SAVE_OPLINE();
(gdb) n
37185 z = EX_VAR(opline->op1.var);
(gdb)
37187 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$23 = (zval *) 0x7ffff3814070
(gdb) p *z
$24 = {value = {lval = 140737278645952, dval = 6.9533454468151751e-310, counted = 0x7ffff38016c0, str = 0x7ffff38016c0, arr = 0x7ffff38016c0, obj = 0x7ffff38016c0, res = 0x7ffff38016c0,
ref = 0x7ffff38016c0, ast = 0x7ffff38016c0, zv = 0x7ffff38016c0, ptr = 0x7ffff38016c0, ce = 0x7ffff38016c0, func = 0x7ffff38016c0, ww = {w1 = 4085257920, w2 = 32767}}, u1 = {type_info = 266, v = {
type = 10 '\n', type_flags = 1 '\001', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.ref
$25 = {gc = {refcount = 1, u = {type_info = 26}}, val = {value = {lval = 140737278646144, dval = 6.9533454468246611e-310, counted = 0x7ffff3801780, str = 0x7ffff3801780, arr = 0x7ffff3801780,
obj = 0x7ffff3801780, res = 0x7ffff3801780, ref = 0x7ffff3801780, ast = 0x7ffff3801780, zv = 0x7ffff3801780, ptr = 0x7ffff3801780, ce = 0x7ffff3801780, func = 0x7ffff3801780, ww = {w1 = 4085258112,
w2 = 32767}}, u1 = {type_info = 6, v = {type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0,
fe_iter_idx = 0, access_flags = 0, property_guard = 0, constant_flags = 0, extra = 0}}, sources = {ptr = 0x0, list = 0}}
(gdb) p *z.value.ref.val.value.str
$26 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372247531462777, len = 5, val = "H"}
(gdb) p *z.value.ref.val.value.str.val@5
$27 = "Hello"
(gdb)

Zend Array

Zend Array 结构体

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
typedef struct _zend_array HashTable;

struct _zend_array {
zend_refcounted_h gc;
union {
struct {
ZEND_ENDIAN_LOHI_4(
zend_uchar flags,
zend_uchar _unused,
zend_uchar nIteratorsCount,
zend_uchar _unused2)
} v;
uint32_t flags;
} u;
uint32_t nTableMask;
Bucket *arData;
uint32_t nNumUsed;
uint32_t nNumOfElements;
uint32_t nTableSize;
uint32_t nInternalPointer;
zend_long nNextFreeElement;
dtor_func_t pDestructor;
};

/*
* HashTable Data Layout
* =====================
*
* +=============================+
* | HT_HASH(ht, ht->nTableMask) |
* | ... |
* | HT_HASH(ht, -1) |
* +-----------------------------+
* ht->arData ---> | Bucket[0] |
* | ... |
* | Bucket[ht->nTableSize-1] |
* +=============================+
*/

Zend Array 运行调试

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
# gdb /home/vagrant/codes/php80/bin/php
(gdb) b zend_compile
Breakpoint 1 at 0x4deed8: file /vagrant/php-8.0.10/Zend/zend_language_scanner.c, line 603.
(gdb) r array.php
Starting program: /home/vagrant/codes/php80/bin/php array.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, zend_compile (type=2) at /vagrant/php-8.0.10/Zend/zend_language_scanner.c:603
603 {
(gdb) s
604 zend_op_array *op_array = NULL;
(gdb) b _zend_hash_init
Breakpoint 2 at 0x555555aa768c: file /vagrant/php-8.0.10/Zend/zend_hash.c, line 266.
(gdb) c
Continuing.

Breakpoint 2, _zend_hash_init (ht=0x555556773ab0 <compiler_globals+272>, nSize=8, pDestructor=0x0, persistent=false) at /vagrant/php-8.0.10/Zend/zend_hash.c:266
266 _zend_hash_init_int(ht, nSize, pDestructor, persistent);
(gdb) s
_zend_hash_init_int (ht=0x555556773ab0 <compiler_globals+272>, nSize=8, pDestructor=0x0, persistent=false) at /vagrant/php-8.0.10/Zend/zend_hash.c:251
251 GC_SET_REFCOUNT(ht, 1);
(gdb) bt
#0 _zend_hash_init_int (ht=0x555556773ab0 <compiler_globals+272>, nSize=8, pDestructor=0x0, persistent=false) at /vagrant/php-8.0.10/Zend/zend_hash.c:251
#1 0x0000555555aa76a3 in _zend_hash_init (ht=0x555556773ab0 <compiler_globals+272>, nSize=8, pDestructor=0x0, persistent=false) at /vagrant/php-8.0.10/Zend/zend_hash.c:266
#2 0x0000555555a5c950 in zend_file_context_begin (prev_context=0x7fffffffa940) at /vagrant/php-8.0.10/Zend/zend_compile.c:358
#3 0x0000555555a32fe4 in zend_compile (type=2) at /vagrant/php-8.0.10/Zend/zend_language_scanner.c:628
#4 0x0000555555a3316e in compile_file (file_handle=0x7fffffffd1d0, type=8) at /vagrant/php-8.0.10/Zend/zend_language_scanner.c:665
#5 0x000055555585b013 in phar_compile_file (file_handle=0x7fffffffd1d0, type=8) at /vagrant/php-8.0.10/ext/phar/phar.c:3364
#6 0x0000555555a94ae5 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /vagrant/php-8.0.10/Zend/zend.c:1674
#7 0x00005555559f740c in php_execute_script (primary_file=0x7fffffffd1d0) at /vagrant/php-8.0.10/main/main.c:2524
#8 0x0000555555b81550 in do_cli (argc=2, argv=0x55555678a980) at /vagrant/php-8.0.10/sapi/cli/php_cli.c:949
#9 0x0000555555b82596 in main (argc=2, argv=0x55555678a980) at /vagrant/php-8.0.10/sapi/cli/php_cli.c:1337
(gdb) n
252 GC_TYPE_INFO(ht) = GC_ARRAY | (persistent ? ((GC_PERSISTENT|GC_NOT_COLLECTABLE) << GC_FLAGS_SHIFT) : 0);
(gdb) p ht
$1 = (HashTable *) 0x555556773ab0 <compiler_globals+272>
(gdb) p *ht
$2 = {gc = {refcount = 1, u = {type_info = 0}}, u = {v = {flags = 0 '\000', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 0}, nTableMask = 0, arData = 0x0, nNumUsed = 0,
nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}
(gdb) n
253 HT_FLAGS(ht) = HASH_FLAG_UNINITIALIZED;
(gdb) p HASH_FLAG_UNINITIALIZED
No symbol "HASH_FLAG_UNINITIALIZED" in current context.
(gdb) p ht
$3 = (HashTable *) 0x555556773ab0 <compiler_globals+272>
(gdb) p *ht
$4 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 0 '\000', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 0}, nTableMask = 0, arData = 0x0, nNumUsed = 0,
nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}
(gdb) n
254 ht->nTableMask = HT_MIN_MASK;
(gdb) p HT_MIN_MASK
No symbol "HT_MIN_MASK" in current context.
(gdb) p ht->nTableMask
$5 = 0
(gdb) n
255 HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
(gdb) p ht
$6 = (HashTable *) 0x555556773ab0 <compiler_globals+272>
(gdb) p *ht
$7 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x0,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}
(gdb) p (int32_t)4294967294
$8 = -2
(gdb) n
256 ht->nNumUsed = 0;
(gdb) p ht
$9 = (HashTable *) 0x555556773ab0 <compiler_globals+272>
(gdb) p *ht
$10 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x5555563477f8,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}
(gdb) n
257 ht->nNumOfElements = 0;
(gdb) n
258 ht->nInternalPointer = 0;
(gdb) n
259 ht->nNextFreeElement = ZEND_LONG_MIN;
(gdb) p ZEND_LONG_MIN
No symbol "ZEND_LONG_MIN" in current context.
(gdb) p ht->nNextFreeElement
$11 = 0
(gdb) p ht
$12 = (HashTable *) 0x555556773ab0 <compiler_globals+272>
(gdb) p *ht
$13 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x5555563477f8,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}
(gdb) n
260 ht->pDestructor = pDestructor;
(gdb)
261 ht->nTableSize = zend_hash_check_size(nSize);
(gdb) p nSize
$14 = 8
(gdb) p ht->nTableSize
$15 = 0
(gdb) n
262 }
(gdb) p ht->nTableSize
$16 = 8
(gdb) p ht
$17 = (HashTable *) 0x555556773ab0 <compiler_globals+272>
(gdb) p *ht
$18 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x5555563477f8,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = -9223372036854775808, pDestructor = 0x0}
(gdb)
$19 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x5555563477f8,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = -9223372036854775808, pDestructor = 0x0}
(gdb) b zend_execute
Breakpoint 3 at 0x555555b40f86: file /vagrant/php-8.0.10/Zend/zend_vm_execute.h, line 58454.
(gdb) c
Continuing.

Breakpoint 3, zend_execute (op_array=0x7ffff385c280, return_value=0x0) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:58454
58454 if (EG(exception) != NULL) {
(gdb) p op_array
$20 = (zend_op_array *) 0x7ffff385c280
(gdb) p *op_array
$21 = {type = 2 '\002', arg_flags = "\000\000", fn_flags = 100663296, function_name = 0x0, scope = 0x0, prototype = 0x0, num_args = 0, required_num_args = 0, arg_info = 0x0, attributes = 0x0,
cache_size = 0, last_var = 1, T = 7, last = 15, opcodes = 0x7ffff3877000, run_time_cache__ptr = 0x0, static_variables_ptr__ptr = 0x7ffff385c2e0, static_variables = 0x0, vars = 0x7ffff388b028,
refcount = 0x7ffff388b000, last_live_range = 0, last_try_catch = 0, live_range = 0x0, try_catch_array = 0x0, filename = 0x7ffff3858300, line_start = 1, line_end = 16, doc_comment = 0x0, last_literal = 13,
literals = 0x7ffff38771e0, reserved = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
(gdb) p $21.opcodes[0]
$22 = {handler = 0x555555b4047e <execute_ex+17348>, op1 = {constant = 80, var = 80, num = 80, opline_num = 80, jmp_offset = 80}, op2 = {constant = 480, var = 480, num = 480, opline_num = 480,
jmp_offset = 480}, result = {constant = 0, var = 0, num = 0, opline_num = 0, jmp_offset = 0}, extended_value = 0, lineno = 3, opcode = 22 '\026', op1_type = 8 '\b', op2_type = 1 '\001',
result_type = 0 '\000'}
(gdb) p $21.opcodes[1]
$23 = {handler = 0x555555b4043e <execute_ex+17284>, op1 = {constant = 80, var = 80, num = 80, opline_num = 80, jmp_offset = 80}, op2 = {constant = 464, var = 464, num = 464, opline_num = 464,
jmp_offset = 464}, result = {constant = 1, var = 1, num = 1, opline_num = 1, jmp_offset = 1}, extended_value = 0, lineno = 4, opcode = 23 '\027', op1_type = 8 '\b', op2_type = 1 '\001',
result_type = 0 '\000'}
(gdb) n
58458 object_or_called_scope = zend_get_this_object(EG(current_execute_data));
(gdb)
58459 if (EXPECTED(!object_or_called_scope)) {
(gdb)
58460 object_or_called_scope = zend_get_called_scope(EG(current_execute_data));
(gdb)
58461 call_info = ZEND_CALL_TOP_CODE | ZEND_CALL_HAS_SYMBOL_TABLE;
(gdb)
58465 execute_data = zend_vm_stack_push_call_frame(call_info,
(gdb)
58467 if (EG(current_execute_data)) {
(gdb)
58470 execute_data->symbol_table = &EG(symbol_table);
(gdb)
58472 EX(prev_execute_data) = EG(current_execute_data);
(gdb)
58473 i_init_code_execute_data(execute_data, op_array, return_value);
(gdb)
58474 ZEND_OBSERVER_FCALL_BEGIN(execute_data);
(gdb)
58475 zend_execute_ex(execute_data);
(gdb) s
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:50426
50426 {
(gdb) n
50443 vm_stack_data.orig_opline = opline;
(gdb)
50446 vm_stack_data.orig_execute_data = execute_data;
(gdb)
50447 execute_data = ex;
(gdb)
50452 memset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);
(gdb)
50453 if (zend_touch_vm_stack_data) {
(gdb)
50459 if (UNEXPECTED(execute_data == NULL)) {
(gdb)
53921 LOAD_OPLINE();
(gdb)
53922 ZEND_VM_LOOP_INTERRUPT_CHECK();
(gdb)
53929 HYBRID_SWITCH() {
(gdb)
57722 ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UNUSED_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:40834
40834 SAVE_OPLINE();
(gdb) n
40835 value = RT_CONSTANT(opline, opline->op2);
(gdb)
40836 variable_ptr = EX_VAR(opline->op1.var);
(gdb) p value
$24 = (zval *) 0x7ffff38771e0
(gdb) p *value
$25 = {value = {lval = 93825011099008, dval = 4.6355714704693513e-310, counted = 0x555556752580 <zend_empty_array>, str = 0x555556752580 <zend_empty_array>, arr = 0x555556752580 <zend_empty_array>,
obj = 0x555556752580 <zend_empty_array>, res = 0x555556752580 <zend_empty_array>, ref = 0x555556752580 <zend_empty_array>, ast = 0x555556752580 <zend_empty_array>,
zv = 0x555556752580 <zend_empty_array>, ptr = 0x555556752580 <zend_empty_array>, ce = 0x555556752580 <zend_empty_array>, func = 0x555556752580 <zend_empty_array>, ww = {w1 = 1450517888, w2 = 21845}},
u1 = {type_info = 7, v = {type = 7 '\a', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0,
property_guard = 0, constant_flags = 0, extra = 0}}
(gdb) p $25.value.arr
$26 = (zend_array *) 0x555556752580 <zend_empty_array>
(gdb) p *$25.value.arr
$27 = {gc = {refcount = 2, u = {type_info = 71}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294,
arData = 0x5555563477f8, nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
40838 value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES());
(gdb) p variable_ptr
$28 = (zval *) 0x7ffff3814070
(gdb) p *variable_ptr
$29 = {value = {lval = 0, dval = 0, counted = 0x0, str = 0x0, arr = 0x0, obj = 0x0, res = 0x0, ref = 0x0, ast = 0x0, zv = 0x0, ptr = 0x0, ce = 0x0, func = 0x0, ww = {w1 = 0, w2 = 0}}, u1 = {type_info = 0,
v = {type = 0 '\000', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0,
property_guard = 0, constant_flags = 0, extra = 0}}
(gdb) n
40845 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
(gdb)
40846 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:57723
57723 HYBRID_BREAK();
(gdb)
57706 ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:40386
40386 SAVE_OPLINE();
(gdb) n
40387 orig_object_ptr = object_ptr = EX_VAR(opline->op1.var);
(gdb)
40389 if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
(gdb) p orig_object_ptr
$30 = (zval *) 0x7ffff3814070
(gdb) p *orig_object_ptr
$31 = {value = {lval = 93825011099008, dval = 4.6355714704693513e-310, counted = 0x555556752580 <zend_empty_array>, str = 0x555556752580 <zend_empty_array>, arr = 0x555556752580 <zend_empty_array>,
obj = 0x555556752580 <zend_empty_array>, res = 0x555556752580 <zend_empty_array>, ref = 0x555556752580 <zend_empty_array>, ast = 0x555556752580 <zend_empty_array>,
zv = 0x555556752580 <zend_empty_array>, ptr = 0x555556752580 <zend_empty_array>, ce = 0x555556752580 <zend_empty_array>, func = 0x555556752580 <zend_empty_array>, ww = {w1 = 1450517888, w2 = 21845}},
u1 = {type_info = 7, v = {type = 7 '\a', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0,
property_guard = 0, constant_flags = 0, extra = 0}}
(gdb) p *orig_object_ptr.value.arr
$32 = {gc = {refcount = 2, u = {type_info = 71}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294,
arData = 0x5555563477f8, nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p object_ptr
$33 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$34 = {value = {lval = 93825011099008, dval = 4.6355714704693513e-310, counted = 0x555556752580 <zend_empty_array>, str = 0x555556752580 <zend_empty_array>, arr = 0x555556752580 <zend_empty_array>,
obj = 0x555556752580 <zend_empty_array>, res = 0x555556752580 <zend_empty_array>, ref = 0x555556752580 <zend_empty_array>, ast = 0x555556752580 <zend_empty_array>,
zv = 0x555556752580 <zend_empty_array>, ptr = 0x555556752580 <zend_empty_array>, ce = 0x555556752580 <zend_empty_array>, func = 0x555556752580 <zend_empty_array>, ww = {w1 = 1450517888, w2 = 21845}},
u1 = {type_info = 7, v = {type = 7 '\a', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0,
property_guard = 0, constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.arr
$35 = {gc = {refcount = 2, u = {type_info = 71}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294,
arData = 0x5555563477f8, nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
40390 try_assign_dim_array:
(gdb)
40391 SEPARATE_ARRAY(object_ptr);
(gdb) n
40419 dim = RT_CONSTANT(opline, opline->op2);
(gdb) p object_ptr
$36 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$37 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.arr
$38 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x5555563477f8,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p *(HashTable*)0x555556752580
$39 = {gc = {refcount = 2, u = {type_info = 71}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294,
arData = 0x5555563477f8, nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p *(HashTable*)0x7ffff3858360
$40 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294, arData = 0x5555563477f8,
nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
40421 variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
(gdb)
40425 if (UNEXPECTED(variable_ptr == NULL)) {
(gdb) p *variable_ptr
$41 = {value = {lval = 0, dval = 0, counted = 0x0, str = 0x0, arr = 0x0, obj = 0x0, res = 0x0, ref = 0x0, ast = 0x0, zv = 0x0, ptr = 0x0, ce = 0x0, func = 0x0, ww = {w1 = 0, w2 = 0}}, u1 = {type_info = 1,
v = {type = 1 '\001', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 21845, cache_slot = 21845, opline_num = 21845, lineno = 21845, num_args = 21845, fe_pos = 21845, fe_iter_idx = 21845,
access_flags = 21845, property_guard = 21845, constant_flags = 21845, extra = 21845}}
(gdb) n
40428 value = RT_CONSTANT((opline+1), (opline+1)->op1);
(gdb)
40429 value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES());
(gdb) p value
$42 = (zval *) 0x7ffff3877200
(gdb) p *value
$43 = {value = {lval = 93825011376272, dval = 4.635571484168013e-310, counted = 0x555556796090, str = 0x555556796090, arr = 0x555556796090, obj = 0x555556796090, res = 0x555556796090, ref = 0x555556796090,
ast = 0x555556796090, zv = 0x555556796090, ptr = 0x555556796090, ce = 0x555556796090, func = 0x555556796090, ww = {w1 = 1450795152, w2 = 21845}}, u1 = {type_info = 6, v = {type = 6 '\006',
type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *value.value.str
$44 = {gc = {refcount = 1, u = {type_info = 470}}, h = 9223372036854953478, len = 1, val = "a"}
(gdb) p *value.value.str.val@1
$45 = "a"
(gdb) n
40431 if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
(gdb)
40487 ZEND_VM_NEXT_OPCODE_EX(1, 2);
(gdb) p *(HashTable*)0x555556752580
$46 = {gc = {refcount = 2, u = {type_info = 71}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294,
arData = 0x5555563477f8, nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p *(HashTable*)0x7ffff3858360
$47 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 20 '\024', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 20}, nTableMask = 4294967294,
arData = 0x7ffff385c3c8, nNumUsed = 2, nNumOfElements = 1, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 2, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
40488 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:57707
57707 HYBRID_BREAK();
(gdb)
58090 ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:45781
45781 SAVE_OPLINE();
(gdb) n
45782 orig_object_ptr = object_ptr = EX_VAR(opline->op1.var);
(gdb) p orig_object_ptr
$48 = (zval *) 0x7ffff3814070
(gdb) p *orig_object_ptr
$49 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *orig_object_ptr.value.arr
$50 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 20 '\024', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 20}, nTableMask = 4294967294,
arData = 0x7ffff385c3c8, nNumUsed = 2, nNumOfElements = 1, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 2, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p object_ptr
$51 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$52 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.arr
$53 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 20 '\024', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 20}, nTableMask = 4294967294,
arData = 0x7ffff385c3c8, nNumUsed = 2, nNumOfElements = 1, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 2, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
45784 if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
(gdb) p object_ptr
$54 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$55 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.arr
$56 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 20 '\024', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 20}, nTableMask = 4294967294,
arData = 0x7ffff385c3c8, nNumUsed = 2, nNumOfElements = 1, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 2, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
45785 try_assign_dim_array:
(gdb)
45786 SEPARATE_ARRAY(object_ptr);
(gdb) p *object_ptr.value.arr
$57 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 20 '\024', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 20}, nTableMask = 4294967294,
arData = 0x7ffff385c3c8, nNumUsed = 2, nNumOfElements = 1, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 2, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
45788 value = RT_CONSTANT((opline+1), (opline+1)->op1);
(gdb)
45792 variable_ptr = zend_hash_next_index_insert(Z_ARRVAL_P(object_ptr), value);
(gdb) n
45793 if (UNEXPECTED(variable_ptr == NULL)) {
(gdb) p variable_ptr
$58 = (zval *) 0x7ffff385c408
(gdb) p *variable_ptr
$59 = {value = {lval = 93825011376320, dval = 4.6355714841703845e-310, counted = 0x5555567960c0, str = 0x5555567960c0, arr = 0x5555567960c0, obj = 0x5555567960c0, res = 0x5555567960c0, ref = 0x5555567960c0,
ast = 0x5555567960c0, zv = 0x5555567960c0, ptr = 0x5555567960c0, ce = 0x5555567960c0, func = 0x5555567960c0, ww = {w1 = 1450795200, w2 = 21845}}, u1 = {type_info = 6, v = {type = 6 '\006',
type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 32767, cache_slot = 32767, opline_num = 32767, lineno = 32767, num_args = 32767, fe_pos = 32767, fe_iter_idx = 32767, access_flags = 32767,
property_guard = 32767, constant_flags = 32767, extra = 32767}}
(gdb) n
45809 if (UNEXPECTED(Z_REFCOUNTED_P(value))) {
(gdb)
45826 if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
(gdb)
45882 ZEND_VM_NEXT_OPCODE_EX(1, 2);
(gdb) p value
$60 = (zval *) 0x7ffff3877210
(gdb) p *value
$61 = {value = {lval = 93825011376320, dval = 4.6355714841703845e-310, counted = 0x5555567960c0, str = 0x5555567960c0, arr = 0x5555567960c0, obj = 0x5555567960c0, res = 0x5555567960c0, ref = 0x5555567960c0,
ast = 0x5555567960c0, zv = 0x5555567960c0, ptr = 0x5555567960c0, ce = 0x5555567960c0, func = 0x5555567960c0, ww = {w1 = 1450795200, w2 = 21845}}, u1 = {type_info = 6, v = {type = 6 '\006',
type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *value.value.str
$62 = {gc = {refcount = 1, u = {type_info = 470}}, h = 9223372036854953479, len = 1, val = "b"}
(gdb) p *(HashTable*)0x555556752580
$63 = {gc = {refcount = 2, u = {type_info = 71}}, u = {v = {flags = 8 '\b', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 8}, nTableMask = 4294967294,
arData = 0x5555563477f8, nNumUsed = 0, nNumOfElements = 0, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p *(HashTable*)0x7ffff3858360
$64 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 20 '\024', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 20}, nTableMask = 4294967294,
arData = 0x7ffff385c3c8, nNumUsed = 3, nNumOfElements = 2, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p (int32_t)4294967294
$65 = -2
(gdb) p $64.arData[2]
$66 = {val = {value = {lval = 93825011376320, dval = 4.6355714841703845e-310, counted = 0x5555567960c0, str = 0x5555567960c0, arr = 0x5555567960c0, obj = 0x5555567960c0, res = 0x5555567960c0,
ref = 0x5555567960c0, ast = 0x5555567960c0, zv = 0x5555567960c0, ptr = 0x5555567960c0, ce = 0x5555567960c0, func = 0x5555567960c0, ww = {w1 = 1450795200, w2 = 21845}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 32767, cache_slot = 32767, opline_num = 32767, lineno = 32767, num_args = 32767, fe_pos = 32767, fe_iter_idx = 32767,
access_flags = 32767, property_guard = 32767, constant_flags = 32767, extra = 32767}}, h = 2, key = 0x0}
(gdb) p $64.arData[2].val.value.str
$67 = (zend_string *) 0x5555567960c0
(gdb) p *$64.arData[2].val.value.str
$68 = {gc = {refcount = 1, u = {type_info = 470}}, h = 9223372036854953479, len = 1, val = "b"}
(gdb) p *$64.arData[2].val.value.str.val@1
$69 = "b"
(gdb) n
45883 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:58091
58091 HYBRID_BREAK();
(gdb)
57706 ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:40386
40386 SAVE_OPLINE();
(gdb) n
40387 orig_object_ptr = object_ptr = EX_VAR(opline->op1.var);
(gdb)
40389 if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
(gdb) p object_ptr
$70 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$71 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) n
40390 try_assign_dim_array:
(gdb)
40391 SEPARATE_ARRAY(object_ptr);
(gdb)
40419 dim = RT_CONSTANT(opline, opline->op2);
(gdb)
40421 variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
(gdb) p dim
$72 = (zval *) 0x7ffff3877220
(gdb) p *dim
$73 = {value = {lval = 140737278646400, dval = 6.9533454468373092e-310, counted = 0x7ffff3801880, str = 0x7ffff3801880, arr = 0x7ffff3801880, obj = 0x7ffff3801880, res = 0x7ffff3801880,
ref = 0x7ffff3801880, ast = 0x7ffff3801880, zv = 0x7ffff3801880, ptr = 0x7ffff3801880, ce = 0x7ffff3801880, func = 0x7ffff3801880, ww = {w1 = 4085258368, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *dim.value.str
$74 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639297, len = 2, val = "k"}
(gdb) p *dim.value.str.val@2
$75 = "k1"
(gdb) n
40425 if (UNEXPECTED(variable_ptr == NULL)) {
(gdb) p *variable_ptr
$76 = {value = {lval = 0, dval = 0, counted = 0x0, str = 0x0, arr = 0x0, obj = 0x0, res = 0x0, ref = 0x0, ast = 0x0, zv = 0x0, ptr = 0x0, ce = 0x0, func = 0x0, ww = {w1 = 0, w2 = 0}}, u1 = {type_info = 1,
v = {type = 1 '\001', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0,
property_guard = 0, constant_flags = 0, extra = 0}}
(gdb) n
40428 value = RT_CONSTANT((opline+1), (opline+1)->op1);
(gdb)
40429 value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES());
(gdb) p value
$77 = (zval *) 0x7ffff3877230
(gdb) p *value
$78 = {value = {lval = 140737278646464, dval = 6.9533454468404712e-310, counted = 0x7ffff38018c0, str = 0x7ffff38018c0, arr = 0x7ffff38018c0, obj = 0x7ffff38018c0, res = 0x7ffff38018c0,
ref = 0x7ffff38018c0, ast = 0x7ffff38018c0, zv = 0x7ffff38018c0, ptr = 0x7ffff38018c0, ce = 0x7ffff38018c0, func = 0x7ffff38018c0, ww = {w1 = 4085258432, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *value.value.str
$79 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639660, len = 2, val = "v"}
(gdb) p *value.value.str.val@2
$80 = "v1"
(gdb) n
40431 if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
(gdb)
40487 ZEND_VM_NEXT_OPCODE_EX(1, 2);
(gdb) p *(HashTable*)0x7ffff3858360
$81 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 16 '\020', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 16}, nTableMask = 4294967280,
arData = 0x7ffff3874340, nNumUsed = 3, nNumOfElements = 3, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p (int32_t)4294967280
$82 = -16
(gdb) n
40488 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:57707
57707 HYBRID_BREAK();
(gdb)
57706 ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:40386
40386 SAVE_OPLINE();
(gdb) n
40387 orig_object_ptr = object_ptr = EX_VAR(opline->op1.var);
(gdb)
40389 if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
(gdb) p *object_ptr
$83 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.arr
$84 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 16 '\020', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 16}, nTableMask = 4294967280,
arData = 0x7ffff3874340, nNumUsed = 3, nNumOfElements = 3, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
40390 try_assign_dim_array:
(gdb)
40391 SEPARATE_ARRAY(object_ptr);
(gdb)
40419 dim = RT_CONSTANT(opline, opline->op2);
(gdb)
40421 variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
(gdb) p *dim
$85 = {value = {lval = 140737278646528, dval = 6.9533454468436333e-310, counted = 0x7ffff3801900, str = 0x7ffff3801900, arr = 0x7ffff3801900, obj = 0x7ffff3801900, res = 0x7ffff3801900,
ref = 0x7ffff3801900, ast = 0x7ffff3801900, zv = 0x7ffff3801900, ptr = 0x7ffff3801900, ce = 0x7ffff3801900, func = 0x7ffff3801900, ww = {w1 = 4085258496, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) n
40425 if (UNEXPECTED(variable_ptr == NULL)) {
(gdb) p *variable_ptr
$86 = {value = {lval = 0, dval = 0, counted = 0x0, str = 0x0, arr = 0x0, obj = 0x0, res = 0x0, ref = 0x0, ast = 0x0, zv = 0x0, ptr = 0x0, ce = 0x0, func = 0x0, ww = {w1 = 0, w2 = 0}}, u1 = {type_info = 1,
v = {type = 1 '\001', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 1, cache_slot = 1, opline_num = 1, lineno = 1, num_args = 1, fe_pos = 1, fe_iter_idx = 1, access_flags = 1,
property_guard = 1, constant_flags = 1, extra = 1}}
(gdb) n
40428 value = RT_CONSTANT((opline+1), (opline+1)->op1);
(gdb)
40429 value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES());
(gdb)
40431 if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
(gdb) p *value
$87 = {value = {lval = 140737278646592, dval = 6.9533454468467953e-310, counted = 0x7ffff3801940, str = 0x7ffff3801940, arr = 0x7ffff3801940, obj = 0x7ffff3801940, res = 0x7ffff3801940,
ref = 0x7ffff3801940, ast = 0x7ffff3801940, zv = 0x7ffff3801940, ptr = 0x7ffff3801940, ce = 0x7ffff3801940, func = 0x7ffff3801940, ww = {w1 = 4085258560, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 1, cache_slot = 1, opline_num = 1, lineno = 1, num_args = 1, fe_pos = 1, fe_iter_idx = 1, access_flags = 1, property_guard = 1,
constant_flags = 1, extra = 1}}
(gdb) p value
$88 = (zval *) 0x7ffff38743a0
(gdb) n
40487 ZEND_VM_NEXT_OPCODE_EX(1, 2);
(gdb)
40488 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:57707
57707 HYBRID_BREAK();
(gdb)
57642 ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:39426
39426 SAVE_OPLINE();
(gdb) n
39427 container = EX_VAR(opline->op1.var);
(gdb)
39428 dim = RT_CONSTANT(opline, opline->op2);
(gdb) p container
$89 = (zval *) 0x7ffff3814070
(gdb) p *container
$90 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p dim
$91 = (zval *) 0x7ffff3858360
(gdb) p *dim
$92 = {value = {lval = 30064771073, dval = 1.4853970537250972e-313, counted = 0x700000001, str = 0x700000001, arr = 0x700000001, obj = 0x700000001, res = 0x700000001, ref = 0x700000001, ast = 0x700000001,
zv = 0x700000001, ptr = 0x700000001, ce = 0x700000001, func = 0x700000001, ww = {w1 = 1, w2 = 7}}, u1 = {type_info = 16, v = {type = 16 '\020', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {
next = 4294967280, cache_slot = 4294967280, opline_num = 4294967280, lineno = 4294967280, num_args = 4294967280, fe_pos = 4294967280, fe_iter_idx = 4294967280, access_flags = 4294967280,
property_guard = 4294967280, constant_flags = 4294967280, extra = 4294967280}}
(gdb) p *dim.value.str
Cannot access memory at address 0x700000001
(gdb) p *dim.value.str.val@2
Cannot access memory at address 0x700000019
(gdb)
Cannot access memory at address 0x700000019
(gdb) n
39430 if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
(gdb) p dim
$93 = (zval *) 0x7ffff3877260
(gdb) p *dim
$94 = {value = {lval = 140737278646400, dval = 6.9533454468373092e-310, counted = 0x7ffff3801880, str = 0x7ffff3801880, arr = 0x7ffff3801880, obj = 0x7ffff3801880, res = 0x7ffff3801880,
ref = 0x7ffff3801880, ast = 0x7ffff3801880, zv = 0x7ffff3801880, ptr = 0x7ffff3801880, ce = 0x7ffff3801880, func = 0x7ffff3801880, ww = {w1 = 4085258368, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *dim.value
Attempt to take contents of a non-pointer value.
(gdb) p *dim.value.str
$95 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639297, len = 2, val = "k"}
(gdb) p *dim.value.str.val@2
$96 = "k1"
(gdb) n
39431 fetch_dim_r_array:
(gdb)
39432 value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, IS_CONST, BP_VAR_R EXECUTE_DATA_CC);
(gdb)
39433 ZVAL_COPY_DEREF(EX_VAR(opline->result.var), value);
(gdb) p value
$97 = (zval *) 0x7ffff3874380
(gdb) p *value
$98 = {value = {lval = 140737278646464, dval = 6.9533454468404712e-310, counted = 0x7ffff38018c0, str = 0x7ffff38018c0, arr = 0x7ffff38018c0, obj = 0x7ffff38018c0, res = 0x7ffff38018c0,
ref = 0x7ffff38018c0, ast = 0x7ffff38018c0, zv = 0x7ffff38018c0, ptr = 0x7ffff38018c0, ce = 0x7ffff38018c0, func = 0x7ffff38018c0, ww = {w1 = 4085258432, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *value.value.str
$99 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639660, len = 2, val = "v"}
(gdb) p *value.value.str.val@2
$100 = "v1"
(gdb) n
39453 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
(gdb) n
39454 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:57643
57643 HYBRID_BREAK();
(gdb)
55595 ZEND_ECHO_SPEC_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ECHO_SPEC_TMPVAR_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:13883
13883 SAVE_OPLINE();
(gdb) n
13884 z = _get_zval_ptr_var(opline->op1.var EXECUTE_DATA_CC);
(gdb)
13886 if (Z_TYPE_P(z) == IS_STRING) {
(gdb) p z
$101 = (zval *) 0x7ffff38140d0
(gdb) p *z
$102 = {value = {lval = 140737278646464, dval = 6.9533454468404712e-310, counted = 0x7ffff38018c0, str = 0x7ffff38018c0, arr = 0x7ffff38018c0, obj = 0x7ffff38018c0, res = 0x7ffff38018c0,
ref = 0x7ffff38018c0, ast = 0x7ffff38018c0, zv = 0x7ffff38018c0, ptr = 0x7ffff38018c0, ce = 0x7ffff38018c0, func = 0x7ffff38018c0, ww = {w1 = 4085258432, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.arr
$103 = {gc = {refcount = 1, u = {type_info = 86}}, u = {v = {flags = 172 '\254', _unused = 121 'y', nIteratorsCount = 89 'Y', _unused2 = 0 '\000'}, flags = 5863852}, nTableMask = 2147483648, arData = 0x2,
nNumUsed = 12662, nNumOfElements = 0, nTableSize = 32, nInternalPointer = 0, nNextFreeElement = 93825006918352, pDestructor = 0x0}
(gdb) n
13887 zend_string *str = Z_STR_P(z);
(gdb)
13889 if (ZSTR_LEN(str) != 0) {
(gdb)
13890 zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
(gdb)
v113903 zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
(gdb)
13904 ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
(gdb)
13905 }
(gdb) p z
$104 = (zval *) 0x7ffff38140d0
(gdb) p *z
$105 = {value = {lval = 140737278646464, dval = 6.9533454468404712e-310, counted = 0x7ffff38018c0, str = 0x7ffff38018c0, arr = 0x7ffff38018c0, obj = 0x7ffff38018c0, res = 0x7ffff38018c0,
ref = 0x7ffff38018c0, ast = 0x7ffff38018c0, zv = 0x7ffff38018c0, ptr = 0x7ffff38018c0, ce = 0x7ffff38018c0, func = 0x7ffff38018c0, ww = {w1 = 4085258432, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *z.value.arr
$106 = {gc = {refcount = 1, u = {type_info = 86}}, u = {v = {flags = 172 '\254', _unused = 121 'y', nIteratorsCount = 89 'Y', _unused2 = 0 '\000'}, flags = 5863852}, nTableMask = 2147483648, arData = 0x2,
nNumUsed = 12662, nNumOfElements = 0, nTableSize = 32, nInternalPointer = 0, nNextFreeElement = 93825006918352, pDestructor = 0x0}
(gdb) n
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:55596
55596 HYBRID_BREAK();
(gdb)
57706 ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_ASSIGN_DIM_SPEC_CV_CONST_OP_DATA_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:40386
40386 SAVE_OPLINE();
(gdb) n
40387 orig_object_ptr = object_ptr = EX_VAR(opline->op1.var);
(gdb)
40389 if (EXPECTED(Z_TYPE_P(object_ptr) == IS_ARRAY)) {
(gdb) p object_ptr
$107 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$108 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.arr
$109 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 16 '\020', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 16}, nTableMask = 4294967280,
arData = 0x7ffff3874340, nNumUsed = 4, nNumOfElements = 4, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) n
40390 try_assign_dim_array:
(gdb)
40391 SEPARATE_ARRAY(object_ptr);
(gdb)
40419 dim = RT_CONSTANT(opline, opline->op2);
(gdb)
40421 variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
(gdb) p dim
$110 = (zval *) 0x7ffff3877270
(gdb) p *dim
$111 = {value = {lval = 140737278646400, dval = 6.9533454468373092e-310, counted = 0x7ffff3801880, str = 0x7ffff3801880, arr = 0x7ffff3801880, obj = 0x7ffff3801880, res = 0x7ffff3801880,
ref = 0x7ffff3801880, ast = 0x7ffff3801880, zv = 0x7ffff3801880, ptr = 0x7ffff3801880, ce = 0x7ffff3801880, func = 0x7ffff3801880, ww = {w1 = 4085258368, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *dim.value.str
$112 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639297, len = 2, val = "k"}
(gdb) p *dim.value.str.val@2
$113 = "k1"
(gdb) n
40425 if (UNEXPECTED(variable_ptr == NULL)) {
(gdb) p object_ptr
$114 = (zval *) 0x7ffff3814070
(gdb) p *object_ptr
$115 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *object_ptr.value.str
$116 = {gc = {refcount = 1, u = {type_info = 7}}, h = 18446744004990074896, len = 140737279116096, val = "\004"}
(gdb) p *object_ptr.value.str.val@2
$117 = "\004"
(gdb) n
40428 value = RT_CONSTANT((opline+1), (opline+1)->op1);
(gdb)
40429 value = zend_assign_to_variable(variable_ptr, value, IS_CONST, EX_USES_STRICT_TYPES());
(gdb) p *value
$118 = {value = {lval = 93825011376368, dval = 4.635571484172756e-310, counted = 0x5555567960f0, str = 0x5555567960f0, arr = 0x5555567960f0, obj = 0x5555567960f0, res = 0x5555567960f0, ref = 0x5555567960f0,
ast = 0x5555567960f0, zv = 0x5555567960f0, ptr = 0x5555567960f0, ce = 0x5555567960f0, func = 0x5555567960f0, ww = {w1 = 1450795248, w2 = 21845}}, u1 = {type_info = 6, v = {type = 6 '\006',
type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *value.value.str
$119 = {gc = {refcount = 1, u = {type_info = 470}}, h = 9223372036854953480, len = 1, val = "c"}
(gdb) p *value.value.str.val@1
$120 = "c"
(gdb) n
40431 if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
(gdb)
40487 ZEND_VM_NEXT_OPCODE_EX(1, 2);
(gdb) p *(HashTable*)0x7ffff3858360
$121 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 16 '\020', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 16}, nTableMask = 4294967280,
arData = 0x7ffff3874340, nNumUsed = 4, nNumOfElements = 4, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p $121.arData[3]
$122 = {val = {value = {lval = 140737278646592, dval = 6.9533454468467953e-310, counted = 0x7ffff3801940, str = 0x7ffff3801940, arr = 0x7ffff3801940, obj = 0x7ffff3801940, res = 0x7ffff3801940,
ref = 0x7ffff3801940, ast = 0x7ffff3801940, zv = 0x7ffff3801940, ptr = 0x7ffff3801940, ce = 0x7ffff3801940, func = 0x7ffff3801940, ww = {w1 = 4085258560, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 1, cache_slot = 1, opline_num = 1, lineno = 1, num_args = 1, fe_pos = 1, fe_iter_idx = 1, access_flags = 1,
property_guard = 1, constant_flags = 1, extra = 1}}, h = 9223372036860639298, key = 0x7ffff3801900}
(gdb) p $121.arData[3].key
$123 = (zend_string *) 0x7ffff3801900
(gdb) p *$121.arData[3].key
$124 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639298, len = 2, val = "k"}
(gdb) p *$121.arData[3].key.val@2
$125 = "k2"
(gdb) p *$121.arData[2].key.val@2
$126 = "k1"
(gdb) p $121.arData[2]
$127 = {val = {value = {lval = 93825011376368, dval = 4.635571484172756e-310, counted = 0x5555567960f0, str = 0x5555567960f0, arr = 0x5555567960f0, obj = 0x5555567960f0, res = 0x5555567960f0,
ref = 0x5555567960f0, ast = 0x5555567960f0, zv = 0x5555567960f0, ptr = 0x5555567960f0, ce = 0x5555567960f0, func = 0x5555567960f0, ww = {w1 = 1450795248, w2 = 21845}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0,
property_guard = 0, constant_flags = 0, extra = 0}}, h = 9223372036860639297, key = 0x7ffff3801880}
(gdb) p $121.arData[2].val.value.str
$128 = (zend_string *) 0x5555567960f0
(gdb) p *$121.arData[2].val.value.str
$129 = {gc = {refcount = 1, u = {type_info = 470}}, h = 9223372036854953480, len = 1, val = "c"}
(gdb) p *$121.arData[2].val.value.str.val@1
$130 = "c"
(gdb) n
40488 }
(gdb)
execute_ex (ex=0x7ffff3814020) at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:57707
57707 HYBRID_BREAK();
(gdb)
57766 ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
(gdb) s
ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER () at /vagrant/php-8.0.10/Zend/zend_vm_execute.h:41474
41474 {
(gdb) n
41481 SAVE_OPLINE();
(gdb)
41482 container = EX_VAR(opline->op1.var);
(gdb)
41483 offset = RT_CONSTANT(opline, opline->op2);
(gdb) p container
$131 = (zval *) 0x7ffff3814070
(gdb) p *container
$132 = {value = {lval = 140737279001440, dval = 6.9533454643786159e-310, counted = 0x7ffff3858360, str = 0x7ffff3858360, arr = 0x7ffff3858360, obj = 0x7ffff3858360, res = 0x7ffff3858360,
ref = 0x7ffff3858360, ast = 0x7ffff3858360, zv = 0x7ffff3858360, ptr = 0x7ffff3858360, ce = 0x7ffff3858360, func = 0x7ffff3858360, ww = {w1 = 4085613408, w2 = 32767}}, u1 = {type_info = 775, v = {
type = 7 '\a', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) n
41486 if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
(gdb)
41489 unset_dim_array:
(gdb)
41490 SEPARATE_ARRAY(container);
(gdb)
41491 ht = Z_ARRVAL_P(container);
(gdb)
41493 if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) {
(gdb) p ht
$133 = (HashTable *) 0x7ffff3858360
(gdb) p *ht
$134 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 16 '\020', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 16}, nTableMask = 4294967280,
arData = 0x7ffff3874340, nNumUsed = 4, nNumOfElements = 4, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb) p offset
$135 = (zval *) 0x7ffff3877290
(gdb) p *offset
$136 = {value = {lval = 140737278646528, dval = 6.9533454468436333e-310, counted = 0x7ffff3801900, str = 0x7ffff3801900, arr = 0x7ffff3801900, obj = 0x7ffff3801900, res = 0x7ffff3801900,
ref = 0x7ffff3801900, ast = 0x7ffff3801900, zv = 0x7ffff3801900, ptr = 0x7ffff3801900, ce = 0x7ffff3801900, func = 0x7ffff3801900, ww = {w1 = 4085258496, w2 = 32767}}, u1 = {type_info = 6, v = {
type = 6 '\006', type_flags = 0 '\000', u = {extra = 0}}}, u2 = {next = 0, cache_slot = 0, opline_num = 0, lineno = 0, num_args = 0, fe_pos = 0, fe_iter_idx = 0, access_flags = 0, property_guard = 0,
constant_flags = 0, extra = 0}}
(gdb) p *offset.value.str
$137 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639298, len = 2, val = "k"}
(gdb) p *offset.value.str.val@2
$138 = "k2"
(gdb) p key
$139 = (zend_string *) 0x7ffff3874380
(gdb) p *key
$140 = {gc = {refcount = 1450795248, u = {type_info = 21845}}, h = 6, len = 9223372036860639297, val = "\200"}
(gdb)
$141 = {gc = {refcount = 1450795248, u = {type_info = 21845}}, h = 6, len = 9223372036860639297, val = "\200"}
(gdb) n
41494 key = Z_STR_P(offset);
(gdb)
41500 str_index_dim:
(gdb)
41501 if (ht == &EG(symbol_table)) {
(gdb) p key
$142 = (zend_string *) 0x7ffff3801900
(gdb) p *key
$143 = {gc = {refcount = 1, u = {type_info = 86}}, h = 9223372036860639298, len = 2, val = "k"}
(gdb) p *key.value.str.val@2
There is no member named value.
(gdb) n
41504 zend_hash_del(ht, key);
(gdb)
41535 break;
(gdb) p ht
$144 = (HashTable *) 0x7ffff3858360
(gdb) p *ht
$145 = {gc = {refcount = 1, u = {type_info = 7}}, u = {v = {flags = 16 '\020', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 16}, nTableMask = 4294967280,
arData = 0x7ffff3874340, nNumUsed = 3, nNumOfElements = 3, nTableSize = 8, nInternalPointer = 0, nNextFreeElement = 3, pDestructor = 0x555555a909a5 <zval_ptr_dtor>}
(gdb)
本笔记是笔者在学习和工作中的一些整理,如对您有用,请鼓励我继续写作