Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79404 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85960 invoked from network); 3 Dec 2014 22:09:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2014 22:09:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.15 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.15 mout.gmx.net Received: from [212.227.15.15] ([212.227.15.15:64339] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/B8-15597-72A8F745 for ; Wed, 03 Dec 2014 17:09:44 -0500 Received: from [192.168.0.100] ([91.67.244.80]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MfmWy-1XZHcd3WSa-00N6fn; Wed, 03 Dec 2014 23:09:39 +0100 Message-ID: <547F8A29.6030000@gmx.de> Date: Wed, 03 Dec 2014 23:09:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Peter Cowburn CC: internals@lists.php.net References: <547F741D.6030507@gmx.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:eIngPSY6fsZzL6xnGtJDxPWif9L21543eE+okO+kEouEqb/gIr+ XlC/Z1u9/EGC8Dxj16FeT2uZq09XMtj+UZZTlJaqNTaMvN7eac+XrOkISnVtRczPix/gOkh 8yPEMi3TD1fIDn+jMOSq7ISzEI6nssInqvEsLe6ZggehxD0ECxmuht8FDd4q0eMU7KNPJV6 jmnFZ27r28jrSbFOC/Jkg== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [PHP-DEV] Conversion of SplFileInfo instances to boolean From: cmbecker69@gmx.de (Christoph Becker) Peter Cowburn wrote: > On 3 December 2014 at 20:35, Christoph Becker wrote: > >> Hello internals, >> >> today I stumbled over issue #65213[1] which has been reported as a bug, >> but was changed to a feature request without any hint why the conversion >> of SplFileInfo instances to boolean throws a catchable fatal error. >> >> Even worse, due to optimizations in OPcache (and maybe other optimizers >> as well), this does not always happen. Consider the following snippet: >> >> > >> $o = new SplFileObject('.'); >> if (!$o) { >> } else { >> var_dump(!$o); >> } >> >> Without any optimization this throws the error in line 4 (the if >> clause); with OPcache the error is thrown in line 6. Apparently that is >> caused by a optimization where BOOL_NOT,JMPZ is converted to NOP,JMPNZ[2]. >> >> IOW: with OPcache enabled `if (!$o)` works fine, but without OPcache it >> is an error. IMHO both should behave identically. >> >> [1] >> > > This looks fixed in master (https://github.com/php/php-src/commit/8904f72 > > ). Indeed, thanks. confirms that. However, if the former behavior is regarded as a bug, shouldn't it be fixed for PHP 5.5 and PHP 5.6 as well? Anyhow, the bug report/feature request might be closed. -- Christoph M. Becker