3v4l.org

run code in 300+ 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 = 16
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/coOMs
function name:  getFileName
number of ops:  18
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, ->16
   19     7    >   NEW                                              $5      'Exception'
          8        INIT_FCALL                                               'sprintf'
          9        SEND_VAL                                                 'The+file+for+this+%25s+was+not+found.'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        SEND_VAR_NO_REF_EX                                       $6
         13        DO_FCALL                                      0          
         14      > THROW                                         0          $5
         15*       JMP                                                      ->17
   21    16    > > RETURN                                                   !1
   23    17*     > RETURN                                                   null

End of function getfilename

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152 ms | 1400 KiB | 19 Q