3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FMPjth%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPjth
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   11     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMPjth%3A9%240

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPjth
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMPjth%3A9%240'
          1        ASSIGN_OBJ                                               'callback'
   11     2        OP_DATA                                                  ~1
   12     3      > RETURN                                                   null

End of function __construct

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

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.41 ms | 1396 KiB | 15 Q