3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isUrl($text) { $regex = array(); $regex["url"] = '/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/i'; $mat = array(); echo $regex["url"]; preg_match_all($regex["url"], $text, $mat); var_dump($mat); if ($mat[0]) { echo $mat[0]; } } isUrl("来戳这里!http://aaa.bb.cc sdfsafsdhttp://aa.bb.com");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WRBWl
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'isurl'
          1        SEND_VAL                                                 '%E6%9D%A5%E6%88%B3%E8%BF%99%E9%87%8C%EF%BC%81http%3A%2F%2Faaa.bb.cc+sdfsafsdhttp%3A%2F%2Faa.bb.com'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function isurl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/WRBWl
function name:  isUrl
number of ops:  21
compiled vars:  !0 = $text, !1 = $regex, !2 = $mat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN_DIM                                               !1, 'url'
          3        OP_DATA                                                  '%2F%28%28%28%5BA-Za-z%5D%7B3%2C9%7D%3A%28%3F%3A%5C%2F%5C%2F%29%3F%29%28%3F%3A%5B-%3B%3A%26%3D%5C%2B%5C%24%2C%5Cw%5D%2B%40%29%3F%5BA-Za-z0-9.-%5D%2B%7C%28%3F%3Awww.%7C%5B-%3B%3A%26%3D%5C%2B%5C%24%2C%5Cw%5D%2B%40%29%5BA-Za-z0-9.-%5D%2B%29%28%28%3F%3A%5C%2F%5B%5C%2B%7E%25%5C%2F.%5Cw-_%5D%2A%29%3F%5C%3F%3F%28%3F%3A%5B-%5C%2B%3D%26%3B%25%40.%5Cw_%5D%2A%29%23%3F%28%3F%3A%5B.%5C%21%5C%2F%5Cw%5D%2A%29%29%3F%29%2Fi'
    5     4        ASSIGN                                                   !2, <array>
    6     5        FETCH_DIM_R                                      ~6      !1, 'url'
          6        ECHO                                                     ~6
    7     7        INIT_FCALL                                               'preg_match_all'
          8        FETCH_DIM_R                                      ~7      !1, 'url'
          9        SEND_VAL                                                 ~7
         10        SEND_VAR                                                 !0
         11        SEND_REF                                                 !2
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
    9    16        FETCH_DIM_R                                      ~10     !2, 0
         17      > JMPZ                                                     ~10, ->20
   10    18    >   FETCH_DIM_R                                      ~11     !2, 0
         19        ECHO                                                     ~11
   12    20    > > RETURN                                                   null

End of function isurl

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.36 ms | 1399 KiB | 18 Q