3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Maybe put this in a filter class? function removeQuotedValues($string) { $pattern = '#`[a-zA-Z0-9]+`#'; // our regex pattern $string = preg_replace($pattern, '', $string); //remove `backtickedStrings` $replace = array(' ' => '', '(,' => '(', ',)' => ')', ',,' => ','); foreach ($replace as $old => $new) { $string = str_replace($old, $new, $string); } return $string; } $string = '(`getridofme`, 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/2uQU4
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%60getridofme%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
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/2uQU4
function name:  removeQuotedValues
number of ops:  22
compiled vars:  !0 = $string, !1 = $pattern, !2 = $replace, !3 = $new, !4 = $old
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, '%23%60%5Ba-zA-Z0-9%5D%2B%60%23'
    7     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !0, $6
    8     8        ASSIGN                                                   !2, <array>
    9     9      > FE_RESET_R                                       $9      !2, ->19
         10    > > FE_FETCH_R                                       ~10     $9, !3, ->19
         11    >   ASSIGN                                                   !4, ~10
   10    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAR                                                 !4
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !0, $12
    9    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $9
   12    20      > RETURN                                                   !0
   13    21*     > RETURN                                                   null

End of function removequotedvalues

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.86 ms | 1399 KiB | 18 Q