File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,14 @@ PHP 8.1 INTERNALS UPGRADE NOTES
3
3
1. Internal API changes
4
4
a. Removed Zend APIs
5
5
b. Zend Stream API
6
+ c. zend_get_opcode_id()
6
7
7
8
2. Build system changes
8
9
9
10
3. Module changes
10
11
a. ext/hash
12
+ b. ext/pdo
13
+ c. ext/standard
11
14
12
15
========================
13
16
1. Internal API changes
@@ -31,6 +34,7 @@ PHP 8.1 INTERNALS UPGRADE NOTES
31
34
the same function where they were created by zend_stream_init_*()). Previously there were two different
32
35
destructors zend_destroy_file_handle() and zend_file_handle_dtor().
33
36
- zend_ini_scanner_globals.filename now is zend_string*
37
+ c. Added the zend_get_opcode_id() function, which is intended to get opcode id from name.
34
38
35
39
========================
36
40
2. Build system changes
Original file line number Diff line number Diff line change @@ -442,3 +442,12 @@ ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {
442
442
}
443
443
return zend_vm_opcodes_flags [opcode ];
444
444
}
445
+ ZEND_API zend_uchar zend_get_opcode_id (const char * name , size_t length ) {
446
+ zend_uchar opcode ;
447
+ for (opcode = 0 ; opcode < (sizeof (zend_vm_opcodes_names ) / sizeof (zend_vm_opcodes_names [0 ])) - 1 ; opcode ++ ) {
448
+ if (strncmp (zend_vm_opcodes_names [opcode ], name , length ) == 0 ) {
449
+ return opcode ;
450
+ }
451
+ }
452
+ return ZEND_VM_LAST_OPCODE + 1 ;
453
+ }
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ BEGIN_EXTERN_C()
79
79
80
80
ZEND_API const char * ZEND_FASTCALL zend_get_opcode_name (zend_uchar opcode );
81
81
ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags (zend_uchar opcode );
82
+ ZEND_API zend_uchar zend_get_opcode_id (const char * name , size_t length );
82
83
83
84
END_EXTERN_C ()
84
85
You can’t perform that action at this time.
0 commit comments