3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $c = 1; function b() { $a = function () { var_dump($this); }; $a(); $a = static function () { var_dump($this); }; $a(); } static function c() { $a = function () { var_dump($this); }; $a(); $a = static function () { var_dump($this); }; $a(); } static function d() { var_dump(array_map(function($a) { return $a; }, array(1,2,3))); } } (new A)->b(); A::b(); (new A)->c(); A::c(); (new A)->d(); A::d();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $0      'A'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'b'
          3        DO_FCALL                                      0          
   36     4        INIT_STATIC_METHOD_CALL                                  'A', 'b'
          5        DO_FCALL                                      0          
   37     6        NEW                                              $4      'A'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $4, 'c'
          9        DO_FCALL                                      0          
   38    10        INIT_STATIC_METHOD_CALL                                  'A', 'c'
         11        DO_FCALL                                      0          
   39    12        NEW                                              $8      'A'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $8, 'd'
         15        DO_FCALL                                      0          
   40    16        INIT_STATIC_METHOD_CALL                                  'A', 'd'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FUvKHE%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUvKHE%3A7%240

Function %00%7Bclosure%7D%2Fin%2FUvKHE%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   14     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUvKHE%3A12%241

Function %00%7Bclosure%7D%2Fin%2FUvKHE%3A19%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUvKHE%3A19%242

Function %00%7Bclosure%7D%2Fin%2FUvKHE%3A24%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   26     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUvKHE%3A24%243

Function %00%7Bclosure%7D%2Fin%2FUvKHE%3A31%244:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FUvKHE%3A31%244

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  b
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUvKHE%3A7%240'
          1        ASSIGN                                                   !0, ~1
   10     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   12     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUvKHE%3A12%241'
          5        ASSIGN                                                   !0, ~4
   15     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   16     8      > RETURN                                                   null

End of function b

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  c
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUvKHE%3A19%242'
          1        ASSIGN                                                   !0, ~1
   22     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   24     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUvKHE%3A24%243'
          5        ASSIGN                                                   !0, ~4
   27     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0          
   28     8      > RETURN                                                   null

End of function c

Function d:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UvKHE
function name:  d
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FUvKHE%3A31%244'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 <array>
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
   32     8      > RETURN                                                   null

End of function d

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.5 ms | 1404 KiB | 17 Q