It should probably be mentioned in the array part, but if you scroll down to the 'Variable and type handling', you'll find something: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators
you probably found your way around with this. But just in case, did you know that you can add your own functions via your own extension? Look at the http://projects.ez.no/jacextension/downloads tutorial for how to do this. A nice real-world example of doing so is the extension called Swark, which you can find here: http://ez.no/developer/contribs/template_plugins/swark (eZ Publish 3.x) and here: http://ez.no/developer/contribs/template_plugins/swark_for_ez_publish_4 (eZ Publish 4.x)
You can add support of the <i>count</i> PHP function as a template operator. You can do that by overriding the template.ini config file. You can embed as many PHP native functions as you want, as long as they accept only one argument.
Maybe I am missing something here, and I appreciate the additional insight given by comments about registering your own template operators, but is this not enough?