Re: Idea: ifdef-like feature to ease userland BC
| From: | Marco Schuster | Date: | Sat, 08 Mar 2014 21:48:22 +0000 |
| Subject: | Re: Idea: ifdef-like feature to ease userland BC | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73010@lists.php.net to get a copy of this message | ||
Hi,
On Sat, Mar 8, 2014 at 10:40 PM, Andrea Faulds <ajf@ajf.me> wrote:
>
> On 8 Mar 2014, at 21:36, Marco Schuster <marco+php@m-s-d.eu> wrote:
>
> especially with (radical) userland API changes coming up in PHP6,
> might I suggest something like a ifdef feature which turns blocks of
> code into comments?
>
>
> Why is that needed? PHP checks function names and arguments at runtime, not
> compile-time. You can already do this:
>
> if (some_condition) {
> PHP_5_6_function();
> } else {
> PHP_5_2_function();
> }
>
This breaks if you use new syntax features like the array shortcut
$var=[];, traits or similar.
Marco