3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach(array('ciao', 'ciao.comeva', '$ciao', '$ciao.comeva', '$ciao.come.va', '$ciao.molto.bene.e.tu') as $string) { if (preg_match('#\$([\w\.]+)#',$string)) { echo $string . ' - OK' . "\n"; } else { echo $string . ' - NOK'. "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 15
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/9F2gA
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E > > FE_RESET_R                                       $1      <array>, ->15
          1    > > FE_FETCH_R                                               $1, !0, ->15
    3     2    >   INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%23%5C%24%28%5B%5Cw%5C.%5D%2B%29%23'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->11
    4     7    >   CONCAT                                           ~3      !0, '+-+OK'
          8        CONCAT                                           ~4      ~3, '%0A'
          9        ECHO                                                     ~4
         10      > JMP                                                      ->14
    6    11    >   CONCAT                                           ~5      !0, '+-+NOK'
         12        CONCAT                                           ~6      ~5, '%0A'
         13        ECHO                                                     ~6
    2    14    > > JMP                                                      ->1
         15    >   FE_FREE                                                  $1
    8    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.11 ms | 935 KiB | 16 Q