On 24/09/12 15:41, Ivan Enderlin @ Hoa wrote:
Recently, I crafted a String object that support most of the propositions written here. Please, see https://github.com/hoaproject/String (file String.php). The code is very simple (it implies that it do not need a lot of work to implement it in PHP I hope). Some interesting methods:
    • append;
    • prepend;
    • pad;
    • getIterator (equivalent of str_split);
    • \ArrayAccess methods (with support of out-of-bound indexes);
    • getByteAt (with support of out-of-bound indexes);
    • getCharDirection;
    • fromCode;
    • toCode.

I would love such a library to be built into PHP. A more consistent approach to scalar operations would be great. "hello, world"->replace('world', 'php'); would be so much nicer than str_replace and forgetting the argument order. This is a little off-topic, though.

--
Andrew Faulds
http://ajf.me/


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to