Page MenuHomePhabricator

D9934.id.diff
No OneTemporary

D9934.id.diff

diff --git a/src/utils/__tests__/PhutilUtilsTestCase.php b/src/utils/__tests__/PhutilUtilsTestCase.php
--- a/src/utils/__tests__/PhutilUtilsTestCase.php
+++ b/src/utils/__tests__/PhutilUtilsTestCase.php
@@ -569,6 +569,7 @@
$this->assertEqual(
'array()',
phutil_var_export(array()));
+
$this->assertEqual(
implode("\n", array(
'array(',
@@ -578,6 +579,7 @@
')',
)),
phutil_var_export(array(1, 2, 3)));
+
$this->assertEqual(
implode("\n", array(
'array(',
diff --git a/src/utils/utils.php b/src/utils/utils.php
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -1081,10 +1081,9 @@
*/
function phutil_var_export($var) {
$regex = array(
- '/\s+$/m' => '',
- "/=>\n\s+/" => '=> ',
+ "/=>\s*\n\s+/" => '=> ',
"/array\s*\(\n\s*\)/" => 'array()',
- '/array \(/' => 'array(',
+ '/array\s+\(/' => 'array(',
);
$var = var_export($var, true);

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 23, 7:40 AM (4 w, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6743798
Default Alt Text
D9934.id.diff (1000 B)

Event Timeline