diff --git a/core/includes/common.inc b/core/includes/common.inc index ff70536..3a7fb16 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -5029,10 +5029,11 @@ function _drupal_flush_css_js() { * Label to prefix the data. * @param $print_r * Flag to switch between print_r() and var_export() for data conversion to - * string. Set $print_r to TRUE when dealing with a recursive data structure - * as var_export() will generate an error. + * string. Set $print_r to FALSE to use var_export() instead of print_r(). + * Passing recursive data structures to var_export() will generate an error. */ -function debug($data, $label = NULL, $print_r = FALSE) { +function debug($data, $label = NULL, $print_r = TRUE) { + // Print $data contents to string. $string = String::checkPlain($print_r ? print_r($data, TRUE) : var_export($data, TRUE)); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php index 2a19a5c1..f811fe6 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php @@ -195,7 +195,7 @@ function stubTest() { // Generates a warning inside a PHP function. array_key_exists(NULL, NULL); - debug('Foo', 'Debug'); + debug('Foo', 'Debug', FALSE); } /**