3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function getStatic() { return function () { }; } public function getNoStatic() { return function () { }; } } $a = new A; $fs = A::getStatic(); $fns = $a->getNoStatic(); var_dump($fs->is_static); // true var_dump($fns->is_static); // false
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haOEe
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $fs, !2 = $fns
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $3      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   17     3        INIT_STATIC_METHOD_CALL                                  'A', 'getStatic'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   18     6        INIT_METHOD_CALL                                         !0, 'getNoStatic'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   20     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~10     !1, 'is_static'
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                                 
   21    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~12     !2, 'is_static'
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FhaOEe%3A6%240

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

End of function %00%7Bclosure%7D%2Fin%2FhaOEe%3A11%241

Class A:
Function getstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haOEe
function name:  getStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhaOEe%3A6%240'
          1      > RETURN                                                   ~0
    7     2*     > RETURN                                                   null

End of function getstatic

Function getnostatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haOEe
function name:  getNoStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhaOEe%3A11%241'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function getnostatic

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.79 ms | 1400 KiB | 15 Q