You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I newbie in php, and i have a problem with Ds\Map()
If I use a reference as a key or I use variable with a reference as a key Ds\Map cannot found my value.
Reproduce code:
<?php
$map = new Ds\Map();
$str = "test_key";
$str_ref = &$str; // comment uncomment this
$map[$str] = "stored"; // try $str_ref too
if ($map->hasKey($str)) { // try $str_ref too
echo "found";
} else {
echo "not found";
}
Version info:
Linux home-desktop 4.10.13-1-ARCH #1 SMP PREEMPT Thu Apr 27 12:15:09 CEST 2017 x86_64 GNU/Linux
PHP 7.1.5 (cli) (built: May 9 2017 16:55:02) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans
The text was updated successfully, but these errors were encountered:
Hi!
I newbie in php, and i have a problem with Ds\Map()
If I use a reference as a key or I use variable with a reference as a key Ds\Map cannot found my value.
Reproduce code:
Version info:
The text was updated successfully, but these errors were encountered: