Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106299 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 13242 invoked from network); 25 Jul 2019 18:15:06 -0000 Received: from unknown (HELO mail-io1-f54.google.com) (209.85.166.54) by pb1.pair.com with SMTP; 25 Jul 2019 18:15:06 -0000 Received: by mail-io1-f54.google.com with SMTP id q22so98142834iog.4 for ; Thu, 25 Jul 2019 08:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Xt8nH6YQmu7isFduov8upGPMJBzvL98L3hkXv382G4M=; b=ELENad+YNHEB/1NPqvC1+NN5PRmcFKotqAyuoyEzIg1lA1jGQZ1tgPigoxUyaKZoSV 6xHSIgOWfw3+OZHaA9h17dGUm9/oBaZHJCjUsgp7SpK+nYgyi5tAHCSjEpNKsm8sTa3U xwlJMGMlI6G4g0vCD/WlV5ziJdMIE1hrolBWNoLS4MoLB9yqeBcz+ajXiB0XD28usm6I pBkpej70ClG8zYNzR3qHBXWcEntaUtKtElR6KYAdQ8v43sTM5tecLFbZTHvvxeGlitxO S4nLdGjF0Ba+8HhqYF08HFb1DgRn0sbH5DqPxW9+1Tr7VPgIoakYeg7tAdm9G9KLmhe8 W0AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Xt8nH6YQmu7isFduov8upGPMJBzvL98L3hkXv382G4M=; b=Glm3qg7v1J+9KXhCzsk0v5lCzpzo6jT2csULpg/WEbHSVMWvxZlXa2iJ3pMwRJDoBn 1R/Jfz8FoDbbOJiXeWxEybfQhTQ5DhqGs0mMW+GLig1HqE0SUp58KYu681+Ok6WXR8mS c8getp9oQFis7FfeRuXCvbTq29eBYqRA/Ie/GNqOftlTqKpE/n4af4MCj+d+cxpsDSoV IF1QMfV6fPtiIJAIao858jQT+t6upkR3zmsPny3+Zf0wyP93pOSje1KeZ6hmHo/9hXwp ZjRl9cJwgmoQwnTIG0QKZoqjFmdhvPjU8iBELEOPS7DN5dNu6l+rADgKdu6KBd7VyVZj rSOA== X-Gm-Message-State: APjAAAV5XfMlLbl9Y2/6TAFjfhT4Z9KdtUG6OdX6pqsw/wUbLgutCSUK jZCblwp9Ra7xVOeF872lhym0y3VAyMz9ntb71Hll4FaT X-Google-Smtp-Source: APXvYqyu+dYyUC8ARlqHVCxOv8VouYCWidlqBJRzKOisD2zNZt6OxKCm2oWHSJFPYXfwBFoNTzeQKdkVD+/Of0SBIWI= X-Received: by 2002:a02:b914:: with SMTP id v20mr86384949jan.83.1564069126731; Thu, 25 Jul 2019 08:38:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 25 Jul 2019 16:38:35 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000b401bd058e8338cb" Subject: Re: [PHP-DEV] Re: [RFC] Explicit call-site send-by-ref syntax From: rowan.collins@gmail.com (Rowan Collins) --000000000000b401bd058e8338cb Content-Type: text/plain; charset="UTF-8" On Thu, 25 Jul 2019 at 16:18, Nikita Popov wrote: >> That would stop people having to write `$matches = []; preg_match($foo, $bar, $matches);` > Eww, please don't write code like that... Huh? How would you write it then? The behavior of type annotations should also change, "out T $x" should > check that the value assigned to $x on function exist (or possibly on every > write to the variable?) is T. "inout T $x" should check that $x is T on > entry, and also on exit (or on every assignment). > Ah, you're right, I hadn't thought about the implications for type checks. Still, I'd rather wait for an actual new feature like this than dig into my repo and revert the PHP 5.4 update commit so that all the call-site ampersands are back, but still with all the drawbacks of references. Contrary to the RFC, I have never thought of this as "PHP 4 behaviour", because I used it right up until 5.3, exactly how this RFC is now suggesting is the future. (I guess I should have paid more attention to deprecation notices at the time!) Regards, -- Rowan Collins [IMSoP] --000000000000b401bd058e8338cb--