Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14244193
D9934.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1000 B
Referenced Files
None
Subscribers
None
D9934.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9934: Minor changes to `phutil_var_export`
Attached
Detach File
Event Timeline
Log In to Comment