Function __global->_diff_simple

Definitions

sources/diff.php

  • Create a diff between two arrays of string-lines.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$old array No No required parameter N/A N/A First array
$new array No No required parameter N/A N/A Second array
$unified boolean No No required parameter N/A N/A Whether to show a unified diff
$include_unchanged boolean No No True N/A N/A Whether to include unchanged lines and trailing whitespace

Returns

  • Diff
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Create a diff between two arrays of string-lines.
 *
 * @param  array $old First array
 * @param  array $new Second array
 * @param  boolean $unified Whether to show a unified diff
 * @param  boolean $include_unchanged Whether to include unchanged lines and trailing whitespace
 * @return string Diff
 */

function _diff_simple(array $old, array $new, bool $unified, bool $include_unchanged = true) : string