3v4l.org

run code in 300+ PHP versions simultaneously
<?php function escape_sql_regexp( $str ) { return preg_replace('/[+*?[\\^\\]$(){}=!|:,]/', '\\\\\\\\${0}', $str); } echo escape_sql_regexp( '(541) 754-3010' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r8pAS
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'escape_sql_regexp'
          1        SEND_VAL                                                 '%28541%29+754-3010'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function escape_sql_regexp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r8pAS
function name:  escape_sql_regexp
number of ops:  8
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%2B%2A%3F%5B%5C%5E%5C%5D%24%28%29%7B%7D%3D%21%7C%3A%2C%5D%2F'
          3        SEND_VAL                                                 '%5C%5C%5C%5C%24%7B0%7D'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    5     7*     > RETURN                                                   null

End of function escape_sql_regexp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.35 ms | 1006 KiB | 15 Q