3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Maybe put this in a filter class? function removeQuotedValues($string) { $pattern = '#`\W+`#'; // our regex pattern $string = preg_replace($pattern, '', $string); //remove `backtickedStrings` echo $string ."\n"; $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/2W2ia
function name:  (null)
number of ops:  6
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, '%28%60anurag%60%2C+1%2C2%29%2C+%281%2C2%2C3%2C+%60dm0c60544%60%29%2C%282+%2C3++%2C3%29+'
   19     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/2W2ia
function name:  removeQuotedValues
number of ops:  36
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%5CW%2B%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        CONCAT                                           ~5      !0, '%0A'
          9        ECHO                                                     ~5
    9    10        INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 '+'
         12        SEND_VAL                                                 ''
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !0, $6
   10    16        INIT_FCALL                                               'str_replace'
         17        SEND_VAL                                                 '%28%2C'
         18        SEND_VAL                                                 '%28'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $8      
         21        ASSIGN                                                   !0, $8
   11    22        INIT_FCALL                                               'str_replace'
         23        SEND_VAL                                                 '%2C%29'
         24        SEND_VAL                                                 '%29'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $10     
         27        ASSIGN                                                   !0, $10
   12    28        INIT_FCALL                                               'str_replace'
         29        SEND_VAL                                                 '%2C%2C'
         30        SEND_VAL                                                 '%2C'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $12     
         33        ASSIGN                                                   !0, $12
   13    34      > RETURN                                                   !0
   14    35*     > RETURN                                                   null

End of function removequotedvalues

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
210.02 ms | 1402 KiB | 18 Q