3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function other($asdf) { echo "Other: $asdf"; return true; } public function fn() { static $a = array('a', 'b', 'c', 'd'); $self = $this; return array_filter($a, function($n) use ($self) { $self->other($n); return true; }); } } $a = new A(); var_dump($a->fn());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QpgW
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'fn'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F6QpgW%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QpgW
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $n, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   16     2        INIT_METHOD_CALL                                         !1, 'other'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   17     5      > RETURN                                                   <true>
   18     6*     > RETURN                                                   null

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

Class A:
Function other:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QpgW
function name:  other
number of ops:  6
compiled vars:  !0 = $asdf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'Other%3A+', !0
          3        ECHO                                                     ~1
    8     4      > RETURN                                                   <true>
    9     5*     > RETURN                                                   null

End of function other

Function fn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6QpgW
function name:  fn
number of ops:  11
compiled vars:  !0 = $a, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   BIND_STATIC                                              !0
   14     1        FETCH_THIS                                       ~2      
          2        ASSIGN                                                   !1, ~2
   15     3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6QpgW%3A15%240'
          6        BIND_LEXICAL                                             ~4, !1
   18     7        SEND_VAL                                                 ~4
          8        DO_ICALL                                         $5      
          9      > RETURN                                                   $5
   19    10*     > RETURN                                                   null

End of function fn

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.18 ms | 1400 KiB | 17 Q