3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = ' John David James (DEM) . . . . . . 7,808 10.51 Marvin D. Scott (DEM) . . . . . . 6,548 9.55 Maria "Mary" Williams (DEM) . . . . 4,551 8.58 Dwayne R. Johnson. . . . . . . . 4,322 8.22 WRITE-IN. . . . . . . . . . . 188 .29'; preg_match_all("/\s*(.*?)\s*\. \..*?([\d,]+)/", $str, $matches); foreach($matches[1] as $key => $name){ $new[] = $name . "," . str_replace(",", "", $matches[2][$key]); } Var_dump($new);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/SdqoZ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str, !1 = $matches, !2 = $name, !3 = $key, !4 = $new
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '+++++++John+David+James+%28DEM%29+.++.++.++.++.++.+++++7%2C808+++10.51%0A+++++++Marvin+D.+Scott+%28DEM%29++.++.++.++.++.++.+++++6%2C548++++9.55%0A+++++++Maria+%22Mary%22+Williams+%28DEM%29++.++.++.++.+++++4%2C551++++8.58%0A+++++++Dwayne+R.+Johnson.++.++.++.++.++.++.++.+++++4%2C322++++8.22%0A+++++++WRITE-IN.++.++.++.++.++.++.++.++.++.++.+++++++188+++++.29'
    8     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%2F%5Cs%2A%28.%2A%3F%29%5Cs%2A%5C.++%5C..%2A%3F%28%5B%5Cd%2C%5D%2B%29%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
   10     6        FETCH_DIM_R                                          ~7      !1, 1
          7      > FE_RESET_R                                           $8      ~7, ->19
          8    > > FE_FETCH_R                                           ~9      $8, !2, ->19
          9    >   ASSIGN                                                       !3, ~9
   11    10        CONCAT                                               ~12     !2, '%2C'
         11        FETCH_DIM_R                                          ~13     !1, 2
         12        FETCH_DIM_R                                          ~14     ~13, !3
         13        FRAMELESS_ICALL_3                str_replace         ~15     '%2C', ''
         14        OP_DATA                                                      ~14
         15        CONCAT                                               ~16     ~12, ~15
         16        ASSIGN_DIM                                                   !4
         17        OP_DATA                                                      ~16
   10    18      > JMP                                                          ->8
         19    >   FE_FREE                                                      $8
   15    20        INIT_FCALL                                                   'var_dump'
         21        SEND_VAR                                                     !4
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.33 ms | 2151 KiB | 15 Q