Hi,
PHP strings are allowed to contain null bytes, but the current implementation of ZendStr doesn't allow it.
#[php_function]
pub fn class_name_of(obj: &ZendObject) -> String {
obj.get_class_name().unwrap()
}
<?php
var_dump(class_name_of(new class {}));
Expected result:
string(%d) "class@anonymous/path/to/file.php:3$0"
// or, with XDebug enabled:
string(%d) "class@anonymous\000/path/to/file.php:3$0"
Actual result:
PHP Fatal error: Uncaught Exception: String given contains NUL-bytes which cannot be present in a C string. [...]