#[repr(C)]
pub struct _zval_struct { pub value: zend_value, pub u1: _zval_struct__bindgen_ty_1, pub u2: _zval_struct__bindgen_ty_2, }

Fields§

§value: zend_value§u1: _zval_struct__bindgen_ty_1§u2: _zval_struct__bindgen_ty_2

Implementations§

Creates a new, empty zval.

Returns the value of the zval if it is a long.

Returns the value of the zval if it is a bool.

Returns the value of the zval if it is a double.

Returns the value of the zval as a zend string, if it is a string.

Note that this functions output will not be the same as string(), as this function does not attempt to convert other types into a String.

Returns the value of the zval if it is a string.

If the zval does not contain a string, the function will check if it contains a double or a long, and if so it will convert the value to a String and return it. Don’t rely on this logic, as there is potential for this to change to match the output of the str() function.

Returns the value of the zval if it is a string.

Note that this functions output will not be the same as string(), as this function does not attempt to convert other types into a String, as it could not pass back a &str in those cases.

Returns the value of the zval if it is a string and can be unpacked into a vector of a given type. Similar to the unpack function in PHP, except you can only unpack one type.

Safety

There is no way to tell if the data stored in the string is actually of the given type. The results of this function can also differ from platform-to-platform due to the different representation of some types on different platforms. Consult the pack function documentation for more details.

Returns the value of the zval if it is a string and can be unpacked into a slice of a given type. Similar to the unpack function in PHP, except you can only unpack one type.

This function is similar to Zval::binary except that a slice is returned instead of a vector, meaning the contents of the string is not copied.

Safety

There is no way to tell if the data stored in the string is actually of the given type. The results of this function can also differ from platform-to-platform due to the different representation of some types on different platforms. Consult the pack function documentation for more details.

Returns the value of the zval if it is a resource.

Returns an immutable reference to the underlying zval hashtable if the zval contains an array.

Returns a mutable reference to the underlying zval hashtable if the zval contains an array.

Returns the value of the zval if it is an object.

Returns a mutable reference to the object contained in the Zval, if any.

Returns the value of the zval if it is a reference.

Returns a mutable reference to the underlying zval if it is a reference.

Returns the value of the zval if it is callable.

Returns the value of the zval if it is a pointer.

Safety

The caller must ensure that the pointer contained in the zval is in fact a pointer to an instance of T, as the zval has no way of defining the type of pointer.

Attempts to call the zval as a callable with a list of arguments to pass to the function. Note that a thrown exception inside the callable is not detectable, therefore you should check if the return value is valid rather than unwrapping. Returns a result containing the return value of the function, or an error.

You should not call this function directly, rather through the call_user_func macro.

Parameters
  • params - A list of parameters to call the function with.

Returns the type of the Zval.

Returns true if the zval is a long, false otherwise.

Returns true if the zval is null, false otherwise.

Returns true if the zval is true, false otherwise.

Returns true if the zval is false, false otherwise.

Returns true if the zval is a bool, false otherwise.

Returns true if the zval is a double, false otherwise.

Returns true if the zval is a string, false otherwise.

Returns true if the zval is a resource, false otherwise.

Returns true if the zval is an array, false otherwise.

Returns true if the zval is an object, false otherwise.

Returns true if the zval is a reference, false otherwise.

Returns true if the zval is callable, false otherwise.

Returns true if the zval contains a pointer, false otherwise.

Sets the value of the zval as a string. Returns nothing in a result when successful.

Parameters
  • val - The value to set the zval as.
  • persistent - Whether the string should persist between requests.

Sets the value of the zval as a Zend string.

Parameters
  • val - String content.

Sets the value of the zval as a binary string, which is represented in Rust as a vector.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as a interned string. Returns nothing in a result when successful.

Parameters
  • val - The value to set the zval as.
  • persistent - Whether the string should persist between requests.

Sets the value of the zval as a long.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as a double.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as a boolean.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as null.

This is the default of a zval.

Sets the value of the zval as a resource.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as a reference to an object.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as an array. Returns nothing in a result on success.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as an array. Returns nothing in a result on success.

Parameters
  • val - The value to set the zval as.

Sets the value of the zval as a pointer.

Parameters
  • ptr - The pointer to set the zval as.

Extracts some type from a Zval.

This is a wrapper function around TryFrom.

Creates a shallow clone of the Zval.

This copies the contents of the Zval, and increments the reference counter of the underlying value (if it is reference counted).

For example, if the zval contains a long, it will simply copy the value. However, if the zval contains an object, the new zval will point to the same object, and the objects reference counter will be incremented.

Returns

The cloned zval.

Trait Implementations§

Creates a value from an iterator. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.