diff --git a/src/Dibi/HashMap.php b/src/Dibi/HashMap.php index eef445f1..bdf1b693 100644 --- a/src/Dibi/HashMap.php +++ b/src/Dibi/HashMap.php @@ -58,7 +58,7 @@ final class HashMap extends HashMapBase { if ($nm == '') { $nm = "\xFF"; - return $this->$nm = $this->$nm ?? $this->getCallback()(''); + return isset($this->$nm) ? $this->$nm : $this->$nm = $this->getCallback()(''); } else { return $this->$nm = $this->getCallback()($nm); } diff --git a/tests/dibi/HashMap.phpt b/tests/dibi/HashMap.phpt new file mode 100644 index 00000000..f14cfc1e --- /dev/null +++ b/tests/dibi/HashMap.phpt @@ -0,0 +1,14 @@ +{'X'}); +Assert::same('b--e', $hash->{''});