aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-07-15 07:33:28 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-07-15 08:27:17 +0200
commitc6b0c9f794dc53732ea1095f9284c73c955040a1 (patch)
tree77ed8cf882983c845c932dc6c1db61c9f7bf19f6
parentfc8358d430575a1d2d5d9a08e53b82aed8bed4a0 (diff)
downloadUstring-c6b0c9f794dc53732ea1095f9284c73c955040a1.zip
Ustring-c6b0c9f794dc53732ea1095f9284c73c955040a1.tar.gz
Ustring-c6b0c9f794dc53732ea1095f9284c73c955040a1.tar.bz2
Update API documentation & enforce match() method.
-rw-r--r--String.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/String.php b/String.php
index 3a0c222..3dfb729 100644
--- a/String.php
+++ b/String.php
@@ -243,12 +243,12 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
* if equal.
*
* @access public
- * @param string $string String.
+ * @param mixed $string String.
* @return int
*/
public function compareTo ( $string ) {
- return strcmp($this->_string, $string . '');
+ return strcmp($this->_string, (string) $string);
}
/**
@@ -293,8 +293,7 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
if(true === $global)
$flags = PREG_PATTERN_ORDER;
- if(0 < $offset)
- $offset = strlen(mb_substr($this->_string, 0, $offset));
+ $offset = strlen(mb_substr($this->_string, 0, $offset));
if(true === $global)
return preg_match_all(