PHPize Online / SQLize Online

Articles    Popular

var_export

Tags: PHP 5.x PHP 7.x PHP 8.x

var_export — Outputs or returns a parsable string representation of a variable

Description

var_export(
    mixed $value, 
    bool $return = false
): string|null
var_export() gets structured information about the given variable. It is similar to var_dump() with one exception: the returned representation is valid PHP code.

Parameters

value
The variable you want to export.
return
If used and set to true, var_export() will return the variable representation instead of outputting it.

Return Values

Returns the variable representation when the return parameter is used and evaluates to true. Otherwise, this function will return null.

var_export - New snippets