Re: [RFC] Scalar Type Hinting With Casts (re-opening)

From: Date: Sun, 13 Jul 2014 05:22:22 +0000
Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-75384@lists.php.net to get a copy of this message
Hi! > PHP’s type hinting system is rather incomplete as it does not support > scalars, only arrays, callables and objects. In 2012, Anthony Ferrara > created an RFC which proposed type hinting for scalar types (int, > float, bool, string and resource) with casting, with behaviour nearly > the same as that of zend_parse_parameters. Sadly, he later left PHP > internals and withdrew his RFCs. I have one request: could we please stop calling it "hinting"? The dictionary says (http://www.thefreedictionary.com/hint) that the word "hint" means: 1. A slight indication or intimation: wanted to avoid any hint of scandal. 2. a. A brief or indirect suggestion; a tip: stock-trading hints. b. A statement conveying information in an indirect fashion; a clue: Give me a hint about the big news. 3. A barely perceptible amount: just a hint of color. What we have in PHP and what is being proposed it not a "slight indication", not "suggestion" and not "conveying information in indirect fashion" (what Python does in PEP-3107 could be called that way, but it's not what is proposed here). It is very direct specification of either strict parameter typing or coercive parameter typing. I don't think using confusing terminology helps anything here. I think it was a mistake to introduce this term from the start and we should stop propagating it. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/

« previous php.internals (#75384) next »