macro_rules! php_output {
($data: expr) => { ... };
}Expand description
Writes binary data to PHP’s output stream with output buffering support.
This macro is both binary-safe (can handle NUL bytes) AND respects PHP’s
output buffering (ob_start()). Use this when you need both capabilities.
§Arguments
$data- A byte slice (&[u8]) or byte literal (b"...") to write.
§Returns
The number of bytes written.
§Comparison
| Macro | Binary-safe | Output Buffering |
|---|---|---|
php_print! | No | Yes |
php_write! | Yes | No (unbuffered) |
php_output! | Yes | Yes |
§Examples
ⓘ
use ext_php_rs::php_output;
// Write binary data that will be captured by ob_start()
php_output!(b"Hello\x00World");
// Use with output buffering
// ob_start();
// php_output!(b"captured");
// $data = ob_get_clean(); // Contains "captured"