Example 1 — Check Built-in Wrappers
Verify that file, php, and data wrappers are present.
<?php
$wrappers = stream_get_wrappers();
foreach (["file", "php", "data"] as $name) {
echo $name, ": ", in_array($name, $wrappers, true) ? "yes" : "no", PHP_EOL;
} How It Works
- stream_get_wrappers() loads the current wrapper list.
- We test three wrappers that almost every PHP build includes.
- in_array() prints yes when each name is found.
- These wrappers power ordinary files, php:// streams, and data:// URIs.

