Page MenuHomeDevCentral

D2491.id6278.diff
No OneTemporary

D2491.id6278.diff

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

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)

Event Timeline