3v4l.org

run code in 300+ PHP versions simultaneously
<? $title = "ดูซีรี่ย์ฝรั่ง&nbsp;Arrow Season 3 Ep.1-1"; $title = trim(trim($title, chr(0xC2).chr(0xA0))); $title = preg_replace("/&#?[a-z0-9]+;/i","",$title); echo $title."\n"; $title = strtolower($title); echo $title."\n"; $pattern = array("~\s*(season)\s*(\d+[-]?[0-9]*).*\s*(?:ep[.]?|episode)\s*(\d+[-]?[0-9]*)(\s*)~", "~\s*(?:ep[.]?|episode)\s*(\d+[-]?[0-9]*)(\s*)~"); $title = preg_replace($pattern, array(" $1 $2 ep. $3"," ep. $1"), $title, -1); $title = ucwords($title); echo $title."\n"; $episodename = str_replace("’","'",$title); $pttr = '/[ก-๙]/ui'; $new_str = preg_replace($pttr, '', $episodename); $new_str = preg_replace('/\s+/', ' ', $new_str); $new_str = str_replace('..', '', $new_str); $new_str = trim($new_str); $new_str = ucwords($new_str); $episode = $new_str; echo $episode."\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5UFe4
function name:  (null)
number of ops:  74
compiled vars:  !0 = $title, !1 = $pattern, !2 = $episodename, !3 = $pttr, !4 = $new_str, !5 = $episode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%E0%B8%94%E0%B8%B9%E0%B8%8B%E0%B8%B5%E0%B8%A3%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B9%8C%E0%B8%9D%E0%B8%A3%E0%B8%B1%E0%B9%88%E0%B8%87%26nbsp%3BArrow+Season+3+Ep.1-1'
    4     1        INIT_FCALL                                               'trim'
          2        INIT_FCALL                                               'trim'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%C2%A0'
          5        DO_ICALL                                         $7      
          6        SEND_VAR                                                 $7
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !0, $8
    5     9        INIT_FCALL                                               'preg_replace'
         10        SEND_VAL                                                 '%2F%26%23%3F%5Ba-z0-9%5D%2B%3B%2Fi'
         11        SEND_VAL                                                 ''
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !0, $10
    6    15        CONCAT                                           ~12     !0, '%0A'
         16        ECHO                                                     ~12
    7    17        INIT_FCALL                                               'strtolower'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !0, $13
    8    21        CONCAT                                           ~15     !0, '%0A'
         22        ECHO                                                     ~15
    9    23        ASSIGN                                                   !1, <array>
   10    24        INIT_FCALL                                               'preg_replace'
         25        SEND_VAR                                                 !1
         26        SEND_VAL                                                 <array>
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 -1
         29        DO_ICALL                                         $17     
         30        ASSIGN                                                   !0, $17
   11    31        INIT_FCALL                                               'ucwords'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                         $19     
         34        ASSIGN                                                   !0, $19
   12    35        CONCAT                                           ~21     !0, '%0A'
         36        ECHO                                                     ~21
   13    37        INIT_FCALL                                               'str_replace'
         38        SEND_VAL                                                 '%E2%80%99'
         39        SEND_VAL                                                 '%27'
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                         $22     
         42        ASSIGN                                                   !2, $22
   14    43        ASSIGN                                                   !3, '%2F%5B%E0%B8%81-%E0%B9%99%5D%2Fui'
   15    44        INIT_FCALL                                               'preg_replace'
         45        SEND_VAR                                                 !3
         46        SEND_VAL                                                 ''
         47        SEND_VAR                                                 !2
         48        DO_ICALL                                         $25     
         49        ASSIGN                                                   !4, $25
   16    50        INIT_FCALL                                               'preg_replace'
         51        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         52        SEND_VAL                                                 '+'
         53        SEND_VAR                                                 !4
         54        DO_ICALL                                         $27     
         55        ASSIGN                                                   !4, $27
   17    56        INIT_FCALL                                               'str_replace'
         57        SEND_VAL                                                 '..'
         58        SEND_VAL                                                 ''
         59        SEND_VAR                                                 !4
         60        DO_ICALL                                         $29     
         61        ASSIGN                                                   !4, $29
   18    62        INIT_FCALL                                               'trim'
         63        SEND_VAR                                                 !4
         64        DO_ICALL                                         $31     
         65        ASSIGN                                                   !4, $31
   19    66        INIT_FCALL                                               'ucwords'
         67        SEND_VAR                                                 !4
         68        DO_ICALL                                         $33     
         69        ASSIGN                                                   !4, $33
   20    70        ASSIGN                                                   !5, !4
   21    71        CONCAT                                           ~36     !5, '%0A'
         72        ECHO                                                     ~36
   22    73      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.08 ms | 1400 KiB | 23 Q