3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dummy { public $input; function __construct($input = array(1,2,3)) { $this->input = $input; } function run($logged) { foreach($this->input as $key=>$value) { echo $value . " " .$logged."\n\n"; if($key == 2 && $logged == false) throw new Exception('hello exception'); } } } function retry(Dummy $dum, $logged = false) { try { $dum->run($logged); } catch(Exception $e) { // solve the exception if(!$logged) $logged = true; retry($dum, $logged); } } $dum = new Dummy; retry($dum, false);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Kkq3
function name:  (null)
number of ops:  8
compiled vars:  !0 = $dum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'Dummy'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   38     3        INIT_FCALL                                               'retry'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <false>
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function retry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/1Kkq3
function name:  retry
number of ops:  15
compiled vars:  !0 = $dum, !1 = $logged, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
   25     2        INIT_METHOD_CALL                                         !0, 'run'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->14
   26     6  E > > CATCH                                       last         'Exception'
   29     7    >   BOOL_NOT                                         ~4      !1
          8      > JMPZ                                                     ~4, ->10
   30     9    >   ASSIGN                                                   !1, <true>
   32    10    >   INIT_FCALL_BY_NAME                                       'retry'
         11        SEND_VAR_EX                                              !0
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
   34    14    > > RETURN                                                   null

End of function retry

Class Dummy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Kkq3
function name:  __construct
number of ops:  4
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      <array>
    7     1        ASSIGN_OBJ                                               'input'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

Function run:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/1Kkq3
function name:  run
number of ops:  21
compiled vars:  !0 = $logged, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_R                                      ~3      'input'
          2      > FE_RESET_R                                       $4      ~3, ->19
          3    > > FE_FETCH_R                                       ~5      $4, !1, ->19
          4    >   ASSIGN                                                   !2, ~5
   14     5        CONCAT                                           ~7      !1, '+'
          6        CONCAT                                           ~8      ~7, !0
          7        CONCAT                                           ~9      ~8, '%0A%0A'
          8        ECHO                                                     ~9
   15     9        IS_EQUAL                                         ~10     !2, 2
         10      > JMPZ_EX                                          ~10     ~10, ->13
         11    >   BOOL_NOT                                         ~11     !0
         12        BOOL                                             ~10     ~11
         13    > > JMPZ                                                     ~10, ->18
         14    >   NEW                                              $12     'Exception'
         15        SEND_VAL_EX                                              'hello+exception'
         16        DO_FCALL                                      0          
         17      > THROW                                         0          $12
   12    18    > > JMP                                                      ->3
         19    >   FE_FREE                                                  $4
   17    20      > RETURN                                                   null

End of function run

End of class Dummy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.62 ms | 1402 KiB | 14 Q