3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myGlobalFunction() { } class MyClass { public static function myStaticMethod() { echo "I don't even"; } } $r1 = new ReflectionFunction('myGlobalFunction'); $c1 = $r1->getClosure(); $r2 = new ReflectionMethod('MyClass', 'myStaticMethod'); $c2 = $r2->getClosure(null); $c1->bindTo(new stdClass()); $r3 = new ReflectionFunction($c2); if ($r3->getClosureThis()) { $f3 = $c2->bindTo(new stdClass()); } else{ $f3 = $c2->bindTo(null); } $c1(); $f3();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 35
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7cVF
function name:  (null)
number of ops:  44
compiled vars:  !0 = $r1, !1 = $c1, !2 = $r2, !3 = $c2, !4 = $r3, !5 = $f3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $6      'ReflectionFunction'
          1        SEND_VAL_EX                                              'myGlobalFunction'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
   19     4        INIT_METHOD_CALL                                         !0, 'getClosure'
          5        DO_FCALL                                      0  $9      
          6        ASSIGN                                                   !1, $9
   21     7        NEW                                              $11     'ReflectionMethod'
          8        SEND_VAL_EX                                              'MyClass'
          9        SEND_VAL_EX                                              'myStaticMethod'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
   22    12        INIT_METHOD_CALL                                         !2, 'getClosure'
         13        SEND_VAL_EX                                              null
         14        DO_FCALL                                      0  $14     
         15        ASSIGN                                                   !3, $14
   24    16        INIT_METHOD_CALL                                         !1, 'bindTo'
         17        NEW                                              $16     'stdClass'
         18        DO_FCALL                                      0          
         19        SEND_VAR_NO_REF_EX                                       $16
         20        DO_FCALL                                      0          
   25    21        NEW                                              $19     'ReflectionFunction'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !4, $19
   27    25        INIT_METHOD_CALL                                         !4, 'getClosureThis'
         26        DO_FCALL                                      0  $22     
         27      > JMPZ                                                     $22, ->35
   28    28    >   INIT_METHOD_CALL                                         !3, 'bindTo'
         29        NEW                                              $23     'stdClass'
         30        DO_FCALL                                      0          
         31        SEND_VAR_NO_REF_EX                                       $23
         32        DO_FCALL                                      0  $25     
         33        ASSIGN                                                   !5, $25
         34      > JMP                                                      ->39
   31    35    >   INIT_METHOD_CALL                                         !3, 'bindTo'
         36        SEND_VAL_EX                                              null
         37        DO_FCALL                                      0  $27     
         38        ASSIGN                                                   !5, $27
   34    39    >   INIT_DYNAMIC_CALL                                        !1
         40        DO_FCALL                                      0          
   35    41        INIT_DYNAMIC_CALL                                        !5
         42        DO_FCALL                                      0          
         43      > RETURN                                                   1

Function myglobalfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7cVF
function name:  myGlobalFunction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function myglobalfunction

Class MyClass:
Function mystaticmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7cVF
function name:  myStaticMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'I+don%27t+even'
   14     1      > RETURN                                                   null

End of function mystaticmethod

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.27 ms | 1399 KiB | 13 Q