Topic
1 reply Latest Post - ‏2013-05-14T23:09:46Z by KanatT.
Rex-Miami
Rex-Miami
3 Posts
ACCEPTED ANSWER

Pinned topic Assert statement does not like functions

‏2013-05-14T19:05:11Z |

I tried to do this in SPL code:

assert(somefx(xxx),"text...");

It compiles fine, but crashes at runtime.  However, this works:

if (somefx(xxx) == false) {

  assert(false,"text...");

}

Does anyone know why my first usage of assert compiles, yet crashes the PE?

  • KanatT.
    KanatT.
    13 Posts
    ACCEPTED ANSWER

    Re: Assert statement does not like functions

    ‏2013-05-14T23:09:46Z  in response to Rex-Miami

    We've tried it with a few "somefx" and they produced the same outcomes. It is helpful to know what somefx does and how you wrote it (is it an SPL function or is it a native function?).  It will even be better if you can provide a small complete program that reproduces the problem.