3v4l.org

run code in 500+ PHP versions simultaneously
<?php class foo { public function bar(foo $x) { } } try { (new foo)->bar(new StdClass()); } catch (Exception $e) { echo "Exception ".get_class($e); } catch (TypeException $e) { echo "TypeException"; } catch (TypeError $e) { echo "TypeError"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 13
2 jumps found. (Code = 107) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 16
2 jumps found. (Code = 107) Position 1 = 17, Position 2 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 13
Branch analysis from position: 13
Found catch point at position: 16
Branch analysis from position: 16
filename:       /in/eMijr
function name:  (null)
number of ops:  19
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $1      'foo'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $1, 'bar'
          3        NEW                                                  $3      'StdClass'
          4        DO_FCALL                                          0          
          5        SEND_VAR_NO_REF_EX                                           $3
          6        DO_FCALL                                          0          
          7      > JMP                                                          ->18
   10     8  E > > CATCH                                                        'Exception', ->13
   11     9    >   GET_CLASS                                            ~6      !0
         10        CONCAT                                               ~7      'Exception+', ~6
         11        ECHO                                                         ~7
         12      > JMP                                                          ->18
   13    13  E > > CATCH                                                        'TypeException', ->16
   14    14    >   ECHO                                                         'TypeException'
         15      > JMP                                                          ->18
   16    16  E > > CATCH                                           last         'TypeError'
   17    17    >   ECHO                                                         'TypeError'
   18    18    > > RETURN                                                       1

Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMijr
function name:  bar
number of ops:  2
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1      > RETURN                                                       null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.4 ms | 3384 KiB | 13 Q