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
https://forums.phpfreaks.com/topic/250351-php-execution-help/
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
https://forums.phpfreaks.com/topic/250351-php-execution-help/#findComment-1284579
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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