3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2F8o2XA%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o2XA
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        GET_CLASS                                        ~1      ~0
          2        ECHO                                                     ~1
          3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8o2XA%3A13%240

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

End of function call

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.89 ms | 1385 KiB | 13 Q