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