Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78192 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18133 invoked from network); 21 Oct 2014 10:13:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2014 10:13:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.212.169 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:51357] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/43-02077-9C136445 for ; Tue, 21 Oct 2014 06:13:29 -0400 Received: by mail-wi0-f169.google.com with SMTP id r20so1467403wiv.2 for ; Tue, 21 Oct 2014 03:13:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=DJzrGat2mMzfSiXoYf2Wz9i7c1f2VXV4upu/ELz0sGc=; b=Qv0LdIlco1ggAfM6sX4cNCaO6rzL39sr75I8PL0yR5eWpYt1vDEfC2qSCwqHEBwBRY Y3/k33VGzzGW5JD8keUujGsVcOHzuqi+4yfmRYtnDwQitarrl8xw/IQQNHr7D2wyvrqs 8waSpdz24/yZmXRf4tBjWwbgL7oLwdqX+aC5+g+T8bgBObgnBsvQQ/cnOySm/jDEPX4q EK+yADgztYPAbtPOrhG5MIpo01w5TQQJy+d7sLA/lGxIxac8mqhPzj1+JnQjlzpevlRL dRyvxOrW0Kcwalv7ZtTZovtpmCB8IQrU0bAqV0bEwnWCs8+TeQP+LA9IFpg7bFj1WM7p n+zg== X-Gm-Message-State: ALoCoQmORq0rrKGPZBYNTncRRN9iKfrnEvLpwvJKx7mA1/7S55COFRYUYr2LELWdymn/glgvkH3w X-Received: by 10.194.158.4 with SMTP id wq4mr28732549wjb.58.1413886404058; Tue, 21 Oct 2014 03:13:24 -0700 (PDT) Received: from [192.168.1.67] (host86-159-154-179.range86-159.btcentralplus.com. [86.159.154.179]) by mx.google.com with ESMTPSA id dg3sm10862774wib.14.2014.10.21.03.13.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 21 Oct 2014 03:13:23 -0700 (PDT) Message-ID: <1413886401.2624.33.camel@localhost.localdomain> To: Dmitry Stogov Cc: PHP Internals Date: Tue, 21 Oct 2014 11:13:21 +0100 In-Reply-To: References: <1413875212.2624.3.camel@localhost.localdomain> <1413883549.2624.22.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] UString From: pthreads@pthreads.org (Joe Watkins) On Tue, 2014-10-21 at 13:52 +0400, Dmitry Stogov wrote: > > > On Tue, Oct 21, 2014 at 1:25 PM, Joe Watkins > wrote: > On Tue, 2014-10-21 at 13:01 +0400, Dmitry Stogov wrote: > > Hi Joe, > > > > > > As an extension it looks fine. > > > > I assume, you don't propose to use UString objects in engine > and other > > extensions. > > I'm not proposing it now, no. > > > Unfortunately, it's yet another incomplete solution. > > > > It won't allow Unicode strings as array keys; > > The engine doesn't allow that, couldn't we find a way of using > objects > as array keys ?? It doesn't seem like a limitation of the > extension, to > me ;) > > > concatenation using "." (probably may be done), > > That's already done. > > > no auto-conversion from/to script/output encoding, > > That could be arranged. > > > no auto-conversion of strings coming from database > extensions, etc > > I'm not sure how important that is, it's not a big deal to > create a new > object, nor would it be a big deal for those extensions that > need to > always return unicode strings to do so. > > > > The "right" approach, would be extending zend_string with > "encoding" > > and then adopting near all functions working with > zend_string to take > > "encoding" into account. But, of course, this is going to > lead to much > > more complicated solution (with some slowdown). > > That seems a lot like bashing our head against a wall. We > tried to > introduce support everywhere and it fails. Do we really want > to step on > the performance gains introduced by recent changes by making > all strings > unicode ? > > > Yeah :) You must like punishment :D > > I'm not sure, if it should be done, and I don't like to work on it in > the nearest future, but zend_string approach should be easier to > implement than separate IS_UNICODE + IS_STRING + IS_BINARY types in > PHP6. > The implementation might be simpler, but the effect the same I think. I can be wrong, but nothing has so drastically changed that will allow us to absorb the kind of impact I think you are talking about. > > > That doesn't seem like a sensible thing to want, at least > right now. > > Having UString doesn't stop us approaching the problem > differently in > the future, but it would have to be a very different future to > even make > sense to me. > > > Agree. > > > > > If we don't care about complete solution, UString proposal > may make > > sense at lest as a faster replacement of ext/mbstring. > > As the RFC states, we are only approaching one problem, the > problem that > ext/mbstring is not a good API. > > > Then, it's fine. > > One note regarding implementation: why do you use C++ for ustring.cpp? > I understand it's necessary for ICU backend, but if in the future you > might switch to another backend (and it may not require C++) why to > use C++ for PHP extension part? Totally possible that we'll have to change, or that we should change. A few people have said they would like to write a backend so we'll see what comes in and where that leads us. > > Thanks. Dmitry. > > > > > > Thanks. Dmitry. > > > > On Tue, Oct 21, 2014 at 11:06 AM, Joe Watkins > > > wrote: > > Morning internalz, > > > > https://wiki.php.net/rfc/ustring > > > > This is the result of work done by a few of > us, we > > won't be opening any > > vote in a fortnight. We have a long time before 7, > there is no > > rush > > whatever. > > > > Now seems like a good time to start the > conversation > > so we can hash out > > the details, or get on with other things ;) > > > > Cheers > > Joe > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > Cheers > Joe Cheers Joe