Re: Idea: ifdef-like feature to ease userland BC

From: Date: Sat, 08 Mar 2014 23:44:54 +0000
Subject: Re: Idea: ifdef-like feature to ease userland BC
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-73018@lists.php.net to get a copy of this message
Hi, On Sun, Mar 9, 2014 at 12:41 AM, Arvids Godjuks <arvids.godjuks@gmail.com> wrote: > Hello Internals. > > This really sounds strange. Why? Because you already have all the tools in > userland to do all that since like PHP 4. > > You have "function_exists" > http://lv.php.net/manual/en/function.function-exists.php , you > have > "phpversion" http://lv.php.net/manual/en/function.phpversion.php,£* > Éÿ9läàAå­œv you have > PHP_VERSION_ID constant (details about the constant are in > http://lv.php.net/manual/en/function.phpversion.php too), you > have > version_compare > http://lv.php.net/manual/en/function.version-compare.php > > Sometimes you just need to look up the actual manual... This helps against API-layer changes, but once you try out new syntax features (not just yield/goto, but I have stuff like named parameters or that argument unpacking stuff in mind), then you need a parse-time filter so that older PHP versions do not cough up on syntax errors. Marco

« previous php.internals (#73018) next »