protected function endsWithDynamic($function, $needle)
    {
        $enc = $this->getEncoding();
        $strlen = $this->length($enc);
        $testlen = mb_strlen($needle, $enc);

        if ($testlen <= $strlen)
        {
            return ($function($this->toString(), $needle, ($strlen-$testlen), $enc)!==false);
        }
        return false;
    }
protected function endsWithDynamic($function, $needle)
    {
        $enc = $this->getEncoding();
        $strlen = $this->length($enc);
        $testlen = mb_strlen($needle, $enc);

        if ($testlen <= $strlen)
        {
            return ($function($this->toString(), $needle, ($strlen-$testlen), $enc)!==false);
        }
        return false;
    }
protected function endsWithDynamic ( $ function , $ needle ) { $ enc = $ this -> getEncoding ( ) ; $ strlen = $ this -> length ( $ enc ) ; $ testlen = mb_strlen ( $ needle , $ enc ) ; if ( $ testlen <= $ strlen ) { return ( $ function ( $ this -> toString ( ) , $ needle , ( $ strlen - $ testlen ) , $ enc ) !== false ) ; } return false ; }
Helper function for endsWith
@param string $function
@param string $needle
@return boolean
Helper function for endsWith