Skip to content

Commit 663baf6

Browse files
committed
Fix tests
1 parent e3dd6e5 commit 663baf6

File tree

15 files changed

+57
-31
lines changed

15 files changed

+57
-31
lines changed

Zend/Optimizer/zend_dump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,9 @@ ZEND_API void zend_dump_op(const zend_op_array *op_array, const zend_basic_block
679679
}
680680
} ZEND_HASH_FOREACH_END();
681681
fprintf(stderr, " default:");
682+
} else if (opline->opcode == ZEND_INIT_ICALL) {
683+
zend_function *func = Z_PTR_P(CRT_CONSTANT(opline->op2));
684+
fprintf(stderr, " (%s)", ZSTR_VAL(func->common.function_name));
682685
} else {
683686
zend_dump_const(op);
684687
}

Zend/zend_compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4837,7 +4837,8 @@ static void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{
48374837
return;
48384838
}
48394839

4840-
if (fbc->type == ZEND_INTERNAL_FUNCTION) {
4840+
if (fbc->type == ZEND_INTERNAL_FUNCTION
4841+
&& !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)) {
48414842
zend_string_release_ex(lcname, 0);
48424843
zval_ptr_dtor(&name_node.u.constant);
48434844
ZVAL_PTR(&name_node.u.constant, fbc);

ext/opcache/tests/match/001.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Match expression string jump table
44
opcache.enable=1
55
opcache.enable_cli=1
66
opcache.opt_debug_level=0x20000
7+
opcache.file_cache=
8+
opcache.file_cache_only=0
79
--EXTENSIONS--
810
opcache
911
--FILE--
@@ -30,13 +32,13 @@ $_main:
3032
; (lines=15, args=0, vars=1, tmps=2)
3133
; (after optimizer)
3234
; %s
33-
0000 INIT_FCALL 2 %d string("range")
35+
0000 INIT_ICALL 2 %d (range)
3436
0001 SEND_VAL string("a") 1
3537
0002 SEND_VAL string("i") 2
3638
0003 V2 = DO_ICALL
3739
0004 V1 = FE_RESET_R V2 0013
3840
0005 FE_FETCH_R V1 CV0($char) 0013
39-
0006 INIT_FCALL 1 %d string("var_dump")
41+
0006 INIT_ICALL 1 %d (var_dump)
4042
0007 INIT_FCALL 1 %d string("test")
4143
0008 SEND_VAR CV0($char) 1
4244
0009 V2 = DO_UCALL

ext/opcache/tests/match/003.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Match expression long jump table
44
opcache.enable=1
55
opcache.enable_cli=1
66
opcache.opt_debug_level=0x20000
7+
opcache.file_cache=
8+
opcache.file_cache_only=0
79
--EXTENSIONS--
810
opcache
911
--FILE--
@@ -31,13 +33,13 @@ $_main:
3133
; (lines=15, args=0, vars=1, tmps=2)
3234
; (after optimizer)
3335
; %s
34-
0000 INIT_FCALL 2 %d string("range")
36+
0000 INIT_ICALL 2 %d (range)
3537
0001 SEND_VAL int(0) 1
3638
0002 SEND_VAL int(10) 2
3739
0003 V2 = DO_ICALL
3840
0004 V1 = FE_RESET_R V2 0013
3941
0005 FE_FETCH_R V1 CV0($char) 0013
40-
0006 INIT_FCALL 1 %d string("var_dump")
42+
0006 INIT_ICALL 1 %d (var_dump)
4143
0007 INIT_FCALL 1 %d string("test")
4244
0008 SEND_VAR CV0($char) 1
4345
0009 V2 = DO_UCALL

ext/opcache/tests/match/004.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Match expression mixed jump table
44
opcache.enable=1
55
opcache.enable_cli=1
66
opcache.opt_debug_level=0x20000
7+
opcache.file_cache=
8+
opcache.file_cache_only=0
79
--EXTENSIONS--
810
opcache
911
--FILE--
@@ -36,19 +38,19 @@ $_main:
3638
; (lines=22, args=0, vars=1, tmps=2)
3739
; (after optimizer)
3840
; %s.php:1-25
39-
0000 INIT_FCALL 2 %d string("range")
41+
0000 INIT_ICALL 2 %d (range)
4042
0001 SEND_VAL int(0) 1
4143
0002 SEND_VAL int(6) 2
4244
0003 V2 = DO_ICALL
4345
0004 V1 = FE_RESET_R V2 0020
4446
0005 FE_FETCH_R V1 CV0($number) 0020
45-
0006 INIT_FCALL 1 %d string("var_dump")
47+
0006 INIT_ICALL 1 %d (var_dump)
4648
0007 INIT_FCALL 1 %d string("test")
4749
0008 SEND_VAR CV0($number) 1
4850
0009 V2 = DO_UCALL
4951
0010 SEND_VAR V2 1
5052
0011 DO_ICALL
51-
0012 INIT_FCALL 1 %d string("var_dump")
53+
0012 INIT_ICALL 1 %d (var_dump)
5254
0013 INIT_FCALL 1 %d string("test")
5355
0014 T2 = CAST (string) CV0($number)
5456
0015 SEND_VAL T2 1

ext/opcache/tests/opt/gh11170.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ opcache.enable_cli=1
66
opcache.optimization_level=-1
77
opcache.opt_debug_level=0x400000
88
opcache.preload=
9+
opcache.file_cache=
10+
opcache.file_cache_only=0
911
--EXTENSIONS--
1012
opcache
1113
--FILE--
@@ -64,7 +66,7 @@ BB0:
6466
; to=(BB2, BB1)
6567
; level=0
6668
; children=(BB1, BB2, BB3)
67-
0000 INIT_FCALL 0 %d string("rand")
69+
0000 INIT_ICALL 0 80 (rand)
6870
0001 #2.V2 [long] = DO_ICALL
6971
0002 #3.T3 [long] RANGE[MIN..MAX] = MOD #2.V2 [long] int(10)
7072
0003 JMPZ #3.T3 [long] RANGE[MIN..MAX] BB2
@@ -110,7 +112,7 @@ BB0:
110112
; to=(BB2, BB1)
111113
; level=0
112114
; children=(BB1, BB2, BB3)
113-
0000 INIT_FCALL 0 %d string("rand")
115+
0000 INIT_ICALL 0 %d (rand)
114116
0001 #2.V2 [long] = DO_ICALL
115117
0002 #3.T3 [long] RANGE[MIN..MAX] = MOD #2.V2 [long] int(10)
116118
0003 JMPZ #3.T3 [long] RANGE[MIN..MAX] BB2

ext/opcache/tests/opt/nullsafe_001.phpt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Nullsafe basic optimization
44
opcache.enable=1
55
opcache.enable_cli=1
66
opcache.opt_debug_level=0x20000
7+
opcache.file_cache=
8+
opcache.file_cache_only=0
79
--EXTENSIONS--
810
opcache
911
--FILE--
@@ -35,13 +37,13 @@ test:
3537
; (lines=10, args=0, vars=0, tmps=0)
3638
; (after optimizer)
3739
; %s
38-
0000 INIT_FCALL 1 %d string("var_dump")
40+
0000 INIT_ICALL 1 %d (var_dump)
3941
0001 SEND_VAL null 1
4042
0002 DO_ICALL
41-
0003 INIT_FCALL 1 %d string("var_dump")
43+
0003 INIT_ICALL 1 %d (var_dump)
4244
0004 SEND_VAL bool(false) 1
4345
0005 DO_ICALL
44-
0006 INIT_FCALL 1 %d string("var_dump")
46+
0006 INIT_ICALL 1 %d (var_dump)
4547
0007 SEND_VAL bool(true) 1
4648
0008 DO_ICALL
4749
0009 RETURN null
@@ -51,17 +53,17 @@ test2:
5153
; (after optimizer)
5254
; %s
5355
0000 CV0($obj) = RECV 1
54-
0001 INIT_FCALL 1 %d string("var_dump")
56+
0001 INIT_ICALL 1 %d (var_dump)
5557
0002 T1 = JMP_NULL CV0($obj) 0004
5658
0003 T1 = FETCH_OBJ_R CV0($obj) string("foo")
5759
0004 SEND_VAL T1 1
5860
0005 DO_ICALL
59-
0006 INIT_FCALL 1 %d string("var_dump")
61+
0006 INIT_ICALL 1 %d (var_dump)
6062
0007 T1 = JMP_NULL CV0($obj) 0009
6163
0008 T1 = ISSET_ISEMPTY_PROP_OBJ (isset) CV0($obj) string("foo")
6264
0009 SEND_VAL T1 1
6365
0010 DO_ICALL
64-
0011 INIT_FCALL 1 %d string("var_dump")
66+
0011 INIT_ICALL 1 %d (var_dump)
6567
0012 T1 = JMP_NULL CV0($obj) 0014
6668
0013 T1 = ISSET_ISEMPTY_PROP_OBJ (empty) CV0($obj) string("foo")
6769
0014 SEND_VAL T1 1

ext/opcache/tests/opt/nullsafe_002.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Nullsafe e-ssa pi node placement
44
opcache.enable=1
55
opcache.enable_cli=1
66
opcache.opt_debug_level=0x200000
7+
opcache.file_cache=
8+
opcache.file_cache_only=0
79
--EXTENSIONS--
810
opcache
911
--FILE--
@@ -41,7 +43,7 @@ BB0:
4143
; level=0
4244
; children=(BB1, BB2)
4345
0000 #1.CV0($test) [null, object (instanceof Test)] = RECV 1
44-
0001 INIT_FCALL 1 %d string("var_dump")
46+
0001 INIT_ICALL 1 %d (var_dump)
4547
0002 #2.T1 [null] = JMP_NULL #1.CV0($test) [null, object (instanceof Test)] BB2
4648

4749
BB1:

ext/opcache/tests/opt/prop_types.phpt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ opcache.enable_cli=1
66
opcache.optimization_level=-1
77
opcache.opt_debug_level=0x200000
88
opcache.preload=
9+
opcache.file_cache=
10+
opcache.file_cache_only=0
911
--EXTENSIONS--
1012
opcache
1113
--FILE--
@@ -59,7 +61,7 @@ BB0:
5961
; start exit lines=[0-9]
6062
; level=0
6163
0000 #1.CV0($test) [object (instanceof Test)] = RECV 1
62-
0001 INIT_FCALL 3 %d string("var_dump")
64+
0001 INIT_ICALL 3 %d (var_dump)
6365
0002 #2.T1 [bool] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("public")
6466
0003 SEND_VAL #2.T1 [bool] 1
6567
0004 #3.T2 [any] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("protected")
@@ -77,7 +79,7 @@ Test::inTest:
7779
BB0:
7880
; start exit lines=[0-8]
7981
; level=0
80-
0000 INIT_FCALL 3 %d string("var_dump")
82+
0000 INIT_ICALL 3 %d (var_dump)
8183
0001 #0.T0 [bool] = FETCH_OBJ_R THIS string("public")
8284
0002 SEND_VAL #0.T0 [bool] 1
8385
0003 #1.T1 [long] = FETCH_OBJ_R THIS string("protected")
@@ -97,7 +99,7 @@ BB0:
9799
; start exit lines=[0-9]
98100
; level=0
99101
0000 #1.CV0($test2) [object (instanceof Test2)] = RECV 1
100-
0001 INIT_FCALL 3 %d string("var_dump")
102+
0001 INIT_ICALL 3 %d (var_dump)
101103
0002 #2.T1 [bool] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("public")
102104
0003 SEND_VAL #2.T1 [bool] 1
103105
0004 #3.T2 [long] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("protected")
@@ -115,7 +117,7 @@ Test2::inTest2:
115117
BB0:
116118
; start exit lines=[0-8]
117119
; level=0
118-
0000 INIT_FCALL 3 %d string("var_dump")
120+
0000 INIT_ICALL 3 %d (var_dump)
119121
0001 #0.T0 [bool] = FETCH_OBJ_R THIS string("public")
120122
0002 SEND_VAL #0.T0 [bool] 1
121123
0003 #1.T1 [long] = FETCH_OBJ_R THIS string("protected")

ext/opcache/tests/opt/sccp_026.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ opcache.enable_cli=1
66
opcache.optimization_level=-1
77
opcache.opt_debug_level=0x20000
88
opcache.preload=
9+
opcache.file_cache=
10+
opcache.file_cache_only=0
911
--EXTENSIONS--
1012
opcache
1113
--FILE--
@@ -34,7 +36,7 @@ test:
3436
0002 JMPZ T2 0004
3537
0003 JMP 0005
3638
0004 RETURN null
37-
0005 INIT_FCALL 1 %d string("var_dump")
39+
0005 INIT_ICALL 1 %d (var_dump)
3840
0006 SEND_VAR CV1($username) 1
3941
0007 DO_ICALL
4042
0008 RETURN null

ext/opcache/tests/opt/sccp_032.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ opcache.enable_cli=1
66
opcache.optimization_level=-1
77
opcache.opt_debug_level=0x20000
88
opcache.preload=
9+
opcache.file_cache=
10+
opcache.file_cache_only=0
911
--EXTENSIONS--
1012
opcache
1113
--FILE--
@@ -32,7 +34,7 @@ $_main:
3234
0001 V2 = DO_UCALL
3335
0002 V1 = FE_RESET_R V2 0009
3436
0003 FE_FETCH_R V1 CV0($x) 0009
35-
0004 INIT_FCALL 1 %d string("var_export")
37+
0004 INIT_ICALL 1 %d (var_export)
3638
0005 SEND_VAR CV0($x) 1
3739
0006 DO_ICALL
3840
0007 ECHO string("

sapi/phpdbg/phpdbg_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ PHPDBG_INFO(literal) /* {{{ */
324324
}
325325

326326
while (literal < ops->last_literal) {
327-
if (Z_TYPE(ops->literals[literal]) != IS_NULL) {
327+
if (Z_TYPE(ops->literals[literal]) != IS_NULL && Z_TYPE(ops->literals[literal]) != IS_PTR) {
328328
phpdbg_write("|-------- C%u -------> [", literal);
329329
zend_print_zval(&ops->literals[literal], 0);
330330
phpdbg_out("]\n");

sapi/phpdbg/tests/info_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Test basic info functionality
33
--INI--
44
auto_globals_jit=0
5+
opcache.file_cache=
6+
opcache.file_cache_only=0
57
--PHPDBG--
68
i classes
79
i funcs
@@ -50,8 +52,6 @@ prompt> [User-defined constants (0)]
5052
prompt> [Included files: %d]%A
5153
prompt> [No error found!]
5254
prompt> [Literal Constants in foo() (2)]
53-
|-------- C0 -------> [var_dump]
54-
|-------- C1 -------> [strrev]
5555
prompt> string(4) "tset"
5656
[Script ended normally]
5757
prompt> [No active op array!]

sapi/phpdbg/tests/print_001.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Basic print functionality
33
--INI--
44
opcache.enable_cli=0
5+
opcache.file_cache=
6+
opcache.file_cache_only=0
57
--PHPDBG--
68
p foo
79
p class \Foo\bar
@@ -16,8 +18,8 @@ foo:
1618
; (lines=8, args=1, vars=1, tmps=2)
1719
; %s:14-16
1820
L0014 0000 CV0($baz) = RECV 1
19-
L0015 0001 INIT_FCALL %d %d string("var_dump")
20-
L0015 0002 INIT_FCALL %d %d string("strrev")
21+
L0015 0001 INIT_ICALL 1 %d (var_dump)
22+
L0015 0002 INIT_ICALL 1 %d (strrev)
2123
L0015 0003 SEND_VAR CV0($baz) 1
2224
L0015 0004 V1 = DO_ICALL
2325
L0015 0005 SEND_VAR V1 1

sapi/phpdbg/tests/print_002.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Relative print commands
33
--INI--
44
opcache.enable_cli=0
5+
opcache.file_cache=
6+
opcache.file_cache_only=0
57
--PHPDBG--
68
b foo
79
r
@@ -22,14 +24,14 @@ foo:
2224
; (lines=8, args=1, vars=1, tmps=2)
2325
; %s:14-16
2426
L0014 0000 CV0($baz) = RECV 1
25-
L0015 0001 INIT_FCALL %d %d string("var_dump")
26-
L0015 0002 INIT_FCALL %d %d string("strrev")
27+
L0015 0001 INIT_ICALL %d %d (var_dump)
28+
L0015 0002 INIT_ICALL %d %d (strrev)
2729
L0015 0003 SEND_VAR CV0($baz) 1
2830
L0015 0004 V1 = DO_ICALL
2931
L0015 0005 SEND_VAR V1 1
3032
L0015 0006 DO_ICALL
3133
L0016 0007 RETURN null
32-
prompt> L0015 0001 INIT_FCALL %d %d string("var_dump")
34+
prompt> L0015 0001 INIT_ICALL %d %d (var_dump)
3335
prompt>
3436
--FILE--
3537
<?php

0 commit comments

Comments
 (0)