php/class-wp-cli.php
public static function print_value( $value, $assoc_args = array() ) {
		if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) {
			$value = json_encode( $value );
		} elseif ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'yaml' ) {
			$value = Spyc::YAMLDump( $value, 2, 0 );
		} elseif ( is_array( $value ) || is_object( $value ) ) {
			$value = var_export( $value, true );
		}

		echo $value . "\n";
	}
public static function print_value( $value, $assoc_args = array() ) {
		if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) {
			$value = json_encode( $value );
		} elseif ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) === 'yaml' ) {
			$value = Spyc::YAMLDump( $value, 2, 0 );
		} elseif ( is_array( $value ) || is_object( $value ) ) {
			$value = var_export( $value, true );
		}

		echo $value . "\n";
	}
public static function print_value ( $ value , $ assoc_args = array ( ) ) { if ( \ WP_CLI \ Utils \ get_flag_value ( $ assoc_args , 'format' ) === 'json' ) { $ value = json_encode ( $ value ) ; } elseif ( \ WP_CLI \ Utils \ get_flag_value ( $ assoc_args , 'format' ) === 'yaml' ) { $ value = Spyc :: YAMLDump ( $ value , 2 , 0 ) ; } elseif ( is_array ( $ value ) || is_object ( $ value ) ) { $ value = var_export ( $ value , true ) ; } echo $ value . "\n" ; }
Display a value, in various formats

@param mixed $value Value to display.
@param array $assoc_args Arguments passed to the command, determining format.
Display a value in various formats