Re: Idea: ifdef-like feature to ease userland BC
| From: | Andrea Faulds | Date: | Sat, 08 Mar 2014 22:33:11 +0000 |
| Subject: | Re: Idea: ifdef-like feature to ease userland BC | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73012@lists.php.net to get a copy of this message | ||
On 8 Mar 2014, at 21:48, Marco Schuster <marco+php@m-s-d.eu> wrote:
> This breaks if you use new syntax features like the array shortcut
> $var=[];, traits or similar.
Right, but those aren’t problems. I can’t see anyone willingly writing:
#ifdef PHP_5_4
$a = [1,2,3];
#else
$a = array(1,2,3);
#endif
They will simply write:
$a = array(1,2,3);
For traits, again, it’s unlikely people will want to write two sets of code and deliberately
duplicate things. They’ll simply just not use traits.
The only case where what you’re saying makes sense is where features are removed in favour of
alternatives, and I can’t see that happening for any syntactic features.
--
Andrea Faulds
http://ajf.me/