3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function tryInclude() { try { require $this->getFileName('include'); } catch (Exception $e) { printf("Catched Exception: %s", $e->getMessage()); } } private function getFileName($action) { $file = '/unknown/path/to/file'; if (false === file_exists($file)) { throw new Exception(sprintf('The file for this %s was not found.', $action)); } else { return $file; } } } $instance = new Foo; $instance->tryInclude();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/coOMs
function name:  (null)
number of ops:  6
compiled vars:  !0 = $instance
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   27     3        INIT_METHOD_CALL                                             !0, 'tryInclude'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

Class Foo:
Function tryinclude:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
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/coOMs
function name:  tryInclude
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_METHOD_CALL                                             'getFileName'
          1        SEND_VAL_EX                                                  'include'
          2        DO_FCALL                                          0  $1      
          3        INCLUDE_OR_EVAL                                              $1, REQUIRE
          4      > JMP                                                          ->12
    9     5  E > > CATCH                                           last         'Exception'
   10     6    >   INIT_FCALL                                                   'printf'
          7        SEND_VAL                                                     'Catched+Exception%3A+%25s'
          8        INIT_METHOD_CALL                                             !0, 'getMessage'
          9        DO_FCALL                                          0  $3      
         10        SEND_VAR                                                     $3
         11        DO_ICALL                                                     
   12    12    > > RETURN                                                       null

End of function tryinclude

Function getfilename:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/coOMs
function name:  getFileName
number of ops:  17
compiled vars:  !0 = $action, !1 = $file
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   16     1        ASSIGN                                                       !1, '%2Funknown%2Fpath%2Fto%2Ffile'
   18     2        INIT_FCALL                                                   'file_exists'
          3        SEND_VAR                                                     !1
          4        DO_ICALL                                             $3      
          5        TYPE_CHECK                                        4          $3
          6      > JMPZ                                                         ~4, ->15
   19     7    >   NEW                                                  $5      'Exception'
          8        ROPE_INIT                                         3  ~7      'The+file+for+this+'
          9        ROPE_ADD                                          1  ~7      ~7, !0
         10        ROPE_END                                          2  ~6      ~7, '+was+not+found.'
         11        SEND_VAL_EX                                                  ~6
         12        DO_FCALL                                          0          
         13      > THROW                                             0          $5
   18    14*       JMP                                                          ->16
   21    15    > > RETURN                                                       !1
   23    16*     > RETURN                                                       null

End of function getfilename

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
226.2 ms | 2927 KiB | 15 Q