3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '(`anurag`, 1,2), (1,2,3, `dm0c60544`),(2 ,3 ,3) '; $pattern = '#`.+`#'; // our regex pattern $string = preg_replace($pattern, '', $string); //replace backticked text and the following comma $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 echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PEYO0
function name:  (null)
number of ops:  34
compiled vars:  !0 = $string, !1 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%28%60anurag%60%2C+1%2C2%29%2C+%281%2C2%2C3%2C+%60dm0c60544%60%29%2C%282+%2C3++%2C3%29+'
    5     1        ASSIGN                                                   !1, '%23%60.%2B%60%23'
    7     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !0, $4
    9     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 '+'
         10        SEND_VAL                                                 ''
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !0, $6
   10    14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '%28%2C'
         16        SEND_VAL                                                 '%28'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !0, $8
   11    20        INIT_FCALL                                               'str_replace'
         21        SEND_VAL                                                 '%2C%29'
         22        SEND_VAL                                                 '%29'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $10     
         25        ASSIGN                                                   !0, $10
   12    26        INIT_FCALL                                               'str_replace'
         27        SEND_VAL                                                 '%2C%2C'
         28        SEND_VAL                                                 '%2C'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $12     
         31        ASSIGN                                                   !0, $12
   14    32        ECHO                                                     !0
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.96 ms | 1388 KiB | 17 Q