3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NotBarException extends Exception {} class NotFooException extends Exception {} try { $foo = "bar"; if ($foo != "bar") { throw new NotBarException("Variable not set to 'bar'!"); } if ($foo != "foo") { throw new NotFooException("Variable not set to 'foo'!"); } } catch(NotBarException $exception) { print "NotBarException\n"; } catch (NotFooException $exception) { print "NotFooException\n"; } catch (Exception $exception) { print get_class($exception)." Exception\n"; }
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
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 20
2 jumps found. (Code = 107) Position 1 = 21, Position 2 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 17
Branch analysis from position: 17
Found catch point at position: 20
Branch analysis from position: 20
filename:       /in/hfOqf
function name:  (null)
number of ops:  25
compiled vars:  !0 = $foo, !1 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'bar'
    8     1        IS_NOT_EQUAL                                             !0, 'bar'
          2      > JMPZ                                                     ~3, ->7
    9     3    >   NEW                                              $4      'NotBarException'
          4        SEND_VAL_EX                                              'Variable+not+set+to+%27bar%27%21'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $4
   12     7    >   IS_NOT_EQUAL                                             !0, 'foo'
          8      > JMPZ                                                     ~6, ->13
   13     9    >   NEW                                              $7      'NotFooException'
         10        SEND_VAL_EX                                              'Variable+not+set+to+%27foo%27%21'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $7
         13    > > JMP                                                      ->24
   15    14  E > > CATCH                                                    'NotBarException', ->17
   16    15    >   ECHO                                                     'NotBarException%0A'
         16      > JMP                                                      ->24
   17    17  E > > CATCH                                                    'NotFooException', ->20
   18    18    >   ECHO                                                     'NotFooException%0A'
         19      > JMP                                                      ->24
   19    20  E > > CATCH                                       last         'Exception'
   20    21    >   GET_CLASS                                        ~9      !1
         22        CONCAT                                           ~10     ~9, '+Exception%0A'
         23        ECHO                                                     ~10
   21    24    > > RETURN                                                   1

Class NotBarException: [no user functions]
Class NotFooException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.38 ms | 1386 KiB | 13 Q