anewt-developers team mailing list archive
-
anewt-developers team
-
Mailing list archive
-
Message #00222
[Branch ~uws/anewt/anewt.uws] Rev 1760: [core] Accept integer keys in array_unset_key()
------------------------------------------------------------
revno: 1760
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Tue 2010-02-16 21:32:26 +0100
message:
[core] Accept integer keys in array_unset_key()
The assertion was just too strict; there is no reason not to
support this.
modified:
core/array.lib.php
--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws
Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'core/array.lib.php'
--- core/array.lib.php 2010-02-16 20:28:22 +0000
+++ core/array.lib.php 2010-02-16 20:32:26 +0000
@@ -239,7 +239,7 @@
function array_unset_key(&$arr, $key)
{
assert('is_array($arr)');
- assert('is_string($key)');
+ assert('is_int($key) || is_string($key)');
if (array_key_exists($key, $arr))
unset($arr[$key]);