Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63232 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45754 invoked from network); 24 Sep 2012 18:10:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2012 18:10:33 -0000 Authentication-Results: pb1.pair.com header.from=moshe@kemmart.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=moshe@kemmart.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kemmart.com from 209.85.223.170 cause and error) X-PHP-List-Original-Sender: moshe@kemmart.com X-Host-Fingerprint: 209.85.223.170 mail-ie0-f170.google.com Received: from [209.85.223.170] ([209.85.223.170:45983] helo=mail-ie0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/F4-17579-812A0605 for ; Mon, 24 Sep 2012 14:10:33 -0400 Received: by iebc12 with SMTP id c12so11687389ieb.29 for ; Mon, 24 Sep 2012 11:10:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=EC/4KD6Hg3Lhd5QdFKC+vX5uQsjIJZH2NwpeLJjp3ss=; b=SLfsjiq1GYXvch5NBb8SAFIksDYwo2GVDw8uK4kFuSQuOmUjIBu2v6iZcPch2IAL5C ciN6NpYQ7HGNj0jdRhY5gCVZFhnvtzjKCP9k8cpkow85IZcXmHaNtJNqI/WgeX1xFkt5 KbH6dYlHNwVBn4wZ6Dy6Ua4O5FpP0WnVD93vUGzkAc2IXwIKjOVJOpDmVss2HFB631Uu sRCO6YtPvtUv8tgV/Jv2ZnWYGEOe1HpPDAeEg6vZlTA1k4EpJuQnMA2fJcLOrnLlDL5z Mp6PJxD3BYprMycAnQ8Ez4Y6obc4i8c2+rHSiFaR2RNDGAM2TT1jpO9XKu8Jb6hmj3qi ZxMg== MIME-Version: 1.0 Received: by 10.43.46.194 with SMTP id up2mr10313815icb.22.1348510230034; Mon, 24 Sep 2012 11:10:30 -0700 (PDT) Received: by 10.64.176.170 with HTTP; Mon, 24 Sep 2012 11:10:29 -0700 (PDT) X-Originating-IP: [12.40.36.214] In-Reply-To: <5060A0C9.70700@ajf.me> References: <502020FB.7010502@hoa-project.net> <5060711A.2030704@hoa-project.net> <5060A0C9.70700@ajf.me> Date: Mon, 24 Sep 2012 13:10:29 -0500 Message-ID: To: Andrew Faulds Cc: ivan.enderlin@hoa-project.net, internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec529955d3cb88204ca7681ce X-Gm-Message-State: ALoCoQkx0vUi4UsxzMviTEgHvI8Znqp/SRLSLQwjHyMRDNIJ5FBUNAmyWXDiUI9JbD9xqQlQhUVS Subject: Re: [PHP-DEV] mbstring, a proposition of additional functions From: moshe@kemmart.com (Moshe Samuel) --bcaec529955d3cb88204ca7681ce Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It would be nice, especially if "Hello"->replace("ll","xx") could work regular expressions. On Mon, Sep 24, 2012 at 1:04 PM, Andrew Faulds wrote: > On 24/09/12 15:41, Ivan Enderlin @ Hoa wrote: > >> Recently, I crafted a String object that support most of the proposition= s >> written here. Please, see https://github.com/hoaproject/**String(file String.php). The code is very simple (i= t implies that it do not need >> a lot of work to implement it in PHP I hope). Some interesting methods: >> =E2=80=A2 append; >> =E2=80=A2 prepend; >> =E2=80=A2 pad; >> =E2=80=A2 getIterator (equivalent of str_split); >> =E2=80=A2 \ArrayAccess methods (with support of out-of-bound indexes= ); >> =E2=80=A2 getByteAt (with support of out-of-bound indexes); >> =E2=80=A2 getCharDirection; >> =E2=80=A2 fromCode; >> =E2=80=A2 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 > > --bcaec529955d3cb88204ca7681ce--