3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['id'] = '5'; function non_literal(string $a): string { $unpacked = unpack('C*', $a); foreach ($unpacked as $i => $v) { $unpacked[$i] = (int)($v & 0xff); } return pack(str_repeat('C', count($unpacked)), ...$unpacked); } $literal = $_GET['id']; var_dump( is_literal($literal), is_literal(non_literal($literal)) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8Z2GW
function name:  (null)
number of ops:  20
compiled vars:  !0 = $literal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $1      '_GET'
          1        ASSIGN_DIM                                               $1, 'id'
          2        OP_DATA                                                  '5'
   14     3        FETCH_R                      global              ~3      '_GET'
          4        FETCH_DIM_R                                      ~4      ~3, 'id'
          5        ASSIGN                                                   !0, ~4
   16     6        INIT_FCALL                                               'var_dump'
   17     7        INIT_FCALL_BY_NAME                                       'is_literal'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
   18    11        INIT_FCALL_BY_NAME                                       'is_literal'
         12        INIT_FCALL                                               'non_literal'
         13        SEND_VAR                                                 !0
         14        DO_FCALL                                      0  $7      
         15        SEND_VAR_NO_REF_EX                                       $7
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
   19    19      > RETURN                                                   1

Function non_literal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/8Z2GW
function name:  non_literal
number of ops:  29
compiled vars:  !0 = $a, !1 = $unpacked, !2 = $v, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'unpack'
          2        SEND_VAL                                                 'C%2A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    7     6      > FE_RESET_R                                       $6      !1, ->14
          7    > > FE_FETCH_R                                       ~7      $6, !2, ->14
          8    >   ASSIGN                                                   !3, ~7
    8     9        BW_AND                                           ~10     !2, 255
         10        CAST                                          4  ~11     ~10
         11        ASSIGN_DIM                                               !1, !3
         12        OP_DATA                                                  ~11
    7    13      > JMP                                                      ->7
         14    >   FE_FREE                                                  $6
   11    15        INIT_FCALL                                               'pack'
         16        INIT_FCALL                                               'str_repeat'
         17        SEND_VAL                                                 'C'
         18        COUNT                                            ~12     !1
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        SEND_VAR                                                 $13
         22        SEND_UNPACK                                              !1
         23        CHECK_UNDEF_ARGS                                         
         24        DO_ICALL                                         $14     
         25        VERIFY_RETURN_TYPE                                       $14
         26      > RETURN                                                   $14
   12    27*       VERIFY_RETURN_TYPE                                       
         28*     > RETURN                                                   null

End of function non_literal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.37 ms | 1407 KiB | 22 Q