3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; public function call($call) { $call->bindTo($this, $this); $call(); } } $a = new A; $a->a = 'Foo'; $a->call(function () { echo $this->a; } );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WTk0J
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  'Foo'
   15     5        INIT_METHOD_CALL                                         !0, 'call'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWTk0J%3A15%240'
          7        SEND_VAL_EX                                              ~5
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FWTk0J%3A15%240

Class A:
Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WTk0J
function name:  call
number of ops:  10
compiled vars:  !0 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_METHOD_CALL                                         !0, 'bindTo'
          2        FETCH_THIS                                       $1      
          3        SEND_VAR_EX                                              $1
          4        FETCH_THIS                                       $2      
          5        SEND_VAR_EX                                              $2
          6        DO_FCALL                                      0          
    8     7        INIT_DYNAMIC_CALL                                        !0
          8        DO_FCALL                                      0          
    9     9      > RETURN                                                   null

End of function call

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.37 ms | 1395 KiB | 13 Q