3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vhost =' <Directory "/srv/httpd/htdocs/mydomain.com"> Options Indexes FollowSymLinks AllowOverride All Order deny,allow Allow from 127.0.0.1 Allow from xxx.xxx.xxx.xxx Allow from xxx.xxx.xxx.xxx Deny from all </Directory> <Directory "/srv/httpd/htdocs/myseconddomain"> Options Indexes FollowSymLinks AllowOverride All Order deny,allow Allow from 127.0.0.1 Allow from xxx.xxx.xxx.xxx Allow from xxx.xxx.xxx.xxx Deny from all </Directory> '; $matches = []; $directory = preg_match_all('/<Directory "(.*")>([\s\S]*?)<\/Directory>/', $vhost, $matches, PREG_SET_ORDER); $vhost = new Vhost; foreach ($matches as $match) { $dir = new Directory; $dir->dir = $match[1]; echo "Directory: " . $match[1] . "\n"; $lines = explode($match[2], "\n"); foreach ($lines as $line) { $parts = preg_split('/\s+/', $line); $dir->parts = $parts; } $vhost->directories[] = $dir; } class Directory { public $dir = ''; public $parts = []; } class Vhost { public $directories = []; } //var_dump($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 45
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 45
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 40
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 40
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 40
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
filename:       /in/t6vnk
function name:  (null)
number of ops:  48
compiled vars:  !0 = $vhost, !1 = $matches, !2 = $directory, !3 = $match, !4 = $dir, !5 = $lines, !6 = $line, !7 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%3CDirectory+%22%2Fsrv%2Fhttpd%2Fhtdocs%2Fmydomain.com%22%3E%0A++++Options+Indexes+FollowSymLinks%0A++++AllowOverride+All%0A++++Order+deny%2Callow%0A++++Allow+from+127.0.0.1%0A++++Allow+from+xxx.xxx.xxx.xxx%0A++++Allow+from+xxx.xxx.xxx.xxx%0A++++Deny+from+all%0A%3C%2FDirectory%3E%0A%3CDirectory+%22%2Fsrv%2Fhttpd%2Fhtdocs%2Fmyseconddomain%22%3E%0A++++Options+Indexes+FollowSymLinks%0A++++AllowOverride+All%0A++++Order+deny%2Callow%0A++++Allow+from+127.0.0.1%0A++++Allow+from+xxx.xxx.xxx.xxx%0A++++Allow+from+xxx.xxx.xxx.xxx%0A++++Deny+from+all%0A%3C%2FDirectory%3E%0A%0A'
   25     1        ASSIGN                                                   !1, <array>
   26     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2F%3CDirectory+%22%28.%2A%22%29%3E%28%5B%5Cs%5CS%5D%2A%3F%29%3C%5C%2FDirectory%3E%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        SEND_VAL                                                 2
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !2, $10
   28     9        NEW                                              $12     'Vhost'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !0, $12
   29    12      > FE_RESET_R                                       $15     !1, ->45
         13    > > FE_FETCH_R                                               $15, !3, ->45
   31    14    >   NEW                                              $16     'Directory'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !4, $16
   32    17        FETCH_DIM_R                                      ~20     !3, 1
         18        ASSIGN_OBJ                                               !4, 'dir'
         19        OP_DATA                                                  ~20
   34    20        FETCH_DIM_R                                      ~21     !3, 1
         21        CONCAT                                           ~22     'Directory%3A+', ~21
         22        CONCAT                                           ~23     ~22, '%0A'
         23        ECHO                                                     ~23
   36    24        INIT_FCALL                                               'explode'
         25        FETCH_DIM_R                                      ~24     !3, 2
         26        SEND_VAL                                                 ~24
         27        SEND_VAL                                                 '%0A'
         28        DO_ICALL                                         $25     
         29        ASSIGN                                                   !5, $25
   37    30      > FE_RESET_R                                       $27     !5, ->40
         31    > > FE_FETCH_R                                               $27, !6, ->40
   38    32    >   INIT_FCALL                                               'preg_split'
         33        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         34        SEND_VAR                                                 !6
         35        DO_ICALL                                         $28     
         36        ASSIGN                                                   !7, $28
   40    37        ASSIGN_OBJ                                               !4, 'parts'
         38        OP_DATA                                                  !7
   37    39      > JMP                                                      ->31
         40    >   FE_FREE                                                  $27
   44    41        FETCH_OBJ_W                                      $31     !0, 'directories'
         42        ASSIGN_DIM                                               $31
         43        OP_DATA                                                  !4
   29    44      > JMP                                                      ->13
         45    >   FE_FREE                                                  $15
   47    46        DECLARE_CLASS                                            'directory'
   61    47      > RETURN                                                   1

Class Directory: [no user functions]
Class Vhost: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.24 ms | 1400 KiB | 19 Q