3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyMethod extends \ReflectionMethod { public function hasPrototype() { try { parent::getPrototype(); return true; } catch (\ReflectionException $e) { return false; } } public function getPrototype() { return $this->hasPrototype() ? parent::getPrototype() : "Method {$this->getName()} does not have a prototype"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Oi9NJ
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   1

Class MyMethod:
Function hasprototype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Oi9NJ
function name:  hasPrototype
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'getPrototype'
          1        DO_FCALL                                      0          
    8     2      > RETURN                                                   <true>
          3*       JMP                                                      ->6
   10     4  E > > CATCH                                       last         'ReflectionException'
   11     5    > > RETURN                                                   <false>
   13     6*     > RETURN                                                   null

End of function hasprototype

Function getprototype:
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 = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Oi9NJ
function name:  getPrototype
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                         'hasPrototype'
          1        DO_FCALL                                      0  $0      
          2      > JMPZ                                                     $0, ->7
          3    >   INIT_STATIC_METHOD_CALL                                  'getPrototype'
          4        DO_FCALL                                      0  $1      
          5        QM_ASSIGN                                        ~2      $1
          6      > JMP                                                      ->13
          7    >   ROPE_INIT                                     3  ~5      'Method+'
          8        INIT_METHOD_CALL                                         'getName'
          9        DO_FCALL                                      0  $3      
         10        ROPE_ADD                                      1  ~5      ~5, $3
         11        ROPE_END                                      2  ~4      ~5, '+does+not+have+a+prototype'
         12        QM_ASSIGN                                        ~2      ~4
         13    > > RETURN                                                   ~2
   17    14*     > RETURN                                                   null

End of function getprototype

End of class MyMethod.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.63 ms | 1386 KiB | 13 Q