Jump to content

Php Execution help


Network_ninja

Recommended Posts

Is there a way in php to not execute the whole script if there is error on the script?

 

For example:

     

      <?php 
               execute script here;
               ..........
               ...........
              [b] error encounter here[/b].  -> error is not logical
              execute script
              .............
              .............
      ?>
      

 

I don't want to execute the above script... tnx everyone.

Link to comment
Share on other sites

When the interpreter parses the script into opcode, it checks the script for runtime errors, rather errors that would prevent the script from running. The script will not execute entirely, if it contains syntactical (parse) errors (i.e forgot a ";" at the end of a line ... etc).

 

The Interpreter loads a script and executes it start to finish, so anything in the general namespace (code that will execute regardless of condition) that contains an error will throw a flag in the interpreter right away. If however, there is an error in a conditional namespace (code that only executes under certain conditions ... i.e. functions), a flag is only thrown in the interpreter when something from general namespace references the error in the conditional namespace.

 

Generally, the script will continue execution under all flags except fatal errors.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.