3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dummy { function __construct($input = array(1,2,3)) { $this->input = $input; } function run() { foreach($this->input as $key=>$value) { if($key == 2) throw new Exception('hello exception'); } } } function retry(Dummy $dum) { try { $dum->run(); } catch(Exception $e) { retry($dum); } } $dum = new Dummy; $dum->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EW82v
function name:  (null)
number of ops:  6
compiled vars:  !0 = $dum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Dummy'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        INIT_METHOD_CALL                                         !0, 'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function retry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
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/EW82v
function name:  retry
number of ops:  9
compiled vars:  !0 = $dum, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   20     1        INIT_METHOD_CALL                                         !0, 'run'
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->8
   21     4  E > > CATCH                                       last         'Exception'
   23     5    >   INIT_FCALL_BY_NAME                                       'retry'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   25     8    > > 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/EW82v
function name:  __construct
number of ops:  4
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      <array>
    5     1        ASSIGN_OBJ                                               'input'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

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

End of function run

End of class Dummy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.79 ms | 1399 KiB | 13 Q