3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A { public function action() { try { $callback = function() { try { B::work(); } catch (Exception $e) { echo "1 ", __METHOD__; } }; $this->run($callback); } catch (Exception $e) { echo "2 ", __METHOD__; } } public function run($callback) { $callback(); } } class B extends A { public static function work() { try { throw new Exception("test"); } catch (Exception $e) { echo "3 ", __METHOD__; } } } $object = new B(); $object->action();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeAoq
function name:  (null)
number of ops:  6
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   35     3        INIT_METHOD_CALL                                         !0, 'action'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQeAoq%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeAoq
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'work'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->6
   10     3  E > > CATCH                                       last         'Exception'
   11     4    >   ECHO                                                     '1+'
          5        ECHO                                                     '%7Bclosure%7D'
   13     6    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQeAoq%3A7%240

Class A:
Function action:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeAoq
function name:  action
number of ops:  10
compiled vars:  !0 = $callback, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQeAoq%3A7%240'
          1        ASSIGN                                                   !0, ~2
   14     2        INIT_METHOD_CALL                                         'run'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->9
   15     6  E > > CATCH                                       last         'Exception'
   16     7    >   ECHO                                                     '2+'
          8        ECHO                                                     'A%3A%3Aaction'
   18     9    > > RETURN                                                   null

End of function action

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeAoq
function name:  run
number of ops:  4
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   22     3      > RETURN                                                   null

End of function run

End of class A.

Class B:
Function work:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) 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/QeAoq
function name:  work
number of ops:  9
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $1
          4*       JMP                                                      ->8
   29     5  E > > CATCH                                       last         'Exception'
   30     6    >   ECHO                                                     '3+'
          7        ECHO                                                     'B%3A%3Awork'
   32     8      > RETURN                                                   null

End of function work

Function action:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeAoq
function name:  action
number of ops:  10
compiled vars:  !0 = $callback, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQeAoq%3A7%240'
          1        ASSIGN                                                   !0, ~2
   14     2        INIT_METHOD_CALL                                         'run'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->9
   15     6  E > > CATCH                                       last         'Exception'
   16     7    >   ECHO                                                     '2+'
          8        ECHO                                                     'A%3A%3Aaction'
   18     9    > > RETURN                                                   null

End of function action

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeAoq
function name:  run
number of ops:  4
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   22     3      > RETURN                                                   null

End of function run

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.15 ms | 1399 KiB | 13 Q