AFTNHombre Posted February 22, 2012 Share Posted February 22, 2012 I have this code that has $this->BeginTransaction(); all over it. These are in classes where no such function is defined, and they don't have parents either. It's driving my crazy trying to figure out why they are there, why there's not so much as a warning being given and what, if anything, is being called. Now I do have a set_error_handler("amfErrorHandler"); and in amfErrorHandler I have if( error_reporting() != 0 && ($amfphpErrorLevel | $level) == $amfphpErrorLevel ) { throw new VerboseException($string, $level, $file, $line); } I don't remember what $amfphpErrorLevel is, except that it should only be ignoring things like E_STRICT. Also, no exception is being thrown. So what do I do w/this code? Quote Link to comment https://forums.phpfreaks.com/topic/257531-calls-to-undefined-function-not-throwing-errors/ Share on other sites More sharing options...
AyKay47 Posted February 22, 2012 Share Posted February 22, 2012 the error handler is using the bitwise or ( | ) operator. So $amfphpErrorLevel and $level must be integer representations of error levels. If an exception is not being thrown, then the conditions are not being met. Just from this code snippet I can't really help, there are too many things unanswered here. Quote Link to comment https://forums.phpfreaks.com/topic/257531-calls-to-undefined-function-not-throwing-errors/#findComment-1320004 Share on other sites More sharing options...
AFTNHombre Posted February 22, 2012 Author Share Posted February 22, 2012 So you're saying there are a ton of reasons why calling a function that's not defined in scope might not fail and the error handler absorbing it is only one? What are some others? Quote Link to comment https://forums.phpfreaks.com/topic/257531-calls-to-undefined-function-not-throwing-errors/#findComment-1320070 Share on other sites More sharing options...
batwimp Posted February 22, 2012 Share Posted February 22, 2012 If you have a __Call function inside your class definition, this will handle any calls to undefined functions. Also, if your class is inheriting from a parent class, then the parent class may have that function defined. Quote Link to comment https://forums.phpfreaks.com/topic/257531-calls-to-undefined-function-not-throwing-errors/#findComment-1320225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.