Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73011 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64073 invoked from network); 8 Mar 2014 21:58:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2014 21:58:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@rouvenwessling.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=me@rouvenwessling.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain rouvenwessling.de designates 5.35.242.46 as permitted sender) X-PHP-List-Original-Sender: me@rouvenwessling.de X-Host-Fingerprint: 5.35.242.46 rouvenwessling.de Linux 2.6 Received: from [5.35.242.46] ([5.35.242.46:33216] helo=lvps5-35-242-46.dedicated.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/B2-44862-3929B135 for ; Sat, 08 Mar 2014 16:58:44 -0500 Received: by lvps5-35-242-46.dedicated.hosteurope.de (Postfix, from userid 5001) id 334D669F04F6; Sat, 8 Mar 2014 22:58:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lvps5-35-242-46.dedicated.hosteurope.de X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.1 Received: from rouvens-air-7.localdomain (xdsl-85-197-44-180.netcologne.de [85.197.44.180]) by lvps5-35-242-46.dedicated.hosteurope.de (Postfix) with ESMTPA id 94BAE69F04F6; Sat, 8 Mar 2014 22:58:39 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) In-Reply-To: Date: Sat, 8 Mar 2014 22:58:35 +0100 Cc: Andrea Faulds , internals Content-Transfer-Encoding: quoted-printable Message-ID: <2C204A3E-D305-47EC-B759-50192635AC59@rouvenwessling.de> References: <03CFE6C6-0742-4928-BD2B-E9C920E9246A@ajf.me> To: Marco Schuster X-Mailer: Apple Mail (2.1874) Subject: Re: [PHP-DEV] Idea: ifdef-like feature to ease userland BC From: me@rouvenwessling.de (=?iso-8859-1?Q?Rouven_We=DFling?=) On 08.03.2014, at 22:48, Marco Schuster wrote: > $var=3D[];, traits or similar Neither of these is something you'd really do a version switch around, = as it would lead to a lot of duplicated code, that needs to be kept in = sync. Of the top of my head there are three situations where branching = based on the PHP version is necessary/useful: 1. I'm using an API which is deprecated/unavailable in the newer version = I support but the replacement is not available in the older version. 2. I can improve performance, security or functionality by using some = new native function that is not available in the newer version. (For = example hex2bin only being available in PHP >=3D 5.4) 3. Working around bugs in specific PHP versions. It would be incredibly unlikely for any of these to involve recently = improved syntax. Also note that from what I'm understanding the OPCache = Optimizer will actually remove some branches which can't be called, so = there's some chance that there will be no runtime performance impact at = all by these checks. Best regards Rouven=