Skip to content

Commit 9165bec

Browse files
committed
Fix
1 parent 5b3fc4d commit 9165bec

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

allowed_bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ bind! {
231231
_ZEND_TYPE_NULLABLE_BIT,
232232
ts_rsrc_id,
233233
_ZEND_TYPE_NAME_BIT,
234-
_ZEND_TYPE_NAME_LITERAL_BIT,
234+
_ZEND_TYPE_LITERAL_NAME_BIT,
235235
ZEND_INTERNAL_FUNCTION,
236236
ZEND_USER_FUNCTION,
237237
ZEND_EVAL_CODE,

src/zend/_type.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{ffi::c_void, ptr};
33
use crate::{
44
ffi::{
55
zend_type, IS_MIXED, MAY_BE_ANY, MAY_BE_BOOL, _IS_BOOL, _ZEND_IS_VARIADIC_BIT,
6-
_ZEND_SEND_MODE_SHIFT, _ZEND_TYPE_NAME_BIT, _ZEND_TYPE_NULLABLE_BIT,
6+
_ZEND_SEND_MODE_SHIFT, _ZEND_TYPE_NULLABLE_BIT,
77
},
88
flags::DataType,
99
};
@@ -79,10 +79,10 @@ impl ZendType {
7979
allow_null: bool,
8080
) -> Option<Self> {
8181
cfg_if::cfg_if! {
82-
if #[cfg(any(php80,php81,php82))] {
82+
if #[cfg(php83)] {
8383
Some(Self {
84-
ptr: crate::types::ZendStr::new(class_name, true).into_raw().as_ptr() as *mut c_void,
85-
type_mask: _ZEND_TYPE_NAME_BIT
84+
ptr: std::ffi::CString::new(class_name).ok()?.into_raw() as *mut c_void,
85+
type_mask: crate::ffi::_ZEND_TYPE_LITERAL_NAME_BIT
8686
| (if allow_null {
8787
_ZEND_TYPE_NULLABLE_BIT
8888
} else {
@@ -92,8 +92,8 @@ impl ZendType {
9292
})
9393
} else {
9494
Some(Self {
95-
ptr: std::ffi::CString::new(class_name).ok()?.into_raw() as *mut c_void,
96-
type_mask: _ZEND_TYPE_NAME_BIT
95+
ptr: crate::types::ZendStr::new(class_name, true).into_raw().as_ptr() as *mut c_void,
96+
type_mask: crate::ffi::_ZEND_TYPE_NAME_BIT
9797
| (if allow_null {
9898
_ZEND_TYPE_NULLABLE_BIT
9999
} else {

0 commit comments

Comments
 (0)