3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GenerateUrl ($s) { //Convert accented characters, and remove parentheses and apostrophes $from = explode (',', "ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u,(,),[,],'"); $to = explode (',', 'c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u,,,,,,'); //Do the replacements, and convert all other non-alphanumeric characters to spaces $s = preg_replace ('~[^\w\d]+~', '-', str_replace ($from, $to, trim ($s))); //Remove a - at the beginning or end and make lowercase return strtolower (preg_replace ('/^-/', '', preg_replace ('/-$/', '', $s))); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3OVcm
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   1

Function generateurl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3OVcm
function name:  GenerateUrl
number of ops:  40
compiled vars:  !0 = $s, !1 = $from, !2 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAL                                                 '%C3%A7%2C%C3%A6%2C%C5%93%2C%C3%A1%2C%C3%A9%2C%C3%AD%2C%C3%B3%2C%C3%BA%2C%C3%A0%2C%C3%A8%2C%C3%AC%2C%C3%B2%2C%C3%B9%2C%C3%A4%2C%C3%AB%2C%C3%AF%2C%C3%B6%2C%C3%BC%2C%C3%BF%2C%C3%A2%2C%C3%AA%2C%C3%AE%2C%C3%B4%2C%C3%BB%2C%C3%A5%2Ce%2Ci%2C%C3%B8%2Cu%2C%28%2C%29%2C%5B%2C%5D%2C%27'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
          6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%2C'
          8        SEND_VAL                                                 'c%2Cae%2Coe%2Ca%2Ce%2Ci%2Co%2Cu%2Ca%2Ce%2Ci%2Co%2Cu%2Ca%2Ce%2Ci%2Co%2Cu%2Cy%2Ca%2Ce%2Ci%2Co%2Cu%2Ca%2Ce%2Ci%2Co%2Cu%2C%2C%2C%2C%2C%2C'
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !2, $5
    6    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%7E%5B%5E%5Cw%5Cd%5D%2B%7E'
         13        SEND_VAL                                                 '-'
         14        INIT_FCALL                                               'str_replace'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !2
         17        INIT_FCALL                                               'trim'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $7      
         20        SEND_VAR                                                 $7
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                         $9      
         24        ASSIGN                                                   !0, $9
    8    25        INIT_FCALL                                               'strtolower'
         26        INIT_FCALL                                               'preg_replace'
         27        SEND_VAL                                                 '%2F%5E-%2F'
         28        SEND_VAL                                                 ''
         29        INIT_FCALL                                               'preg_replace'
         30        SEND_VAL                                                 '%2F-%24%2F'
         31        SEND_VAL                                                 ''
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                         $11     
         34        SEND_VAR                                                 $11
         35        DO_ICALL                                         $12     
         36        SEND_VAR                                                 $12
         37        DO_ICALL                                         $13     
         38      > RETURN                                                   $13
    9    39*     > RETURN                                                   null

End of function generateurl

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.66 ms | 1392 KiB | 23 Q