3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { private function jwt_sign(array $payload) { return $payload; } } $demo = new Demo; $method = new \ReflectionMethod('Demo', 'jwt_sign'); $method->setAccessible(true); $arg1 = ['payload' => 'ABC']; $jwt = $method->invokeArgs($demo, [$arg1]); //$jwt = $method->invoke($demo); var_dump($jwt);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gtLJL
function name:  (null)
number of ops:  22
compiled vars:  !0 = $demo, !1 = $method, !2 = $arg1, !3 = $jwt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $4      'Demo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   12     3        NEW                                              $7      'ReflectionMethod'
          4        SEND_VAL_EX                                              'Demo'
          5        SEND_VAL_EX                                              'jwt_sign'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   13     8        INIT_METHOD_CALL                                         !1, 'setAccessible'
          9        SEND_VAL_EX                                              <true>
         10        DO_FCALL                                      0          
   15    11        ASSIGN                                                   !2, <array>
   17    12        INIT_METHOD_CALL                                         !1, 'invokeArgs'
         13        SEND_VAR_EX                                              !0
         14        INIT_ARRAY                                       ~12     !2
         15        SEND_VAL_EX                                              ~12
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !3, $13
   20    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class Demo:
Function jwt_sign:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gtLJL
function name:  jwt_sign
number of ops:  3
compiled vars:  !0 = $payload
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1      > RETURN                                                   !0
    7     2*     > RETURN                                                   null

End of function jwt_sign

End of class Demo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.32 ms | 1395 KiB | 15 Q