3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '~^(?<address>(?<streetname>.*?)(?<housenumber>\d+\h*[A-Za-z]?))(?:\/(?<stairs>\d+)(?=(?:\/\d+){1,2}))?(?:\/(?<floor>\d+)(?=(?:\/\d+)))?(?:\/(?<door>\d+))?$~m'; $strings = [ "Lilienstr. 12a", "Leibnizstraße 36/28/2", "Prager Straße 14/3/1/4", "Guentherstr. 43 B", "Eberhard-Leibnitz Str. 1/7", "Schießstätte 7/7" ]; foreach ($strings as $string) { preg_match_all($re, $string, $matches, PREG_SET_ORDER); $address = array_filter($matches[0], "is_string", ARRAY_FILTER_USE_KEY); print_r($address); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/tU7eH
function name:  (null)
number of ops:  23
compiled vars:  !0 = $re, !1 = $strings, !2 = $string, !3 = $matches, !4 = $address
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7E%5E%28%3F%3Caddress%3E%28%3F%3Cstreetname%3E.%2A%3F%29%28%3F%3Chousenumber%3E%5Cd%2B%5Ch%2A%5BA-Za-z%5D%3F%29%29%28%3F%3A%5C%2F%28%3F%3Cstairs%3E%5Cd%2B%29%28%3F%3D%28%3F%3A%5C%2F%5Cd%2B%29%7B1%2C2%7D%29%29%3F%28%3F%3A%5C%2F%28%3F%3Cfloor%3E%5Cd%2B%29%28%3F%3D%28%3F%3A%5C%2F%5Cd%2B%29%29%29%3F%28%3F%3A%5C%2F%28%3F%3Cdoor%3E%5Cd%2B%29%29%3F%24%7Em'
    4     1        ASSIGN                                                   !1, <array>
   13     2      > FE_RESET_R                                       $7      !1, ->21
          3    > > FE_FETCH_R                                               $7, !2, ->21
   14     4    >   INIT_FCALL                                               'preg_match_all'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        SEND_VAL                                                 2
          9        DO_ICALL                                                 
   15    10        INIT_FCALL                                               'array_filter'
         11        FETCH_DIM_R                                      ~9      !3, 0
         12        SEND_VAL                                                 ~9
         13        SEND_VAL                                                 'is_string'
         14        SEND_VAL                                                 2
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !4, $10
   16    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                                 
   13    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $7
   17    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.44 ms | 1002 KiB | 16 Q