3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_emoji($str){ function empic($h){ $p=dechex(str_replace(array('&#',';'),'',$h)); return '<img src="_POST[face]'.$p.'.png" alt="'.$h.'" class="smiley" />'; }; $str=preg_replace('#(\&\#[0-9]{6}\;)#ie','empic("\\1")',$str); return $str; }; //$com_print=str_emoji('aaa&#128027;&#128013;bbb'); var_dump(empic(123));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3RPsk
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL_BY_NAME                                       'empic'
          2        SEND_VAL_EX                                              123
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function str_emoji:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3RPsk
function name:  str_emoji
number of ops:  10
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_FUNCTION                                         'empic'
    8     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%23%28%5C%26%5C%23%5B0-9%5D%7B6%7D%5C%3B%29%23ie'
          4        SEND_VAL                                                 'empic%28%22%5C1%22%29'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $1      
          7        ASSIGN                                                   !0, $1
    9     8      > RETURN                                                   !0
   10     9*     > RETURN                                                   null

End of function str_emoji

Function %00empic%2Fin%2F3RPsk%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3RPsk
function name:  empic
number of ops:  16
compiled vars:  !0 = $h, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'dechex'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        ASSIGN                                                   !1, $3
    6    10        CONCAT                                           ~5      '%3Cimg+src%3D%22_POST%5Bface%5D', !1
         11        CONCAT                                           ~6      ~5, '.png%22+alt%3D%22'
         12        CONCAT                                           ~7      ~6, !0
         13        CONCAT                                           ~8      ~7, '%22+class%3D%22smiley%22+%2F%3E'
         14      > RETURN                                                   ~8
    7    15*     > RETURN                                                   null

End of function %00empic%2Fin%2F3RPsk%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
274.02 ms | 1396 KiB | 22 Q