3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function() { //var_dump($this); return $this; }; var_dump($a); class A { public $b; public function c() { return function() { //var_dump($this); return $this; }; } } $z = new A(); $b = $z->c(); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/krVFF
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $z, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkrVFF%3A3%240'
          1        ASSIGN                                                   !0, ~3
    8     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   23     5        NEW                                              $6      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   24     8        INIT_METHOD_CALL                                         !1, 'c'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   26    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FkrVFF%3A3%240

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

End of function %00%7Bclosure%7D%2Fin%2FkrVFF%3A15%241

Class A:
Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/krVFF
function name:  c
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkrVFF%3A15%241'
   19     1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function c

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.19 ms | 1401 KiB | 15 Q