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($com_print);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYgn6
function name:  (null)
number of ops:  8
compiled vars:  !0 = $com_print
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'str_emoji'
          1        SEND_VAL                                                 'aaa%26%23128027%3B%26%23128013%3Bbbb'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   12     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function str_emoji:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYgn6
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%2FIYgn6%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYgn6
function name:  empic
number of ops:  19
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        FETCH_R                      global              ~5      '_POST'
         11        FETCH_DIM_R                                      ~6      ~5, 'face'
         12        CONCAT                                           ~7      '%3Cimg+src%3D%22', ~6
         13        CONCAT                                           ~8      ~7, !1
         14        CONCAT                                           ~9      ~8, '.png%22+alt%3D%22'
         15        CONCAT                                           ~10     ~9, !0
         16        CONCAT                                           ~11     ~10, '%22+class%3D%22smiley%22+%2F%3E'
         17      > RETURN                                                   ~11
    7    18*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.61 ms | 1403 KiB | 22 Q