3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'chat @julio "salut à toi" hey "1 2 3" hoho'; $str = '<?php ' . str_replace( '@', '*', $str ); $a=token_get_all($str); array_shift( $a ); $a = array_column( $a, 1 ); $a = array_map( 'trim', $a ); $a = array_filter( $a ); $a = array_values( $a ); list( $subcommand, $user, $args ) = array_merge( array_splice( $a, 0, 2 ), array_splice( $a, 2 ) ); var_dump($subcommand); var_dump($user); var_dump($args);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TImc9
function name:  (null)
number of ops:  63
compiled vars:  !0 = $str, !1 = $a, !2 = $subcommand, !3 = $user, !4 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'chat+%40julio+%22salut+%C3%A0+toi%22+hey+%221+2+3%22+hoho'
    3     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%40'
          3        SEND_VAL                                                 '%2A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        CONCAT                                           ~7      '%3C%3Fphp+', $6
          7        ASSIGN                                                   !0, ~7
    4     8        INIT_FCALL                                               'token_get_all'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !1, $9
    5    12        INIT_FCALL                                               'array_shift'
         13        SEND_REF                                                 !1
         14        DO_ICALL                                                 
    6    15        INIT_FCALL                                               'array_column'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 1
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !1, $12
    7    20        INIT_FCALL                                               'array_map'
         21        SEND_VAL                                                 'trim'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $14     
         24        ASSIGN                                                   !1, $14
    8    25        INIT_FCALL                                               'array_filter'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $16     
         28        ASSIGN                                                   !1, $16
    9    29        INIT_FCALL                                               'array_values'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $18     
         32        ASSIGN                                                   !1, $18
   10    33        INIT_FCALL                                               'array_merge'
         34        INIT_FCALL                                               'array_splice'
         35        SEND_REF                                                 !1
         36        SEND_VAL                                                 0
         37        SEND_VAL                                                 2
         38        DO_ICALL                                         $20     
         39        SEND_VAR                                                 $20
         40        INIT_FCALL                                               'array_splice'
         41        SEND_REF                                                 !1
         42        SEND_VAL                                                 2
         43        DO_ICALL                                         $21     
         44        SEND_VAR                                                 $21
         45        DO_ICALL                                         $22     
         46        FETCH_LIST_R                                     $23     $22, 0
         47        ASSIGN                                                   !2, $23
         48        FETCH_LIST_R                                     $25     $22, 1
         49        ASSIGN                                                   !3, $25
         50        FETCH_LIST_R                                     $27     $22, 2
         51        ASSIGN                                                   !4, $27
         52        FREE                                                     $22
   12    53        INIT_FCALL                                               'var_dump'
         54        SEND_VAR                                                 !2
         55        DO_ICALL                                                 
   13    56        INIT_FCALL                                               'var_dump'
         57        SEND_VAR                                                 !3
         58        DO_ICALL                                                 
   14    59        INIT_FCALL                                               'var_dump'
         60        SEND_VAR                                                 !4
         61        DO_ICALL                                                 
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.2 ms | 1400 KiB | 33 Q