3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strip_accents($string) { $patterns = explode(",", '/à/,/á/,/â/,/ã/,/ä/,/ç/,/è/,/é/,/ê/,/ë/,/ì/,/í/,/î/,/ï/,/ñ/,/ò/,/ó/,/ô/,/õ/,/ö/,/ù/,/ú/,/û/,/ü/,/ý/,/ÿ/,/À/,/Á/,/Â/,/Ã/,/Ä/,/Ç/,/È/,/É/,/Ê/,/Ë/,/Ì/,/Í/,/Î/,/Ï/,/Ñ/,/Ò/,/Ó/,/Ô/,/Õ/,/Ö/,/Ù/,/Ú/,/Û/,/Ü/,/Ý/'); $replace = explode(",", 'a,a,a,a,a,c,e,e,e,e,i,i,i,i,n,o,o,o,o,o,u,u,u,u,y,y,A,A,A,A,A,C,E,E,E,E,I,I,I,I,N,O,O,O,O,O,U,U,U,U,Y'); $new_string = preg_replace($patterns, $replace, $string); return $new_string; } $a = strip_accents('/á/,/â/,/ã/,/ä/,/ç/,/è/,/é/,/ê/,/ë/,/ì/,/í/,/î/,/ï/,/ñ/,/ò/,/ó/,/ô/,/õ/,/ö/,/ù/,/ú/,/û/'); echo $a ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/psmNM
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'strip_accents'
          1        SEND_VAL                                                 '%2F%C3%A1%2F%2C%2F%C3%A2%2F%2C%2F%C3%A3%2F%2C%2F%C3%A4%2F%2C%2F%C3%A7%2F%2C%2F%C3%A8%2F%2C%2F%C3%A9%2F%2C%2F%C3%AA%2F%2C%2F%C3%AB%2F%2C%2F%C3%AC%2F%2C%2F%C3%AD%2F%2C%2F%C3%AE%2F%2C%2F%C3%AF%2F%2C%2F%C3%B1%2F%2C%2F%C3%B2%2F%2C%2F%C3%B3%2F%2C%2F%C3%B4%2F%2C%2F%C3%B5%2F%2C%2F%C3%B6%2F%2C%2F%C3%B9%2F%2C%2F%C3%BA%2F%2C%2F%C3%BB%2F'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   16     4        ECHO                                                     !0
          5      > RETURN                                                   1

Function strip_accents:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/psmNM
function name:  strip_accents
number of ops:  19
compiled vars:  !0 = $string, !1 = $patterns, !2 = $replace, !3 = $new_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAL                                                 '%2F%C3%A0%2F%2C%2F%C3%A1%2F%2C%2F%C3%A2%2F%2C%2F%C3%A3%2F%2C%2F%C3%A4%2F%2C%2F%C3%A7%2F%2C%2F%C3%A8%2F%2C%2F%C3%A9%2F%2C%2F%C3%AA%2F%2C%2F%C3%AB%2F%2C%2F%C3%AC%2F%2C%2F%C3%AD%2F%2C%2F%C3%AE%2F%2C%2F%C3%AF%2F%2C%2F%C3%B1%2F%2C%2F%C3%B2%2F%2C%2F%C3%B3%2F%2C%2F%C3%B4%2F%2C%2F%C3%B5%2F%2C%2F%C3%B6%2F%2C%2F%C3%B9%2F%2C%2F%C3%BA%2F%2C%2F%C3%BB%2F%2C%2F%C3%BC%2F%2C%2F%C3%BD%2F%2C%2F%C3%BF%2F%2C%2F%C3%80%2F%2C%2F%C3%81%2F%2C%2F%C3%82%2F%2C%2F%C3%83%2F%2C%2F%C3%84%2F%2C%2F%C3%87%2F%2C%2F%C3%88%2F%2C%2F%C3%89%2F%2C%2F%C3%8A%2F%2C%2F%C3%8B%2F%2C%2F%C3%8C%2F%2C%2F%C3%8D%2F%2C%2F%C3%8E%2F%2C%2F%C3%8F%2F%2C%2F%C3%91%2F%2C%2F%C3%92%2F%2C%2F%C3%93%2F%2C%2F%C3%94%2F%2C%2F%C3%95%2F%2C%2F%C3%96%2F%2C%2F%C3%99%2F%2C%2F%C3%9A%2F%2C%2F%C3%9B%2F%2C%2F%C3%9C%2F%2C%2F%C3%9D%2F'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%2C'
          8        SEND_VAL                                                 'a%2Ca%2Ca%2Ca%2Ca%2Cc%2Ce%2Ce%2Ce%2Ce%2Ci%2Ci%2Ci%2Ci%2Cn%2Co%2Co%2Co%2Co%2Co%2Cu%2Cu%2Cu%2Cu%2Cy%2Cy%2CA%2CA%2CA%2CA%2CA%2CC%2CE%2CE%2CE%2CE%2CI%2CI%2CI%2CI%2CN%2CO%2CO%2CO%2CO%2CO%2CU%2CU%2CU%2CU%2CY'
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
    7    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !3, $8
    9    17      > RETURN                                                   !3
   10    18*     > RETURN                                                   null

End of function strip_accents

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.98 ms | 1403 KiB | 18 Q