3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'TEST'; $a = function($value = 'value') use($test) { echo $value . ' ' . $test; }; class A { public function doCallback($callback, array $params = array()) { $callbacks = array( $callback, $params ); call_user_func_array($callbacks[0], $callbacks[1]); } } $objA = new A(); $objA->doCallback($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q6UUA
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test, !1 = $a, !2 = $objA
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'TEST'
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fq6UUA%3A4%240'
          2        BIND_LEXICAL                                             ~4, !0
          3        ASSIGN                                                   !1, ~4
   17     4        NEW                                              $6      'A'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $6
   18     7        INIT_METHOD_CALL                                         !2, 'doCallback'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fq6UUA%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q6UUA
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $value, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      'value'
          1        BIND_STATIC                                              !1
    5     2        CONCAT                                           ~2      !0, '+'
          3        CONCAT                                           ~3      ~2, !1
          4        ECHO                                                     ~3
    6     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fq6UUA%3A4%240

Class A:
Function docallback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q6UUA
function name:  doCallback
number of ops:  12
compiled vars:  !0 = $callback, !1 = $params, !2 = $callbacks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
   11     2        INIT_ARRAY                                       ~3      !0
          3        ADD_ARRAY_ELEMENT                                ~3      !1
   10     4        ASSIGN                                                   !2, ~3
   14     5        FETCH_DIM_R                                      ~5      !2, 0
          6        INIT_USER_CALL                                0          'call_user_func_array', ~5
          7        FETCH_DIM_R                                      ~6      !2, 1
          8        SEND_ARRAY                                               ~6
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0          
   15    11      > RETURN                                                   null

End of function docallback

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.54 ms | 1395 KiB | 13 Q