3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/<a ?.*?>([^<]+)<\/a>/m'; $str = '<li><a href="/somelink1">name1</a></li><li><a href="/somelink2">name2</a></li><li><a href="/somelink3">name3</a></li>'; $result = []; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result foreach($matches as $match){ $result[] = $match[1]; } print '<pre>'; print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/B7k58
function name:  (null)
number of ops:  22
compiled vars:  !0 = $re, !1 = $str, !2 = $result, !3 = $matches, !4 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2F%3Ca+%3F.%2A%3F%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Fa%3E%2Fm'
    3     1        ASSIGN                                                   !1, '%3Cli%3E%3Ca+href%3D%22%2Fsomelink1%22%3Ename1%3C%2Fa%3E%3C%2Fli%3E%3Cli%3E%3Ca+href%3D%22%2Fsomelink2%22%3Ename2%3C%2Fa%3E%3C%2Fli%3E%3Cli%3E%3Ca+href%3D%22%2Fsomelink3%22%3Ename3%3C%2Fa%3E%3C%2Fli%3E'
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !3
          7        SEND_VAL                                                 2
          8        SEND_VAL                                                 0
          9        DO_ICALL                                                 
    8    10      > FE_RESET_R                                       $9      !3, ->16
         11    > > FE_FETCH_R                                               $9, !4, ->16
    9    12    >   FETCH_DIM_R                                      ~11     !4, 1
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  ~11
    8    15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $9
   11    17        ECHO                                                     '%3Cpre%3E'
   12    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.16 ms | 1011 KiB | 15 Q