-
Notifications
You must be signed in to change notification settings - Fork 8k
Expand file tree
/
Copy patharray_map_foreach_optimization_004.phpt
More file actions
57 lines (52 loc) · 1.15 KB
/
array_map_foreach_optimization_004.phpt
File metadata and controls
57 lines (52 loc) · 1.15 KB
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
--TEST--
array_map(): foreach optimization - unused refcounted result
--EXTENSIONS--
opcache
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.opt_debug_level=0x20000
--FILE--
<?php
function stdClass() {
return new stdClass();
}
$array = range(1, 10);
array_map(stdClass(...), $array);
?>
--EXPECTF--
$_main:
; (lines=%d, args=0, vars=%d, tmps=%d)
; (after optimizer)
; %s
0000 INIT_FCALL 2 %d string("range")
0001 SEND_VAL int(1) 1
0002 SEND_VAL int(10) 2
0003 V1 = DO_ICALL
0004 ASSIGN CV0($array) V1
0005 TYPE_ASSERT 131079 string("array_map") CV0($array)
0006 T1 = INIT_ARRAY 0 NEXT
0007 V2 = FE_RESET_R CV0($array) 0014
0008 T4 = FE_FETCH_R V2 T3 0014
0009 INIT_FCALL 1 %d string("stdclass")
0010 SEND_VAL T3 1
0011 V3 = DO_UCALL
0012 T1 = ADD_ARRAY_ELEMENT V3 T4
0013 JMP 0008
0014 FE_FREE V2
0015 FREE T1
0016 RETURN int(1)
LIVE RANGES:
1: 0007 - 0015 (tmp/var)
2: 0008 - 0014 (loop)
3: 0009 - 0010 (tmp/var)
4: 0009 - 0012 (tmp/var)
stdClass:
; (lines=3, args=0, vars=0, tmps=1)
; (after optimizer)
; %s
0000 V0 = NEW 0 string("stdClass")
0001 DO_FCALL
0002 RETURN V0
LIVE RANGES:
0: 0001 - 0002 (new)