3v4l.org

run code in 500+ PHP versions simultaneously
<?php function WTF($arg) { // Payload: count the number of its own calls global $c; ++$c; // payload could be anything // use global to extract values global $collection; if (!isset($collection)) { $collection = []; } $collection[] = $arg; // also possible // $r = __FUNCTION__; // return $r(...) return __FUNCTION__; } WTF(1)(2)(4)(8)(16); echo "WTF was called $c times\n"; print_r($collection); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HAPDR
function name:  (null)
number of ops:  23
compiled vars:  !0 = $c, !1 = $collection
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                                   'wtf'
          1        SEND_VAL                                                     1
          2        DO_FCALL                                          0  $2      
          3        INIT_DYNAMIC_CALL                                            $2
          4        SEND_VAL_EX                                                  2
          5        DO_FCALL                                          0  $3      
          6        INIT_DYNAMIC_CALL                                            $3
          7        SEND_VAL_EX                                                  4
          8        DO_FCALL                                          0  $4      
          9        INIT_DYNAMIC_CALL                                            $4
         10        SEND_VAL_EX                                                  8
         11        DO_FCALL                                          0  $5      
         12        INIT_DYNAMIC_CALL                                            $5
         13        SEND_VAL_EX                                                  16
         14        DO_FCALL                                          0          
   23    15        ROPE_INIT                                         3  ~8      'WTF+was+called+'
         16        ROPE_ADD                                          1  ~8      ~8, !0
         17        ROPE_END                                          2  ~7      ~8, '+times%0A'
         18        ECHO                                                         ~7
   24    19        INIT_FCALL                                                   'print_r'
         20        SEND_VAR                                                     !1
         21        DO_ICALL                                                     
   26    22      > RETURN                                                       1

Function wtf:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/HAPDR
function name:  WTF
number of ops:  12
compiled vars:  !0 = $arg, !1 = $c, !2 = $collection
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        BIND_GLOBAL                                                  !1, 'c'
    6     2        PRE_INC                                                      !1
   10     3        BIND_GLOBAL                                                  !2, 'collection'
   11     4        ISSET_ISEMPTY_CV                                     ~4      !2
          5        BOOL_NOT                                             ~5      ~4
          6      > JMPZ                                                         ~5, ->8
          7    >   ASSIGN                                                       !2, <array>
   12     8    >   ASSIGN_DIM                                                   !2
          9        OP_DATA                                                      !0
   18    10      > RETURN                                                       'WTF'
   19    11*     > RETURN                                                       null

End of function wtf

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
151.78 ms | 1482 KiB | 15 Q