3v4l.org

run code in 300+ PHP versions simultaneously
<?php function to_permalink($str) { if($str !== mb_convert_encoding( mb_convert_encoding($str, 'UTF-32', 'UTF-8'), 'UTF-8', 'UTF-32') ) $str = mb_convert_encoding($str, 'UTF-8', mb_detect_encoding($str)); $str = htmlentities($str, ENT_NOQUOTES, 'UTF-8'); $str = preg_replace('`&([a-z]{1,2})(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', '\\1', $str); $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); $str = preg_replace(array('`[^a-z0-9]`i','`[-]+`'), '-', $str); $str = strtolower( trim($str, '-') ); return $str; } $string = "andrés EFI收购Cretaprint"; echo to_permalink($string)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k8s5p
function name:  (null)
number of ops:  7
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'andr%C3%A9s+EFI%E6%94%B6%E8%B4%ADCretaprint'
   17     1        INIT_FCALL                                               'to_permalink'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        CONCAT                                           ~3      $2, '%0A'
          5        ECHO                                                     ~3
          6      > RETURN                                                   1

Function to_permalink:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/k8s5p
function name:  to_permalink
number of ops:  56
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'mb_convert_encoding'
          2        INIT_FCALL                                               'mb_convert_encoding'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'UTF-32'
          5        SEND_VAL                                                 'UTF-8'
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        SEND_VAL                                                 'UTF-8'
          9        SEND_VAL                                                 'UTF-32'
         10        DO_ICALL                                         $2      
         11        IS_NOT_IDENTICAL                                         !0, $2
         12      > JMPZ                                                     ~3, ->22
    6    13    >   INIT_FCALL                                               'mb_convert_encoding'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 'UTF-8'
         16        INIT_FCALL                                               'mb_detect_encoding'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $4      
         19        SEND_VAR                                                 $4
         20        DO_ICALL                                         $5      
         21        ASSIGN                                                   !0, $5
    7    22    >   INIT_FCALL                                               'htmlentities'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 0
         25        SEND_VAL                                                 'UTF-8'
         26        DO_ICALL                                         $7      
         27        ASSIGN                                                   !0, $7
    8    28        INIT_FCALL                                               'preg_replace'
         29        SEND_VAL                                                 '%60%26%28%5Ba-z%5D%7B1%2C2%7D%29%28acute%7Cuml%7Ccirc%7Cgrave%7Cring%7Ccedil%7Cslash%7Ctilde%7Ccaron%7Clig%29%3B%60i'
         30        SEND_VAL                                                 '%5C1'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $9      
         33        ASSIGN                                                   !0, $9
    9    34        INIT_FCALL                                               'html_entity_decode'
         35        SEND_VAR                                                 !0
         36        SEND_VAL                                                 0
         37        SEND_VAL                                                 'UTF-8'
         38        DO_ICALL                                         $11     
         39        ASSIGN                                                   !0, $11
   10    40        INIT_FCALL                                               'preg_replace'
         41        SEND_VAL                                                 <array>
         42        SEND_VAL                                                 '-'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $13     
         45        ASSIGN                                                   !0, $13
   11    46        INIT_FCALL                                               'strtolower'
         47        INIT_FCALL                                               'trim'
         48        SEND_VAR                                                 !0
         49        SEND_VAL                                                 '-'
         50        DO_ICALL                                         $15     
         51        SEND_VAR                                                 $15
         52        DO_ICALL                                         $16     
         53        ASSIGN                                                   !0, $16
   12    54      > RETURN                                                   !0
   13    55*     > RETURN                                                   null

End of function to_permalink

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.27 ms | 1403 KiB | 28 Q