Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12134 invoked from network); 25 Sep 2012 08:03:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2012 08:03:44 -0000 Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:57428] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/15-58640-F5561605 for ; Tue, 25 Sep 2012 04:03:43 -0400 Received: from Hwhost2.local (unknown [194.57.88.180]) by host1.trois-doubles.net (Postfix) with ESMTPA id 954B8200E8B for ; Tue, 25 Sep 2012 10:03:39 +0200 (CEST) Message-ID: <5061655B.5090706@hoa-project.net> Date: Tue, 25 Sep 2012 10:03:39 +0200 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/17.0 Thunderbird/17.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <502020FB.7010502@hoa-project.net> <5060711A.2030704@hoa-project.net> <5060A0C9.70700@ajf.me> In-Reply-To: <5060A0C9.70700@ajf.me> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] mbstring, a proposition of additional functions From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") On 24/09/12 20:04, Andrew Faulds wrote: > On 24/09/12 15:41, Ivan Enderlin @ Hoa wrote: >> Recently, I crafted a String object that support most of the=20 >> propositions written here. Please, see=20 >> https://github.com/hoaproject/String (file String.php). The code is=20 >> very simple (it implies that it do not need a lot of work to=20 >> implement it in PHP I hope). Some interesting methods: >> =95 append; >> =95 prepend; >> =95 pad; >> =95 getIterator (equivalent of str_split); >> =95 \ArrayAccess methods (with support of out-of-bound indexes); >> =95 getByteAt (with support of out-of-bound indexes); >> =95 getCharDirection; >> =95 fromCode; >> =95 toCode. >> > I would love such a library to be built into PHP. A more consistent=20 > approach to scalar operations would be great. "hello,=20 > world"->replace('world', 'php'); would be so much nicer than=20 > str_replace and forgetting the argument order. This is a little=20 > off-topic, though. Yup, it is off-topic. We can add new functions in one hand and=20 =93autoboxing=94 scalars into OOP style in another hand. --=20 Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/