show_source()
show_source() — Alias of highlight_file().
Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
show_source() is an alias of highlight_file(): same parameters, same return value.
Signature
show_source(string $filename, bool $return = false): string|bool
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $filename | string | Path to the PHP file to be highlighted. |
| $return | bool | Set this parameter to true to make this function return the highlighted code. |
Return value
If return is set to true, returns the highlighted code as a string instead of printing it out. Otherwise, it will return true on success, false on failure.
Example
The PHP manual ships no example for show_source(); the signature and the parameter table above are the contract.
All PHP 8.5 built-in functions
Reference card built from the PHP manual page show_source() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.