projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some php errors.
[platal.git]
/
classes
/
pldict.php
diff --git
a/classes/pldict.php
b/classes/pldict.php
index
6000ab3
..
21a911b
100644
(file)
--- a/
classes/pldict.php
+++ b/
classes/pldict.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-79,8
+79,8
@@
class PlDict
public function i($key, $default = 0)
{
public function i($key, $default = 0)
{
- $i =
$this->_get($key, $default
);
- return
ctype_digit($i) ? intval($i) : $default
;
+ $i =
to_integer($this->_get($key, $default)
);
+ return
$i === false ? $default : $i
;
}
public function l(array $keys)
}
public function l(array $keys)
@@
-92,6
+92,16
@@
class PlDict
{
return $this->array;
}
{
return $this->array;
}
+
+ public function count()
+ {
+ return count($this->array);
+ }
+
+ public function merge(array $array)
+ {
+ $this->array = array_merge($this->array, $array);
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: