3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = [ "Mr. Kiefer William Frederick Dempsey George Rufus Sutherland Sr.", "Carolina Maria de Jesus", "Kiefer William Frederick Dempsey George Rufus Sutherland Jr.", "Mrs. Carolina Maria de Jesus"]; foreach($names as $name) { preg_match('/(?:\w+\. )?(\w+).*?(\w+)(?: \w+\.)?$/', $name, $result); echo $result[1] . ' ' . $result[2] . ' = ' . $result[1][0].$result[2][0] . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 22
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/WUfSX
function name:  (null)
number of ops:  24
compiled vars:  !0 = $names, !1 = $name, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $4      !0, ->22
          2    > > FE_FETCH_R                                               $4, !1, ->22
   10     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%28%3F%3A%5Cw%2B%5C.+%29%3F%28%5Cw%2B%29.%2A%3F%28%5Cw%2B%29%28%3F%3A+%5Cw%2B%5C.%29%3F%24%2F'
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !2
          7        DO_ICALL                                                 
   11     8        FETCH_DIM_R                                      ~6      !2, 1
          9        CONCAT                                           ~7      ~6, '+'
         10        FETCH_DIM_R                                      ~8      !2, 2
         11        CONCAT                                           ~9      ~7, ~8
         12        CONCAT                                           ~10     ~9, '+%3D+'
         13        FETCH_DIM_R                                      ~11     !2, 1
         14        FETCH_DIM_R                                      ~12     ~11, 0
         15        CONCAT                                           ~13     ~10, ~12
         16        FETCH_DIM_R                                      ~14     !2, 2
         17        FETCH_DIM_R                                      ~15     ~14, 0
         18        CONCAT                                           ~16     ~13, ~15
         19        CONCAT                                           ~17     ~16, '%0A'
         20        ECHO                                                     ~17
    9    21      > JMP                                                      ->2
         22    >   FE_FREE                                                  $4
   12    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.19 ms | 1445 KiB | 14 Q