3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'tacocat'; $code = ''; var_dump((function() { return 1; })()); for ($i = 0; isset($input[$i]); $i++) { $code .= $code ? '.' : ''; $code .= sprintf('$input[(function() use ($input) { for ($l = 0; isset($input[$l]); $l++) {} return $l - 1; })() - %u]', $i); } //for ($i = strlen($input) - 1; $i >= 0; $i--) { // $code .= ($code ? '.' : '') . sprintf('$input[%s]', $i); //} $code = sprintf('return %s;', $code); var_dump($code); var_dump(eval($code));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
Branch analysis from position: 10
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
Branch analysis from position: 10
filename:       /in/ArlvY
function name:  (null)
number of ops:  36
compiled vars:  !0 = $input, !1 = $code, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'tacocat'
    4     1        ASSIGN                                                   !1, ''
    6     2        INIT_FCALL                                               'var_dump'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FArlvY%3A6%240'
          4        INIT_DYNAMIC_CALL                                        ~5
          5        DO_FCALL                                      0  $6      
          6        SEND_VAR                                                 $6
          7        DO_ICALL                                                 
    8     8        ASSIGN                                                   !2, 0
          9      > JMP                                                      ->21
    9    10    > > JMPZ                                                     !1, ->13
         11    >   QM_ASSIGN                                        ~9      '.'
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~9      ''
         14    >   ASSIGN_OP                                     8          !1, ~9
   10    15        INIT_FCALL                                               'sprintf'
         16        SEND_VAL                                                 '%24input%5B%28function%28%29+use+%28%24input%29+%7B+for+%28%24l+%3D+0%3B+isset%28%24input%5B%24l%5D%29%3B+%24l%2B%2B%29+%7B%7D+return+%24l+-+1%3B+%7D%29%28%29+-+%25u%5D'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        ASSIGN_OP                                     8          !1, $11
    8    20        PRE_INC                                                  !2
         21    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, !2
         22      > JMPNZ                                                    ~14, ->10
   17    23    >   INIT_FCALL                                               'sprintf'
         24        SEND_VAL                                                 'return+%25s%3B'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !1, $15
   19    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
   20    31        INIT_FCALL                                               'var_dump'
         32        INCLUDE_OR_EVAL                                  $18     !1, EVAL
         33        SEND_VAR                                                 $18
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.5 ms | 1400 KiB | 17 Q