3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Aydin; class Directory { public $dir = ''; public $parts = []; } class Vhost { public $directories = []; } $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("\n", $match[2]); foreach ($lines as $line) { $parts = preg_split('/\s+/', $line); $dir->parts[] = $parts; } $vhost->directories[] = $dir; } var_dump($vhost);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 44
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 44
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 39
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 39
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 39
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/lJ35X
function name:  (null)
number of ops:  49
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
-------------------------------------------------------------------------------------
    6     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'
   28     1        ASSIGN                                                   !1, <array>
   29     2        INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cpreg_match_all'
          3        SEND_VAL_EX                                              '%2F%3CDirectory+%22%28.%2A%22%29%3E%28%5B%5Cs%5CS%5D%2A%3F%29%3C%5C%2FDirectory%3E%2F'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        FETCH_CONSTANT                                   ~10     'Aydin%5CPREG_SET_ORDER'
          7        SEND_VAL_EX                                              ~10
          8        DO_FCALL                                      0  $11     
          9        ASSIGN                                                   !2, $11
   31    10        NEW                                              $13     'Aydin%5CVhost'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !0, $13
   32    13      > FE_RESET_R                                       $16     !1, ->44
         14    > > FE_FETCH_R                                               $16, !3, ->44
   34    15    >   NEW                                              $17     'Aydin%5CDirectory'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !4, $17
   35    18        FETCH_DIM_R                                      ~21     !3, 1
         19        ASSIGN_OBJ                                               !4, 'dir'
         20        OP_DATA                                                  ~21
   39    21        INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cexplode'
         22        SEND_VAL_EX                                              '%0A'
         23        CHECK_FUNC_ARG                                           
         24        FETCH_DIM_FUNC_ARG                               $22     !3, 2
         25        SEND_FUNC_ARG                                            $22
         26        DO_FCALL                                      0  $23     
         27        ASSIGN                                                   !5, $23
   40    28      > FE_RESET_R                                       $25     !5, ->39
         29    > > FE_FETCH_R                                               $25, !6, ->39
   42    30    >   INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cpreg_split'
         31        SEND_VAL_EX                                              '%2F%5Cs%2B%2F'
         32        SEND_VAR_EX                                              !6
         33        DO_FCALL                                      0  $26     
         34        ASSIGN                                                   !7, $26
   44    35        FETCH_OBJ_W                                      $28     !4, 'parts'
         36        ASSIGN_DIM                                               $28
         37        OP_DATA                                                  !7
   40    38      > JMP                                                      ->29
         39    >   FE_FREE                                                  $25
   48    40        FETCH_OBJ_W                                      $30     !0, 'directories'
         41        ASSIGN_DIM                                               $30
         42        OP_DATA                                                  !4
   32    43      > JMP                                                      ->14
         44    >   FE_FREE                                                  $16
   52    45        INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cvar_dump'
         46        SEND_VAR_EX                                              !0
         47        DO_FCALL                                      0          
         48      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.83 ms | 1400 KiB | 21 Q