3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $callback; public function test() { call_user_func($this->callback, new Exception); } } class Bar { public function trololol() { $bar = new Bar; $bar->callback = function (Exception $e) { var_dump($this); }; $bar->test(); } } (new Bar)->trololol();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJh7Q
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $0      'Bar'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'trololol'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FAJh7Q%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJh7Q
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   21     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAJh7Q%3A19%240

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJh7Q
function name:  test
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'callback'
          1        INIT_USER_CALL                                1          'call_user_func', ~0
          2        NEW                                              $1      'Exception'
          3        DO_FCALL                                      0          
          4        SEND_USER                                                $1
          5        DO_FCALL                                      0          
   10     6      > RETURN                                                   null

End of function test

End of class Foo.

Class Bar:
Function trololol:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AJh7Q
function name:  trololol
number of ops:  9
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAJh7Q%3A19%240'
          4        ASSIGN_OBJ                                               !0, 'callback'
   21     5        OP_DATA                                                  ~5
   23     6        INIT_METHOD_CALL                                         !0, 'test'
          7        DO_FCALL                                      0          
   24     8      > RETURN                                                   null

End of function trololol

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.98 ms | 1396 KiB | 15 Q