3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(preg_match('[0-9a-zA-Z]', 'bob', $matches), $matches); echo '---------', PHP_EOL; var_dump(preg_match('~[0-9a-zA-Z]~', 'bob', $matches), $matches); echo '---------', PHP_EOL; var_dump(preg_match('~[0-9a-zA-Z]+~', 'bob', $matches), $matches); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7a5H1
function name:  (null)
number of ops:  32
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%5B0-9a-zA-Z%5D'
          3        SEND_VAL                                                 'bob'
          4        SEND_REF                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    6     9        ECHO                                                     '---------'
         10        ECHO                                                     '%0A'
    7    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'preg_match'
         13        SEND_VAL                                                 '%7E%5B0-9a-zA-Z%5D%7E'
         14        SEND_VAL                                                 'bob'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $3      
         17        SEND_VAR                                                 $3
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
    8    20        ECHO                                                     '---------'
         21        ECHO                                                     '%0A'
   10    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'preg_match'
         24        SEND_VAL                                                 '%7E%5B0-9a-zA-Z%5D%2B%7E'
         25        SEND_VAL                                                 'bob'
         26        SEND_REF                                                 !0
         27        DO_ICALL                                         $5      
         28        SEND_VAR                                                 $5
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
   12    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.81 ms | 1395 KiB | 17 Q