3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dwellingInfo = [ ["AAA", "Chimney with red bricks"], ["BBB", "Two wide windows in the main floor"], ["CCC", "Roof tiles renewed in 2015"] ]; $haystack = implode( ',', array_column($dwellingInfo, 1) ); $dwellingAttributes = [ ["0001", 'Chimney', '/\b(?:Chimney with|Big stove)\b/i'], ["0002", 'Garden', '/\bgarden\b/i'], ["0003", 'Roof tiles', '/\bRoof tiles\b/i'], ["0004", 'Windows', '/\bwindows?\b/i'], ["0005", 'Garage', '/\b(?:garage|car port|under cover area)\b/i'] ]; foreach ($dwellingAttributes as [$id, $term, $pattern]) { printf( "%s - %s - %s\n", $id, $term, preg_match($pattern, $haystack) ? 'available' : 'unavailable' ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 29
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/luXRK
function name:  (null)
number of ops:  31
compiled vars:  !0 = $dwellingInfo, !1 = $haystack, !2 = $dwellingAttributes, !3 = $id, !4 = $term, !5 = $pattern
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        INIT_FCALL                                                   'array_column'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     1
          4        DO_ICALL                                             $7      
    9     5        FRAMELESS_ICALL_2                implode             ~8      '%2C', $7
          6        ASSIGN                                                       !1, ~8
   14     7        ASSIGN                                                       !2, <array>
   22     8      > FE_RESET_R                                           $11     !2, ->29
          9    > > FE_FETCH_R                                                   $11, $12, ->29
         10    >   FETCH_LIST_R                                         $13     $12, 0
         11        ASSIGN                                                       !3, $13
         12        FETCH_LIST_R                                         $15     $12, 1
         13        ASSIGN                                                       !4, $15
         14        FETCH_LIST_R                                         $17     $12, 2
         15        ASSIGN                                                       !5, $17
         16        FREE                                                         $12
   23    17        INIT_FCALL                                                   'printf'
   24    18        SEND_VAL                                                     '%25s+-+%25s+-+%25s%0A'
   25    19        SEND_VAR                                                     !3
   26    20        SEND_VAR                                                     !4
   27    21        FRAMELESS_ICALL_2                preg_match          ~19     !5, !1
         22      > JMPZ                                                         ~19, ->25
   28    23    >   QM_ASSIGN                                            ~20     'available'
         24      > JMP                                                          ->26
   29    25    >   QM_ASSIGN                                            ~20     'unavailable'
         26    >   SEND_VAL                                                     ~20
   23    27        DO_ICALL                                                     
   22    28      > JMP                                                          ->9
         29    >   FE_FREE                                                      $11
   31    30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.35 ms | 1921 KiB | 15 Q