Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52767 invoked from network); 30 Jun 2018 21:18:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2018 21:18:14 -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 209.85.160.47 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.160.47 mail-pl0-f47.google.com Received: from [209.85.160.47] ([209.85.160.47:37607] helo=mail-pl0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/F3-15351-493F73B5 for ; Sat, 30 Jun 2018 17:18:14 -0400 Received: by mail-pl0-f47.google.com with SMTP id 31-v6so6106197plc.4 for ; Sat, 30 Jun 2018 14:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BELlidsF5vC2u1H7ef62TxP9JFLKoj0ZF5Q32V6tQf0=; b=l+7FMfnV8T8SxpJ5l6BmmH5aCyaKPY81wMpdYVbEZlFFCrJWWqnHrD8Hq67g64oiQ/ 5Je6isna2rpXYYw4X+Z0cPO98amCPs8JRoSNsKCbbZ+e7Vva1vV6IRR4cV8sa6iQQheA d57493P/9rSos2yn2Qk2N5c2fOFPjlg0ozfCEbxaE9AR1zPelNJi9rc1pcbpP1dqnBOW 6JR5kNnxstR2715CKSgYppuZjG+TwcXJgHPjsC8gjS8dI6xnuk1jdIsaAh90s1JBGw02 5pwrhWvs6xEB5ybjB6q6Lx7QwxqpZPpyeYGH3GHy+iymmW4fpW4VPL7ng6A8SbgN1BDZ Ds7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=BELlidsF5vC2u1H7ef62TxP9JFLKoj0ZF5Q32V6tQf0=; b=sZMocW/S3vNNMUIiJzEt0xWQ4WLTst+qf1k7Vl3FINNbsLFL5coqjFhkSnqNezjOOD cehbJ8SdHTy4bUjpQu3koQ3NVjJBe9ckJXZQ+dnos2prpyWMqF47SC8y+uWK9p0HrvsC L+Kx72N32K89OB9C4vsP0+4dymRb7+Tx3AEvHoyUWRfijpVxHGX9kSCWhyeojXDHyrrf EYgWo/FkficQiltdbVjDGaL3Igwe+kyKLjdyiI96aU9gatjHPrPmRVlvDrz15NoLaFsL dBCn026gW55RC0DLbnuYlQDZs6bsAzzNG3WenuSTUAweCOBGa7Nh2vP1ktlXDFgeQ6cW 5Yow== X-Gm-Message-State: APt69E1g+yjy+6nAs4WFEMam45rVbKrxmjmtUvc+TdVWSLu+8mikw9KP u+BMrX+PT+Q4xF1W1gTVq49P8ZA= X-Google-Smtp-Source: ADUXVKLrLJajWiuODWppR1ZBrjld8rGdMANhRbfv+yDzAWarnZnWrELsrUNfRYek/aFpsdxpAcV5Cw== X-Received: by 2002:a17:902:70ca:: with SMTP id l10-v6mr19949480plt.174.1530393489983; Sat, 30 Jun 2018 14:18:09 -0700 (PDT) Received: from Stas-Pro-2021.local (c-24-4-176-254.hsd1.ca.comcast.net. [24.4.176.254]) by smtp.gmail.com with ESMTPSA id m5-v6sm4937222pfm.27.2018.06.30.14.18.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jun 2018 14:18:09 -0700 (PDT) To: "Paul M. Jones" , Sara Golemon Cc: Gabriel Caruso , PHP Internals References: <854a8dfc-4bc1-c001-a1a7-5347e5483ac8@gmail.com> <878D41D8-8B95-4EB4-BF47-B8EB4B3B017E@pmjones.io> Openpgp: preference=signencrypt Autocrypt: addr=smalyshev@gmail.com; prefer-encrypt=mutual; keydata= xsJuBE9mqaARCACFSqcGmNunkjQQu3X+yXnTmFeEkvM4JXZTOBdR8aEevNGmmFEfyvjaDjWi 9hcwp4E/lYtC+P7VsVjM1OSX9eq0jC/lGL0ZyRXek+mNy0n5H1NSuTpf9Y18LMqhc4G+RU+L cNiZ9K0DJuOOvNLPxW7OHZguxb3wdKPXNVa2jyRfJAKm2uaJJMT1mTmFT9a0Q8SKr+mUrrJk uG0H2o6SzrKt8Wwoint1eh67zVsJaJtQFchnEZnlawIcqP2yC4nLGR3MkubowxoEBYCZet18 aHVVRbvpG2Qtob8Lu5xrsGbmXymTkHTdpvkfcJFADa8MzOL90zOxXwbGfbIZOlh5En8jAQCX lfnx2eQL3BSW/6XANa51dbWiEp1d1BAkpGKtZvlk0Qf+M9WAi+9aXMe3xP5krxtgnRNUf2WN 6Zdy2MxL1RRJCFbytLhl0ronC49BsGYVGshdEH8xhBbiIOJKuVZ/DTl9bEm7P9c7CC7iJyVC khUAhouH6xzZQNLR+RU+QebYzXypVfl99Qk7EdMmr/WAZCHLuvanyqepC5EBsa3VnAfQemSN oBeGBKWWLiOsPjvS72+y1z4RUMAfXHn4l/sFMt8zt7/74AmJPwZquV41p4mPO12V4+xPyc6R sB84sfsk2QVivU8w8AkvGQeYjXoz7Iwao95+fWteVzZ36KRQvUckP8pGjHlDXnHxJ0HI1I/k OBZSjwRwUf0dd73y6erPhbLk+gf+NdI3H9KGJBzG5/rVyWKwUeQ9d5ud4jTJRkQGvAP5pg76 vEa9dogbpe4W5Z+0BfbiJSnQmQWSHiZddj/t33ptbup44Ck6ZTgdlmFYMLF1hR47PIZTDKER EuKYGci/vq8snZvEJP9YCw/TtiHcMdrMKcY/+Lp8lQO0GHLPB9glVhnC0db6l1Xpg1CMI8/R ozBMcij30EgATggC/y2zb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kFAk9mqaACGwwACgkQL3lWvF2gS126EQD/VVd3FgjLKglClRQP zdfU847tqDK4zJjbmRv5vLLwoE0A+wbrQs7jVGU3NrS0AIl5vUmewpp2BKzSkepy23nWmejw Message-ID: Date: Sat, 30 Jun 2018 14:18:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <878D41D8-8B95-4EB4-BF47-B8EB4B3B017E@pmjones.io> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Mixed type From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I would enjoy a 'mixed' typehint for exactly that reason; i.e., that I don't have to put it in a docblock. I think it is exactly the opposite of what should be happening in the language - putting things in the code which belong in the documentation, so you don't have to write documentation. I don't think it is a good direction. > Given this method ... > > public foo(string $bar, int $baz) : void { ... } > > ... I don't need any docblock at all for the params. You still do. You still need to describe what the parameters do and what the function does. > But given *this* method ... > > public foo(string $bar, int $baz, $dib) : void { ... } > > ... I find myself wanting (for completeness' sake) to add a docblock indicating the $dib typehint: I think it's a misguided idea that the more type specifications the code has the better is the code. "$dib" and "mixed $dib" say *exactly* the same thing. That you do not limit what type it is. But instead of placing it in proper place for explanatory things - namely, comments - it places it in the code. > public foo(string $bar, int $baz, mixed $dib) { ... } > > ... relieves that bit of docblock dissonance. If it does so for me, I bet it would do so for others. It just means you moved some documentation into code. Which didn't make it adequate - it's still an undocumented function - but made you feel you don't need to document it now. I don't think it's a good thing. -- Stas Malyshev smalyshev@gmail.com