Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14504 invoked from network); 21 Oct 2014 09:52:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2014 09:52:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.218.42 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.218.42 mail-oi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:63116] helo=mail-oi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/92-02077-5DC26445 for ; Tue, 21 Oct 2014 05:52:22 -0400 Received: by mail-oi0-f42.google.com with SMTP id a141so668115oig.1 for ; Tue, 21 Oct 2014 02:52:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9grCTWzQvDnRVXXB2GM7r00Fyn3/HxkksXMaLtLvjX0=; b=OnlRMzfiERh2B/rXOf1HdC0h97OjczzBYe3CahYXzBy2yOfnJ2mj5zOdsrxQ1pAqBY faWs49dEW67fqr4KE+ElmDIKXUyrf6KbrvP5u+6dPd6diXZSnwCZmKJNnXbLZVsK0bSa 0YLgLqDLtUv31DY5XF9noonbszJG1+U/J89vhIPjwdTEpR43c0+APly92xd4UBF/7AZX kmWDEmBSjyZZnJ6FeqzemiZ6gk15pgD3uIqD5iguCXmMVLGvREp+AON3/BwcvYe44N6U OTWu8rn9Mvgds8SRGlg5/2BnK1oeEoBw/8HY/hiapt+gIP3lAhkUlUkiNQurvQ+fYatC 1kYg== X-Gm-Message-State: ALoCoQkYt7WCbNId0UKQjDX0CJB7C1X5GeMhHNNg4ClWU8x6LaEsM48LmLmqUYc+nIBDQK8KN0cvJ/pwvWzcJEnAJdeqQ4dVJwECMUzciNmMoSQAJLFzPL4/oBKnqDjk1xxU0rEUFszVuHZnoSxk327lGEVOLkAPmQ== MIME-Version: 1.0 X-Received: by 10.60.67.233 with SMTP id q9mr28709338oet.30.1413885139140; Tue, 21 Oct 2014 02:52:19 -0700 (PDT) Received: by 10.60.70.41 with HTTP; Tue, 21 Oct 2014 02:52:19 -0700 (PDT) In-Reply-To: <1413883549.2624.22.camel@localhost.localdomain> References: <1413875212.2624.3.camel@localhost.localdomain> <1413883549.2624.22.camel@localhost.localdomain> Date: Tue, 21 Oct 2014 13:52:19 +0400 Message-ID: To: Joe Watkins Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c30fbc78e8c60505ebc9aa Subject: Re: [PHP-DEV] [RFC] UString From: dmitry@zend.com (Dmitry Stogov) --001a11c30fbc78e8c60505ebc9aa Content-Type: text/plain; charset=UTF-8 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 :) 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. > 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? 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 > > --001a11c30fbc78e8c60505ebc9aa--