Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76640 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28259 invoked from network); 18 Aug 2014 10:06:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2014 10:06:19 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.181 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.181 mail-vc0-f181.google.com Received: from [209.85.220.181] ([209.85.220.181:33423] helo=mail-vc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/F5-29636-810D1F35 for ; Mon, 18 Aug 2014 06:06:18 -0400 Received: by mail-vc0-f181.google.com with SMTP id lf12so5525557vcb.12 for ; Mon, 18 Aug 2014 03:06:13 -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=L2GHUBYibWKGsr8WqxVZ/123JlxUHCiyd70FcCSO9bo=; b=gsWPl6zw0ffNO/TuAzSxnlJ7nYozBuxiTHKjmNXYMiiVf/ZeHN0wp9jV2tMj0KPxxT jjQhA9CA8Cg3ChzLBUfmZUfkD/nAbF2lQ6p/PDrk/EI+PoOPhRapIlTGkfA6K9rfdncs RpUjjAcVKd62eb7dSL5roDQfoWoiZJOJG4F81u08OGhGUG11lUOnnN2I51evNOsh1Zl4 FUe/+gbwPdRuujF2ho72vnX11J8dquoMIwHND7Qco6s6XIAIOweZa0Oadn+8fYU5vHa3 3JqqkRN1RwmpIJSG+EWt5FXitZQmXMeHp4SqZZFOv9ZliHCh1fZZHVDd5vnYAE9ImGQ7 cwDQ== X-Gm-Message-State: ALoCoQmIbfoF5x+ortipYBVxHRnQpPCMg/60g3RZ1TsS55gk1QLm0lPEXQfDGMwY+s7Kys1d+d234KcRnrH6VgfdRD2vNTwi9MRnSuSjB1XkWAmpuyRnR+7BT9ZXuvnUHQXchPi6+Lf4 MIME-Version: 1.0 X-Received: by 10.220.166.68 with SMTP id l4mr5344357vcy.20.1408356373284; Mon, 18 Aug 2014 03:06:13 -0700 (PDT) Received: by 10.52.110.170 with HTTP; Mon, 18 Aug 2014 03:06:13 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Aug 2014 14:06:13 +0400 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b343a4c58e1390500e485fc Subject: Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree From: dmitry@zend.com (Dmitry Stogov) --047d7b343a4c58e1390500e485fc Content-Type: text/plain; charset=UTF-8 Magento doesn't work with AST patch. 500 response on home page, no crash. Other applications I tested seem to work. Thanks. Dmitry. On Mon, Aug 18, 2014 at 11:32 AM, Dmitry Stogov wrote: > Hi Nikita, > > I think RFC misses few important notes about behavior changes: > > 1) The behavior of $a->$b[$c] is changed. PHP apps that used such syntax > have to be changed into $a->{$b[$c]}. > > 2) The evaluation order of left and right parts of assignment is changed. > $a[$i++] = $a[$i++]; It wasn't guaranteed before, but it may break some > code anyway. > > 3) $a=[1,2]; list($a,$b) = $a; won't work in the same way as before > > 4) Usage of undefined constants now leads to fatal errors? (see > Zend/tests/use_const/no_global_fallback.php) > > 5) The patch also enables expressions on constant arrays e.g. > isset(arra(1,2,3)[$x]); > > Personally, I would prefer to separate syntax and behavior changes from > the AST patch itself or at least don't miss such changes, because they must > be very significant from users point of view. > > Also some implementation related notes: > > - Changes to Zend/tests/bug43450.phpt are unrelated to AST. It's just a > bad test that may be fixed separately. > > - I didn't get why you deleted Zend/tests/errmsg_014.php > > - ZEND_INIT_FCALL_BY_NAME handler shouldn't check if constant operand is > a string. Compiler must not provide non-string constant operand. (All the > changes to ZEND_INIT_FCALL_BY_NAME need to be verified more careful) > > - The same in ext/opcache/Optimizer/optimize_func_calls.c, but it's not > critical here. > > - I think you don't need IS_CONST operand for ZEND_ISSET_ISEMPTY_PROP_OBJ > handler. > > - Can OPcahce always keep AST in shared memory and don't copy it into > process memory on each request? (ext/opcache/zend_accelerator_util_funcs.c) > > > Thanks. Dmitry. > > > On Thu, Jul 31, 2014 at 10:11 PM, Nikita Popov > wrote: > >> Hi internals! >> >> I've created a draft RFC and implementation for the introduction of an >> Abstract Syntax Tree (AST) as an intermediate structure in our compilation >> process: >> >> https://wiki.php.net/rfc/abstract_syntax_tree >> >> The RFC outlines why an AST is beneficial, how it impacts performance and >> memory usage of the compile process and what changes to syntax or behavior >> it introduces. >> >> Furthermore the RFC contains an outline of how the current implementation >> works and what APIs it provides. This section is just an overview and I >> hope to extend it in the future. >> >> Note: I'm on vacation as of tomorrow and wanted to put this up to >> discussion beforehand. I won't be able to implement any feedback while I'm >> away, but can of course answer questions :) >> >> Thanks, >> Nikita >> > > --047d7b343a4c58e1390500e485fc--