3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function testMe() { $func = function () { $this->callMe(); }; $func(); } private function callMe() { print "Called\n"; } } try { $a = new A(); $a->testMe(); } catch (Exception $e) { print "Getted exception: .".get_class($e).' msg: '.$e->getMessage().PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
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/RRDca
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        INIT_METHOD_CALL                                         !0, 'testMe'
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->15
   19     6  E > > CATCH                                       last         'Exception'
   20     7    >   GET_CLASS                                        ~6      !1
          8        CONCAT                                           ~7      'Getted+exception%3A+.', ~6
          9        CONCAT                                           ~8      ~7, '+msg%3A+'
         10        INIT_METHOD_CALL                                         !1, 'getMessage'
         11        DO_FCALL                                      0  $9      
         12        CONCAT                                           ~10     ~8, $9
         13        CONCAT                                           ~11     ~10, '%0A'
         14        ECHO                                                     ~11
   21    15    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FRRDca%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRDca
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'callMe'
          2        DO_FCALL                                      0          
    7     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRRDca%3A5%240

Class A:
Function testme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRDca
function name:  testMe
number of ops:  5
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRRDca%3A5%240'
          1        ASSIGN                                                   !0, ~1
    8     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function testme

Function callme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRDca
function name:  callMe
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'Called%0A'
   13     1      > RETURN                                                   null

End of function callme

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.9 ms | 1399 KiB | 13 Q