Page MenuHomePhabricator

D9934.diff
No OneTemporary

D9934.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
Sat, Dec 14, 3:00 AM (21 h, 7 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6879169
Default Alt Text
D9934.diff (1000 B)

Event Timeline