This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_Translation_File_PHP::var_export( mixed $value )

Outputs or returns a parsable string representation of a variable.


Description

Like var_export() but "minified", using short array syntax and no newlines.


Parameters

$value

(mixed) (Required) The variable you want to export.


Return

(string) The variable representation.


Source

File: wp-includes/l10n/class-wp-translation-file-php.php

	private function var_export( $value ): string {
		if ( ! is_array( $value ) ) {
			return var_export( $value, true );
		}

		$entries = array();

		$is_list = array_is_list( $value );

		foreach ( $value as $key => $val ) {
			$entries[] = $is_list ? $this->var_export( $val ) : var_export( $key, true ) . '=>' . $this->var_export( $val );
		}

		return '[' . implode( ',', $entries ) . ']';
	}


Changelog

Changelog
Version Description
6.5.0 Introduced.