3v4l.org

run code in 300+ PHP versions simultaneously
<?php //creating a function containing a potential exception function checkNumber($number) { if($number > 1) { throw new Exception('The value has to be 1 or lower'); } return true; } //triggering the exception inside a try() try { checkNumber(2); //In case the exception gets thrown, this is the message that is shown. echo 'The value is 1 or lower'; } catch(Exception $e) { //catching the exception 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/0pC9l
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'checknumber'
          1        SEND_VAL                                                 2
          2        DO_FCALL                                      0          
   14     3        ECHO                                                     'The+value+is+1+or+lower'
          4      > JMP                                                      ->10
   15     5  E > > CATCH                                       last         'Exception'
   17     6    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      'Message%3A+', $2
          9        ECHO                                                     ~3
   18    10    > > RETURN                                                   1

Function checknumber:
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/0pC9l
function name:  checkNumber
number of ops:  9
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_SMALLER                                               1, !0
          2      > JMPZ                                                     ~1, ->7
    5     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'The+value+has+to+be+1+or+lower'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
    7     7    > > RETURN                                                   <true>
    8     8*     > RETURN                                                   null

End of function checknumber

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.68 ms | 1398 KiB | 14 Q