3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { const BAZ = 37; public static function f() { return static function () { var_dump(static::BAZ); var_dump(static::class); }; } } $f = A::f(); $f(); $g = $f->bindTo(null, A::class); $g(); $foo = static function () { var_dump(static::BAZ); var_dump(static::class); }; $bar = $foo->bindTo(null, A::class); $bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XO0bZ
function name:  (null)
number of ops:  22
compiled vars:  !0 = $f, !1 = $g, !2 = $foo, !3 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'f'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
   14     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   16     5        INIT_METHOD_CALL                                         !0, 'bindTo'
          6        SEND_VAL_EX                                              null
          7        SEND_VAL_EX                                              'A'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   17    10        INIT_DYNAMIC_CALL                                        !1
         11        DO_FCALL                                      0          
   19    12        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         13        ASSIGN                                                   !2, ~10
   24    14        INIT_METHOD_CALL                                         !2, 'bindTo'
         15        SEND_VAL_EX                                              null
         16        SEND_VAL_EX                                              'A'
         17        DO_FCALL                                      0  $12     
         18        ASSIGN                                                   !3, $12
   25    19        INIT_DYNAMIC_CALL                                        !3
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XO0bZ
function name:  {closure}
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_CONSTANT                             ~0      'BAZ'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4        INIT_FCALL                                               'var_dump'
          5        FETCH_CLASS_NAME                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   22     8      > RETURN                                                   null

End of Dynamic Function 0

Class A:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XO0bZ
function name:  f
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                          ~0      [0]
    9     1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XO0bZ
function name:  {closure}
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_CLASS_CONSTANT                             ~0      'BAZ'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4        INIT_FCALL                                               'var_dump'
          5        FETCH_CLASS_NAME                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
    9     8      > RETURN                                                   null

End of Dynamic Function 0

End of function f

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.4 ms | 1441 KiB | 14 Q