php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59629 Option for ignoring asserts
Submitted: 2011-02-17 07:57 UTC Modified: 2015-05-26 11:19 UTC
From: php at maisqi dot com Assigned: cmb (profile)
Status: Closed Package: bcompiler (PECL)
PHP Version: 5.3.5 OS: All
Private report: No CVE-ID: None
 [2011-02-17 07:57 UTC] php at maisqi dot com
Description:
------------
Hello. Thanks for your work on bcompiler. It's a quite useful tool.
I think it would be nice if there were an option for ignoring asserts on compiling to bytecode. IMO, each assert in an interpreted language has a cost... but is also our first line of defense against bugs.
So, I think it would be great if we could ?plant? dozens of asserts in our code, knowing they wouldn't make it to the bytecode.

Maybe, I'm the only one that could ever need this.
Or maybe this is so complex to implement that simply isn't worth it.
But, maybe not... :-)
Anyway I would very much like to hear you and the community on this.

Thanks,
Filipe Martins


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-17 23:18 UTC] alan at akbkhome dot com
Needs patch if you want it to happen...

although It might just be easier to write a little PHP code 
with the tokenizer extension to remove them.
 [2011-02-18 05:17 UTC] php at maisqi dot com
Yes, surely it would need patching.
And, I agree it can be done with the tokenizer (or with regexps).
Either way, my asserts shell not pass :-)
But if this is straightforward to implement I think it would be nice. It would give a C-ish behavior to PHP (as we all know, asserts don't usually run outside debugging mode in C/C++).


Thanks,
Filipe Martins
 [2012-08-03 11:29 UTC] php at maisqi dot com
This such of tiny importance that I think it should be closed. The assert should not go into the bytecode if ASSERT_ACTIVE is zero. Maybe some day I have the time to check how this is being done on PHP.
Anyway, please close this issue. I should neve have bothered you guys with neat picking (as we call it, "pintelho"). Thanks.
 [2015-05-26 11:19 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-05-26 11:19 UTC] cmb@php.net
Closing on request from OP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC