Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3748023
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
Sun, Nov 17, 06:16 (3 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2248796
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