Skip to content

Zval::null() to get a null in one call #477

@kakserpom

Description

@kakserpom

I wrote this trait some time ago:

pub trait ZvalNull {
    /// Returns a new `Zval` explicitly set to `null`.
    fn null() -> Zval;
}

impl ZvalNull for Zval {
    fn null() -> Zval {
        let mut zval = Zval::new();
        zval.set_null();
        zval
    }
}

What do you guys think about adding such method to impl Zval?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions