Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101332 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7301 invoked from network); 12 Dec 2017 07:51:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2017 07:51:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.44 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.44 mail-pg0-f44.google.com Received: from [74.125.83.44] ([74.125.83.44:41658] helo=mail-pg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/22-53433-39A8F2A5 for ; Tue, 12 Dec 2017 02:51:48 -0500 Received: by mail-pg0-f44.google.com with SMTP id o2so12885689pgc.8 for ; Mon, 11 Dec 2017 23:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=4YJrG3llqCnGXvxRpVls5GaKbQmmSbeTU/aFtn7r4WI=; b=k04cJ1mU/EZGkCYmLO838DNBZn/LC4BUrFUGanP9boPDwpgrq3Jz9yhiVJ6o2G/4lb DsHqsEtBCBhx2a8dmhu01YhXtOqxnJpV3DqeFfjPhxQVzLmULoOFfRQJ+85w7euJ5wa/ j1zFABlejDfOoTgvjz9pquYavnh693vd/32Ai9sv49D0aOaJ+iQE+tVlIz2KvR4WhqzK EjJ5qWmrXzc1F7SIDOftXK6S8HacyuciNyFyVZAs0rQaXqd+SD//pV8uJzo2UW1d5Fm8 gqDhc43VeCxkQFfLuLLjIq0juGDjKNj6Enxp2eKPc64qwnkvhEWspcLAamDpQO79XZh4 NeQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4YJrG3llqCnGXvxRpVls5GaKbQmmSbeTU/aFtn7r4WI=; b=fv+JYr1zOWxhcOgJoGr76kyWeFgm2a/UblVyP8V7JEA3uXw3rDr1TddH6+0gklY4NE SwCsIQqht+Sj/VIK8A4G9u68AWid+CbI9HJo17gzLxK5uskWT9t4bWIFD/fJZk2JsdxS p3WD/r50+xfRzwiupHfWvIFYeaTDO7nnlHFFh3qyThxygmRVU2+w3iHc5NVgbwu7+XoT AGRbbmTBdXfQexneQO0y80/vcqdpOht6FY/1dl7pv02ACP1e3B2aqgh885DtpOtJoWKP uv/X93kEaXo/c18OHTENlUM0wmWwRmyTurn7qw2oa8c/Z7J1cjo/E18/5gdDO+FIqp7B WXUA== X-Gm-Message-State: AKGB3mLHYRoC/8hMEmwnHmqfTkDe5Fhumd3HFE3tyq9BHvqQj9qzZH1i oYh3X79O+R9YEjZAXIhszK/E87M= X-Google-Smtp-Source: ACJfBovxpUnY1aSuaHgxYWqitb0RDC2cbuhJtKq3vDyD8TKzVnjRR9WUwCby1Vxp1WxUeYzBiqSTHA== X-Received: by 10.159.253.70 with SMTP id b6mr1419618plx.114.1513065104599; Mon, 11 Dec 2017 23:51:44 -0800 (PST) Received: from Stas-Pro-2016.local (c-73-71-144-171.hsd1.ca.comcast.net. [73.71.144.171]) by smtp.gmail.com with ESMTPSA id k23sm30807984pfj.22.2017.12.11.23.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 23:51:44 -0800 (PST) To: =?UTF-8?Q?Johannes_Schl=c3=bcter?= , Nikita Popov , PHP internals References: <1512911576.12039.8.camel@schlueters.de> <274a646a-4e56-81fe-ac52-015da2bebc6f@gmail.com> Message-ID: Date: Mon, 11 Dec 2017 23:51:42 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Explicit call-site send-by-ref syntax From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > The issue, as you well know, is that references disable copy-on-write. Thus assume you have code like this: > > function with_ref(&$a) { > count ($a); > } > > function no_ref($a) { > count($a); > } > > The count in with_ref() will copy the array, while no_ref() can use copy on write and won't actually copy. Yes, this is an issue, and it'd be good to find a way to solve it. At least for count() and other "pure" (however pure can it be in PHP) functions it seems possible. But do not think "not using references ever" qualifies as a solution :) -- Stas Malyshev smalyshev@gmail.com