3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUrls($string) { $regex = '/(https?|www)\:\/\/[^\" ]+/i'; preg_match_all($regex, $string, $matches); return ($matches[0]); } $content = "Tapez ici le message https://www.gmail.com que vous souhaitez envoyer à vos clients http://goo.gl/aBcm test gg www.kkk.gt"; var_dump(getUrls($content));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BptN9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'Tapez+ici+le+message+https%3A%2F%2Fwww.gmail.com+que+vous+souhaitez+envoyer+%C3%A0+vos+clients+http%3A%2F%2Fgoo.gl%2FaBcm+test+gg+www.kkk.gt'
   12     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'geturls'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function geturls:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BptN9
function name:  getUrls
number of ops:  10
compiled vars:  !0 = $string, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '%2F%28https%3F%7Cwww%29%5C%3A%5C%2F%5C%2F%5B%5E%5C%22+%5D%2B%2Fi'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        FETCH_DIM_R                                      ~5      !2, 0
          8      > RETURN                                                   ~5
    7     9*     > RETURN                                                   null

End of function geturls

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.29 ms | 1397 KiB | 18 Q