Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #14690
| From | "Christoph M. Becker" <cmbecker69@arcor.de> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Consistency with object to boolean conversions |
| Date | 2014-12-03 19:30 +0100 |
| Organization | solani.org |
| Message-ID | <m5nkr6$mtk$1@solani.org> (permalink) |
| References | <m5n8a7$gra$1@dont-email.me> <m5neof$125$6@dont-email.me> <m5ng47$k3d$1@dont-email.me> <m5ngtb$8dj$1@solani.org> <m5njqb$4cf$1@dont-email.me> |
Gregor Kofler wrote: > Am 2014-12-03 um 18:22 schrieb Christoph M. Becker: >> Gregor Kofler wrote: >> >>> it still doesn't explain why casting to boolean in the if condition >>> doesn't throw an error. >> >> Indeed. Might that be caused by some dubious optimization (e.g. by >> OPcache)? > > Indeed. Since my 5.5.9 shows the above behaviour but 5.4.35 already > fails at line 50. It seems I found the cause. The if statement emits the opcodes BOOL_NOT, JMPZ (according to VLD), what is optimized by OPcache to NOP, JMPNZ[1]. So when the code is executed by OPcache, there is no conversion involved for the if clause. IMHO that makes changing the behavior of SplFileInfo objects wrt. issue #65213 even more important. [1] <http://lxr.php.net/xref/PHP_5_5/ext/opcache/Optimizer/block_pass.c#816> [2] <https://bugs.php.net/bug.php?id=65213> -- Christoph M. Becker
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Consistency with object to boolean conversions Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 15:56 +0100
Re: Consistency with object to boolean conversions "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-03 16:19 +0100
Re: Consistency with object to boolean conversions Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 16:39 +0100
Re: Consistency with object to boolean conversions Matthew Carter <m@ahungry.com> - 2014-12-03 11:42 -0500
Re: Consistency with object to boolean conversions Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 18:06 +0100
Re: Consistency with object to boolean conversions Matthew Carter <m@ahungry.com> - 2014-12-03 13:13 -0500
Re: Consistency with object to boolean conversions Denis McMahon <denismfmcmahon@gmail.com> - 2014-12-03 16:46 +0000
Re: Consistency with object to boolean conversions Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 18:09 +0100
Re: Consistency with object to boolean conversions "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-03 18:22 +0100
Re: Consistency with object to boolean conversions Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 19:12 +0100
Re: Consistency with object to boolean conversions "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-12-03 19:30 +0100
Re: Consistency with object to boolean conversions Gregor Kofler <usenet@gregorkofler.com> - 2014-12-03 20:58 +0100
csiph-web