3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Maybe put this in a filter class? function removeQuotedValues($string) { $pattern = '#`.?`#'; // our regex pattern $string = preg_replace($pattern, '', $string); //remove `backtickedStrings` $string = str_replace(' ', '', $string); // remove unwanted whitespace $string = str_replace('(,', '(', $string); // remove unwanted comma $string = str_replace(',)', ')', $string); // remove unwanted comma $string = str_replace(',,', ',', $string); // remove unwanted comma return $string; } $string = '(`anurag`, 1,2), (1,2,3, `dm0c60544`),(2 ,3 ,3) '; echo removeQuotedValues($string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6JWp9
function name:  (null)
number of ops:  6
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, '%28%60anurag%60%2C+1%2C2%29%2C+%281%2C2%2C3%2C+%60dm0c60544%60%29%2C%282+%2C3++%2C3%29+'
   18     1        INIT_FCALL                                               'removequotedvalues'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function removequotedvalues:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6JWp9
function name:  removeQuotedValues
number of ops:  34
compiled vars:  !0 = $string, !1 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, '%23%60.%3F%60%23'
    7     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
    8     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 '+'
         10        SEND_VAL                                                 ''
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !0, $5
    9    14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '%28%2C'
         16        SEND_VAL                                                 '%28'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $7      
         19        ASSIGN                                                   !0, $7
   10    20        INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 '%2C%29'
         22        SEND_VAL                                                 '%29'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $9      
         25        ASSIGN                                                   !0, $9
   11    26        INIT_FCALL                                               'str_replace'
         27        SEND_VAL                                                 '%2C%2C'
         28        SEND_VAL                                                 '%2C'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $11     
         31        ASSIGN                                                   !0, $11
   12    32      > RETURN                                                   !0
   13    33*     > RETURN                                                   null

End of function removequotedvalues

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.25 ms | 1403 KiB | 18 Q