3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'location in [chambre, cuisine, salle-de-bain, jardin]'; $regex = <<<REGEX / [a-zA-Z]+ (?= \s+in\s+\[\s* [a-zA-Z-]+\s* (?:,\s*[a-zA-Z-]+\s*)* \] ) | \G(?!^) (?: \s+in\s+\[\s* | \s*,\s* ) \K [a-zA-Z-]+ /x REGEX; preg_match_all($regex, $input, $matches); var_export($matches[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7VJA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $input, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'location+in+%5Bchambre%2C+cuisine%2C+salle-de-bain%2C+jardin%5D'
    4     1        ASSIGN                                                   !1, '%2F%0A%5Ba-zA-Z%5D%2B%0A%28%3F%3D%0A+++%5Cs%2Bin%5Cs%2B%5C%5B%5Cs%2A%0A+++%5Ba-zA-Z-%5D%2B%5Cs%2A%0A+++%28%3F%3A%2C%5Cs%2A%5Ba-zA-Z-%5D%2B%5Cs%2A%29%2A%0A+++%5C%5D%0A%29%0A%7C%0A%5CG%28%3F%21%5E%29%0A%28%3F%3A%0A+++%5Cs%2Bin%5Cs%2B%5C%5B%5Cs%2A%0A+++%7C%0A+++%5Cs%2A%2C%5Cs%2A%0A%29%0A%5CK%0A%5Ba-zA-Z-%5D%2B%0A%2Fx'
   24     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   25     7        INIT_FCALL                                               'var_export'
          8        FETCH_DIM_R                                      ~6      !2, 0
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.05 ms | 1010 KiB | 15 Q