3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeEmoji($text) { $clean_text = ""; // Match Emoticons $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; $clean_text = preg_replace($regexEmoticons, '', $text); // Match Miscellaneous Symbols and Pictographs $regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u'; $clean_text = preg_replace($regexSymbols, '', $clean_text); // Match Transport And Map Symbols $regexTransport = '/[\x{1F680}-\x{1F6FF}]/u'; $clean_text = preg_replace($regexTransport, '', $clean_text); // Match Miscellaneous Symbols $regexMisc = '/[\x{2600}-\x{26FF}]/u'; $clean_text = preg_replace($regexMisc, '', $clean_text); // Match Dingbats $regexDingbats = '/[\x{2700}-\x{27BF}]/u'; $clean_text = preg_replace($regexDingbats, '', $clean_text); return $clean_text; } echo "\xF0\x9F\x98\x81"; echo removeEmoji("\xF0\x9F\x98\x81");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g5q3a
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   ECHO                                                     '%F0%9F%98%81'
   31     1        INIT_FCALL                                               'removeemoji'
          2        SEND_VAL                                                 '%F0%9F%98%81'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function removeemoji:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g5q3a
function name:  removeEmoji
number of ops:  39
compiled vars:  !0 = $text, !1 = $clean_text, !2 = $regexEmoticons, !3 = $regexSymbols, !4 = $regexTransport, !5 = $regexMisc, !6 = $regexDingbats
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    8     2        ASSIGN                                                   !2, '%2F%5B%5Cx%7B1F600%7D-%5Cx%7B1F64F%7D%5D%2Fu'
    9     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !2
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !1, $9
   12     9        ASSIGN                                                   !3, '%2F%5B%5Cx%7B1F300%7D-%5Cx%7B1F5FF%7D%5D%2Fu'
   13    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAR                                                 !3
         12        SEND_VAL                                                 ''
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !1, $12
   16    16        ASSIGN                                                   !4, '%2F%5B%5Cx%7B1F680%7D-%5Cx%7B1F6FF%7D%5D%2Fu'
   17    17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAR                                                 !4
         19        SEND_VAL                                                 ''
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $15     
         22        ASSIGN                                                   !1, $15
   20    23        ASSIGN                                                   !5, '%2F%5B%5Cx%7B2600%7D-%5Cx%7B26FF%7D%5D%2Fu'
   21    24        INIT_FCALL                                               'preg_replace'
         25        SEND_VAR                                                 !5
         26        SEND_VAL                                                 ''
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !1, $18
   24    30        ASSIGN                                                   !6, '%2F%5B%5Cx%7B2700%7D-%5Cx%7B27BF%7D%5D%2Fu'
   25    31        INIT_FCALL                                               'preg_replace'
         32        SEND_VAR                                                 !6
         33        SEND_VAL                                                 ''
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                         $21     
         36        ASSIGN                                                   !1, $21
   27    37      > RETURN                                                   !1
   28    38*     > RETURN                                                   null

End of function removeemoji

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.28 ms | 1403 KiB | 16 Q