Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3943870
D2491.id6278.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
904 B
Referenced Files
None
Subscribers
None
D2491.id6278.diff
View Options
diff --git a/src/Collections/OmniArray.php b/src/Collections/OmniArray.php
--- a/src/Collections/OmniArray.php
+++ b/src/Collections/OmniArray.php
@@ -16,7 +16,7 @@
/// Constructors
///
- public function __construct (?iterable $items) {
+ public function __construct (?iterable $items = null) {
if ($items === null) {
return;
}
diff --git a/tests/Strings/Multibyte/OmniStringTest.php b/tests/Strings/Multibyte/OmniStringTest.php
--- a/tests/Strings/Multibyte/OmniStringTest.php
+++ b/tests/Strings/Multibyte/OmniStringTest.php
@@ -78,6 +78,13 @@
$this->assertEquals($exploded, $actual);
}
+ public function testExplodeWithEmptyOmniArray () : void {
+ $array = (new OmniString("foo"))
+ ->explode("", -1);
+
+ $this->assertEquals(0, count($array->toArray()));
+ }
+
///
/// Data providers
///
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 13:10 (12 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2315364
Default Alt Text
D2491.id6278.diff (904 B)
Attached To
Mode
D2491: Allow to create empty OmniArray
Attached
Detach File
Event Timeline
Log In to Comment