A boolean. Not much else to say here.

T parameter&T parameterT Return type&T Return typePHP representation
YesNoYesNoUnion flag

Booleans are not actually stored inside the zval. Instead, they are treated as two different union types (the zval can be in a true or false state). An equivalent structure in Rust would look like:

enum Zval {
    String(&mut ZendString),
    // ...

Rust example

#![cfg_attr(windows, feature(abi_vectorcall))]
extern crate ext_php_rs;
use ext_php_rs::prelude::*;
pub fn test_bool(input: bool) -> String {
    if input {
    } else {
fn main() {}

PHP example


var_dump(test_bool(true)); // string(4) "Yes!"
var_dump(test_bool(false)); // string(3) "No!"