3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '/([A-Za-z])+(?:\s+\S+)/'; $vhost = ' DocumentRoot /www/example2 ServerName www.example.org ErrorLog /var/log/log.txt <Directory> ErrorLog /var/log/log.txt </Directory> <Directory /> ErrorLog /var/log/log.txt </Directory>'; preg_match_all($regex, $vhost, $matches); var_dump($matches); $vhostRegEx = '/<VirtualHost (\d{1,3}\.\d{1,3}.\d{1,3}.\d{1,3}):(\d+)>([\s\S]+)<\/VirtualHost>/'; $matches = []; if (!preg_match($vhostRegEx, $vHost, $matches)) { throw new \Exception("No VHost Found"); } var_dump($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ov1qa
function name:  (null)
number of ops:  27
compiled vars:  !0 = $regex, !1 = $vhost, !2 = $matches, !3 = $vhostRegEx, !4 = $vHost
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%28%5BA-Za-z%5D%29%2B%28%3F%3A%5Cs%2B%5CS%2B%29%2F'
    5     1        ASSIGN                                                   !1, '%0A++%09DocumentRoot+%2Fwww%2Fexample2%0A++%09ServerName+www.example.org%0A++%09ErrorLog+%2Fvar%2Flog%2Flog.txt%0A%09%0A%09%3CDirectory%3E%0A%09%09ErrorLog+%2Fvar%2Flog%2Flog.txt%0A%09%3C%2FDirectory%3E%0A%09%0A%09%3CDirectory+%2F%3E%0A%09%09ErrorLog+%2Fvar%2Flog%2Flog.txt%0A%09%3C%2FDirectory%3E'
   19     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   21     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
   25    10        ASSIGN                                                   !3, '%2F%3CVirtualHost+%28%5Cd%7B1%2C3%7D%5C.%5Cd%7B1%2C3%7D.%5Cd%7B1%2C3%7D.%5Cd%7B1%2C3%7D%29%3A%28%5Cd%2B%29%3E%28%5B%5Cs%5CS%5D%2B%29%3C%5C%2FVirtualHost%3E%2F'
   26    11        ASSIGN                                                   !2, <array>
   28    12        INIT_FCALL                                               'preg_match'
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !4
         15        SEND_REF                                                 !2
         16        DO_ICALL                                         $11     
         17        BOOL_NOT                                         ~12     $11
         18      > JMPZ                                                     ~12, ->23
   29    19    >   NEW                                              $13     'Exception'
         20        SEND_VAL_EX                                              'No+VHost+Found'
         21        DO_FCALL                                      0          
         22      > THROW                                         0          $13
   32    23    >   INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.29 ms | 1396 KiB | 19 Q