3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($str){ var_dump($str); var_dump( preg_match_all( '{^(https?://)?([^/\n]+)}', $str, $matches ) ); var_dump($matches); } $strArray = [ 'http://www.answers.com/article/1194427/8-habits-of-extraordinarily-likeable-people', 'https://www.apple.com', 'https://www.apple .com', 'https://www.apple', 'http://www.cnn.com.au', 'http://downloads.news.com.au', 'http://ftp.android.co.nz', 'http://global.news.ca', 'http://www.apple.com', 'apple.com', 'www.apple.com', ]; foreach($strArray as $str){ foo($str); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/metWs
function name:  (null)
number of ops:  9
compiled vars:  !0 = $strArray, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, <array>
   32     1      > FE_RESET_R                                       $3      !0, ->7
          2    > > FE_FETCH_R                                               $3, !1, ->7
   33     3    >   INIT_FCALL                                               'foo'
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0          
   32     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $3
   34     8      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/metWs
function name:  foo
number of ops:  16
compiled vars:  !0 = $str, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'var_dump'
    6     5        INIT_FCALL                                               'preg_match_all'
    7     6        SEND_VAL                                                 '%7B%5E%28https%3F%3A%2F%2F%29%3F%28%5B%5E%2F%5Cn%5D%2B%29%7D'
    8     7        SEND_VAR                                                 !0
    9     8        SEND_REF                                                 !1
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                                 
   13    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   14    15      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.91 ms | 1399 KiB | 18 Q