3v4l.org

run code in 300+ 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 = 12, Position 2 = 35
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 35
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/luXRK
function name:  (null)
number of ops:  37
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>
    9     1        INIT_FCALL                                               'implode'
   10     2        SEND_VAL                                                 '%2C'
   11     3        INIT_FCALL                                               'array_column'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $7      
          7        SEND_VAR                                                 $7
    9     8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !1, $8
   14    10        ASSIGN                                                   !2, <array>
   22    11      > FE_RESET_R                                       $11     !2, ->35
         12    > > FE_FETCH_R                                               $11, $12, ->35
         13    >   FETCH_LIST_R                                     $13     $12, 0
         14        ASSIGN                                                   !3, $13
         15        FETCH_LIST_R                                     $15     $12, 1
         16        ASSIGN                                                   !4, $15
         17        FETCH_LIST_R                                     $17     $12, 2
         18        ASSIGN                                                   !5, $17
         19        FREE                                                     $12
   23    20        INIT_FCALL                                               'printf'
   24    21        SEND_VAL                                                 '%25s+-+%25s+-+%25s%0A'
   25    22        SEND_VAR                                                 !3
   26    23        SEND_VAR                                                 !4
   27    24        INIT_FCALL                                               'preg_match'
         25        SEND_VAR                                                 !5
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $19     
         28      > JMPZ                                                     $19, ->31
   28    29    >   QM_ASSIGN                                        ~20     'available'
         30      > JMP                                                      ->32
   29    31    >   QM_ASSIGN                                        ~20     'unavailable'
         32    >   SEND_VAL                                                 ~20
   23    33        DO_ICALL                                                 
   22    34      > JMP                                                      ->12
         35    >   FE_FREE                                                  $11
   31    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
245.3 ms | 1006 KiB | 17 Q