Jump to content

reefat

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

reefat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oops! Forgot to mention that I'm using a custom error handler set by set_error_handler("__error_handler"); . E_COMPILE_WARNING was turned off there. This was causing the problem. Sorry for the confusion. And thanks a lot for the cooperation.
  2. I have been scripting (some may say programming) in PHP for last 5 years but never faced this issue. Interesting! Say for example, I created a custom function with one argument: function myFunc($arg1) { echo $arg1; } Now, if I call this function without supplying any argument it doesn't give any error/warning. Any other high level language like C++ or Java would produce error in this case. So, I had to modify my code as follows: function myFunc($arg1) { if (!isset($arg1)) { echo "Missing argument 1"; } echo $s; } But this is annoying. Now I have to add these EXTRA lines of code in every function and class methods I have created. Is there any shortcut/easy method that the script will always produce an error if its missing any required argument? I have tried with adding error_reporting(E_ALL); at the very beginning of my code. But it still didn't work out. By the way, I am using PHP 5.3.1 on Apache/2.2.14 (Unix). Any suggestion will be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.