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); $title = strtolower($title); $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); $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); $episode = $new_str; echo $episode."\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NiN4C
function name:  (null)
number of ops:  64
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        INIT_FCALL                                               'strtolower'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !0, $12
    7    19        ASSIGN                                                   !1, <array>
    8    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAR                                                 !1
         22        SEND_VAL                                                 <array>
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 -1
         25        DO_ICALL                                         $15     
         26        ASSIGN                                                   !0, $15
    9    27        INIT_FCALL                                               'ucwords'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $17     
         30        ASSIGN                                                   !0, $17
   11    31        INIT_FCALL                                               'str_replace'
         32        SEND_VAL                                                 '%E2%80%99'
         33        SEND_VAL                                                 '%27'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $19     
         36        ASSIGN                                                   !2, $19
   12    37        ASSIGN                                                   !3, '%2F%5B%E0%B8%81-%E0%B9%99%5D%2Fui'
   13    38        INIT_FCALL                                               'preg_replace'
         39        SEND_VAR                                                 !3
         40        SEND_VAL                                                 ''
         41        SEND_VAR                                                 !2
         42        DO_ICALL                                         $22     
         43        ASSIGN                                                   !4, $22
   14    44        INIT_FCALL                                               'preg_replace'
         45        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         46        SEND_VAL                                                 '+'
         47        SEND_VAR                                                 !4
         48        DO_ICALL                                         $24     
         49        ASSIGN                                                   !4, $24
   15    50        INIT_FCALL                                               'str_replace'
         51        SEND_VAL                                                 '..'
         52        SEND_VAL                                                 ''
         53        SEND_VAR                                                 !4
         54        DO_ICALL                                         $26     
         55        ASSIGN                                                   !4, $26
   16    56        INIT_FCALL                                               'trim'
         57        SEND_VAR                                                 !4
         58        DO_ICALL                                         $28     
         59        ASSIGN                                                   !4, $28
   17    60        ASSIGN                                                   !5, !4
   18    61        CONCAT                                           ~31     !5, '%0A'
         62        ECHO                                                     ~31
   19    63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.9 ms | 1400 KiB | 23 Q