Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88843 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82895 invoked from network); 15 Oct 2015 23:20:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2015 23:20:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.51 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.215.51 mail-lf0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:32898] helo=mail-lf0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/00-15862-0D430265 for ; Thu, 15 Oct 2015 19:20:48 -0400 Received: by lffv3 with SMTP id v3so54863654lff.0 for ; Thu, 15 Oct 2015 16:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:from:date:to:message-id; bh=P5dJaJMNq3L4JgMuitIQWHZ8NXLcbnw7uiocsQZ+N4A=; b=gMw2Ik47Cq9Lnac7+M8JMDhgecGmQKHdrMJAYcEKPdNOXegYKD7rfg/w+kbdNcMO3g TASnbbef1DuY7r+q3JjhFMPQd0SetsssqFiJWib7mQuvRtD86zWJC+JqgEMUlF5mE1GF P1ab1+Rnf3dQpA0er5Ci1XnypNbMbt2H6BFQi+RWjDUrvFPDHa8Y+KpqRzcKlWHknz0b yIpzUne0TOQk3DfaSlUDn6+GdoSgOACApzgLTVVrLEpqNAQuQwWNUfdFZS/r9yuUzVyA safW++vbCIUohdUSefvWePjfX7c4P1Y8yvAc5KUTLmo/QtfP3MQUNUsjuy92iLBwBDov dIGQ== X-Received: by 10.194.61.70 with SMTP id n6mr13022763wjr.81.1444951245089; Thu, 15 Oct 2015 16:20:45 -0700 (PDT) Received: from [192.168.0.6] (cpc83573-brig19-2-0-cust218.3-3.cable.virginm.net. [81.98.228.219]) by smtp.gmail.com with ESMTPSA id s16sm901864wik.16.2015.10.15.16.20.43 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Oct 2015 16:20:44 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: References: <0A.C2.33697.6AECE165@pb1.pair.com> <561F7D17.5050306@gmail.com> <561FCD9F.10104@gmail.com> <90.58.23021.E85DF165@pb1.pair.com> <561FD658.202@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----034UPI63XERU802U1E3FP42HAQF7O0" Content-Transfer-Encoding: 8bit Date: Fri, 16 Oct 2015 00:20:35 +0100 To: internals@lists.php.net Message-ID: <185707F6-9B57-4103-90C2-21246510FC67@gmail.com> Subject: =?UTF-8?Q?Re=3A_=5BPHP-DEV=5D_=5BRFC=5D_Void_Re?= =?UTF-8?Q?turn_Type_=28v0=2E2=2C_re=C3=B6pening=29?= From: rowan.collins@gmail.com (Rowan Collins) ------034UPI63XERU802U1E3FP42HAQF7O0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 On 15 October 2015 20:33:04 BST, Andrea Faulds wrote: >> Obviously, type hints for internal functions are a bit weird anyway, >but >> there's no reason to assume that every function documented as void >would >> suddenly be annotated in the Engine as such and start returning >notices. > >Why shouldn't it? For the scalar types, internal and userland functions behave almost the same. Just for the same reason that an existing function that uses bare "return;" won't automatically be considered "void" - nobody has explicitly decided that that's the intent. Sure, internal functions whose value shouldn't be used *could* be marked void, and those would start raising Notices if that was part of void's behaviour. But there would only be a blizzard of Notices if someone bulk updated every function in core which happens to return null, which doesn't seem like an automatic part of creating a void return behaviour. Especially if the whole point is that "void" signifies something more than "always returns null". Since it's been mentioned a couple of times, I'd like to say that although the documentation is official, I think it should be considered descriptive not prescriptive - if it labels something as void, but the Engine doesn't consider it so, the manual would be wrong, not the Engine. Regards, -- Rowan Collins [IMSoP] ------034UPI63XERU802U1E3FP42HAQF7O0--