3v4l.org

run code in 300+ PHP versions simultaneously
<?php //create function with an exception function checkNum($number) { if($number>1) { throw new Exception("Value must be 1 or below"); } return true; } //trigger exception in a "try" block try { checkNum(2); //If the exception is thrown, this text will not be shown echo 'If you see this, the number is 1 or below'; } //catch exception catch(Exception $e) { echo 'Message: ' .$e->getMessage(); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu1di
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'checknum'
          1        SEND_VAL                                                 2
          2        DO_FCALL                                      0          
   17     3        ECHO                                                     'If+you+see+this%2C+the+number+is+1+or+below'
          4      > JMP                                                      ->10
   21     5  E > > CATCH                                       last         'Exception'
   23     6    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      'Message%3A+', $2
          9        ECHO                                                     ~3
   25    10    > > RETURN                                                   1

Function checknum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu1di
function name:  checkNum
number of ops:  9
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_SMALLER                                               1, !0
          2      > JMPZ                                                     ~1, ->7
    7     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'Value+must+be+1+or+below'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
    9     7    > > RETURN                                                   <true>
   10     8*     > RETURN                                                   null

End of function checknum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.63 ms | 1398 KiB | 14 Q