rfc:hashkey
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:hashkey [2014/10/22 17:49] – krakjoe | rfc:hashkey [2014/10/22 17:57] – krakjoe | ||
---|---|---|---|
Line 42: | Line 42: | ||
]; | ]; | ||
</ | </ | ||
+ | |||
+ | Returning a non-scalar shall fail as it did before: | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | class Foo { | ||
+ | public function __toKey() { | ||
+ | return []; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $foo = new Foo(); | ||
+ | $test = [ | ||
+ | $foo => true | ||
+ | ]; | ||
+ | </ | ||
+ | |||
+ | Shall yield: | ||
+ | |||
+ | <code php> | ||
+ | Warning: Illegal offset type in %s on line %d | ||
+ | </ | ||
+ | |||
+ | The current behaviour of __toString is unchanged. | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== |
rfc/hashkey.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1