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($match[2], "\n"); 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 = 43
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 43
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 38
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 38
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/FeXh5
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
-------------------------------------------------------------------------------------
    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, ->43
         14    > > FE_FETCH_R                                               $16, !3, ->43
   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        CHECK_FUNC_ARG                                           
         23        FETCH_DIM_FUNC_ARG                               $22     !3, 2
         24        SEND_FUNC_ARG                                            $22
         25        SEND_VAL_EX                                              '%0A'
         26        DO_FCALL                                      0  $23     
         27        ASSIGN                                                   !5, $23
   40    28      > FE_RESET_R                                       $25     !5, ->38
         29    > > FE_FETCH_R                                               $25, !6, ->38
   41    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
   43    35        ASSIGN_OBJ                                               !4, 'parts'
         36        OP_DATA                                                  !7
   40    37      > JMP                                                      ->29
         38    >   FE_FREE                                                  $25
   47    39        FETCH_OBJ_W                                      $29     !0, 'directories'
         40        ASSIGN_DIM                                               $29
         41        OP_DATA                                                  !4
   32    42      > JMP                                                      ->14
         43    >   FE_FREE                                                  $16
   51    44        INIT_NS_FCALL_BY_NAME                                    'Aydin%5Cvar_dump'
         45        SEND_VAR_EX                                              !0
         46        DO_FCALL                                      0          
         47      > 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.42 ms | 1400 KiB | 21 Q