Jump to content

Something I always wondered...


Andy-H

Recommended Posts

Say if I had a script using if/else blocks like so:

 

 

$myVar = true;


   if ( $myVar )
   {
      //Obviously this code executes.
   }
   else
   {
      // Does PHP waste time processing the code here or can it jump the block if a statement evaluates to 
      //false?
   } // I.E does it jump to this brace, without reading, processing, parsing w.e the contained code.


 

 

Thanks for any help here.

Link to comment
https://forums.phpfreaks.com/topic/188401-something-i-always-wondered/
Share on other sites

You could take up Assembler it will give you a good idea how a programming language works and an if/else for that matter. Your if and else are basically two blocks if the if fails (based on internal flags) it jumps to the else block otherwise it jumps to the if block. The good old' days ;)

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.