3v4l.org

run code in 300+ 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 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/SdqoZ
function name:  (null)
number of ops:  27
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, ->22
          8    > > FE_FETCH_R                                       ~9      $8, !2, ->22
          9    >   ASSIGN                                                   !3, ~9
   11    10        CONCAT                                           ~12     !2, '%2C'
         11        INIT_FCALL                                               'str_replace'
         12        SEND_VAL                                                 '%2C'
         13        SEND_VAL                                                 ''
         14        FETCH_DIM_R                                      ~13     !1, 2
         15        FETCH_DIM_R                                      ~14     ~13, !3
         16        SEND_VAL                                                 ~14
         17        DO_ICALL                                         $15     
         18        CONCAT                                           ~16     ~12, $15
         19        ASSIGN_DIM                                               !4
         20        OP_DATA                                                  ~16
   10    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $8
   15    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.34 ms | 1070 KiB | 16 Q