> On Jun 30, 2018, at 15:17, Sara Golemon <poll...@php.net> wrote:
> 
> I'm not super excited about this RFC because, as you say, this information 
> could be easily encoded into the docblock for the function/method.

I would enjoy a 'mixed' typehint for exactly that reason; i.e., that I don't 
have to put it in a docblock.

Given this method ...

   public foo(string $bar, int $baz) : void { ... }

... I don't need any docblock at all for the params.

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:

   /**
    * @param mixed $dib ...
    */
   public foo(string $bar, int $baz, $dib) { ... }

... and *then* the docblock looks unusual to me, and I want to fill out all the 
rest of the params in the docblock.

Yes, I'm aware that may be idiosyncratic. Even so, being able to do this ...

   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.


-- 
Paul M. Jones
pmjo...@pmjones.io
http://paul-m-jones.com

Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp

Solving the N+1 Problem in PHP
https://leanpub.com/sn1php





-- 
Paul M. Jones
pmjo...@pmjones.io
http://paul-m-jones.com

Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp

Solving the N+1 Problem in PHP
https://leanpub.com/sn1php




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to