Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86750 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11734 invoked from network); 18 Jun 2015 16:12:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2015 16:12:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.179 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:38149] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/88-46946-EDDE2855 for ; Thu, 18 Jun 2015 12:12:15 -0400 Received: by wibdq8 with SMTP id dq8so91892755wib.1 for ; Thu, 18 Jun 2015 09:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=8ReHg9Iy5MkFljKsVQln8qN+kxyeu460lVOPGkwShmI=; b=UJ+dGD5gKmshgupTCzD50NBuFVxD7Tz1wzdtWj4cMaVgqZn3KXcU5U832L+4ovj/7m ttOSiZRxGwqh++CkJgxTl6fkn1cQx1xsN+Nb+A/4wDkZChPyC36L1mhiDxUuVmdak/Zb ZR0Wj7CLMSIH2x6QhPUvL6orvs1yNz+4UhPkP516gngEq0KglDwnuuvIZF3jomlvlNr+ Kq5/8h5xCQu2bOS2tIKm6hqGOGyUaGRCnwbcvTCJu3DyW4jsBpF8ILXSIqWZ0a9Gog8X cpAlDh7HB65PyOdAQvC9hGWss/mGYfziAOaZbmw+YUJbwzLPVVFkhov6ezWujj6N7IB3 cIxA== MIME-Version: 1.0 X-Received: by 10.194.47.196 with SMTP id f4mr7521263wjn.46.1434643931605; Thu, 18 Jun 2015 09:12:11 -0700 (PDT) Received: by 10.27.214.20 with HTTP; Thu, 18 Jun 2015 09:12:11 -0700 (PDT) Received: by 10.27.214.20 with HTTP; Thu, 18 Jun 2015 09:12:11 -0700 (PDT) Date: Thu, 18 Jun 2015 17:12:11 +0100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=047d7b6704f1ec2e8e0518cd1115 Subject: Output, parameter From: codekestrel@googlemail.com (Dominic Grostate) --047d7b6704f1ec2e8e0518cd1115 Content-Type: text/plain; charset=UTF-8 A feature I'd quite like to see is something similar to C# out arguments. Which is an argument provided empty to a function (or with a value to be ignored) that the function must write to before returning. Normally this wouldn't be necessary since you can do this anyway by passing by reference, however I would like to make the same case for it that was made for return types. A possible syntax to differ from C# might be: function read(string ^$bytes, int length): int { } The arrow indicating that a value will be written to the argument. Another case for this is the fact it is unfeasible to provide a type hint for reference arguments because if the provided var is null or newly created it will throw an error. Using type hints on outputs will both validate that the populating value is of the correct type, as well as provide popular IDEs a hint to what the type has changed to. Thanks, Dominic --047d7b6704f1ec2e8e0518cd1115--