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+/', trim($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 = 47
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 47
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 42
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 42
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 42
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/B9mFU
function name:  (null)
number of ops:  52
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, ->47
         14    > > FE_FETCH_R                                               $16, !3, ->47
   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, ->42
         29    > > FE_FETCH_R                                               $25, !6, ->42
   42    30    >   INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cpreg_split'
         31        SEND_VAL_EX                                              '%2F%5Cs%2B%2F'
         32        INIT_NS_FCALL_BY_NAME                                    'Aydin%5Ctrim'
         33        SEND_VAR_EX                                              !6
         34        DO_FCALL                                      0  $26     
         35        SEND_VAR_NO_REF_EX                                       $26
         36        DO_FCALL                                      0  $27     
         37        ASSIGN                                                   !7, $27
   44    38        FETCH_OBJ_W                                      $29     !4, 'parts'
         39        ASSIGN_DIM                                               $29
         40        OP_DATA                                                  !7
   40    41      > JMP                                                      ->29
         42    >   FE_FREE                                                  $25
   48    43        FETCH_OBJ_W                                      $31     !0, 'directories'
         44        ASSIGN_DIM                                               $31
         45        OP_DATA                                                  !4
   32    46      > JMP                                                      ->14
         47    >   FE_FREE                                                  $16
   52    48        INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cvar_dump'
         49        SEND_VAR_EX                                              !0
         50        DO_FCALL                                      0          
         51      > 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:
151.49 ms | 1400 KiB | 23 Q