pub fn get_property<'a, T>(&'a self, name: &str) -> Result<T>
    where
        T: FromZval<'a>,
    {
        if !self.has_property(name, PropertyQuery::Exists)? {
            return Err(Error::InvalidProperty);
        }

        let mut name = ZendStr::new(name, false);
        let mut rv = Zval::new();

        let zv = unsafe {
            self.handlers()?.read_property.ok_or(Error::InvalidScope)?(
                self.mut_ptr(),
                &mut *name,
                1,
                std::ptr::null_mut(),
                &mut rv,
            )
            .as_ref()
        }
        .ok_or(Error::InvalidScope)?;

        T::from_zval(zv).ok_or_else(|| Error::ZvalConversion(zv.get_type()))
    }
Attempts to read a property from the Object. Returns a result containing
the value of the property if it exists and can be read, and an
[`Error`] otherwise.

# Parameters

* `name` - The name of the property.
* `query` - The type of query to use when attempting to get a property.

# Errors

* `Error::InvalidScope` - If the object handlers or the properties
cannot be retrieved.
src/types/object.rs