3v4l.org

run code in 300+ PHP versions simultaneously
<?php $word = 'Song'; $string = "some words http://I_like_to_sing.mp3 and then some other words http://Another_song.mp3 and some words at the end..."; $regex = "/(https?:\/\/(?![^.]*$word).+?\.mp3)/i"; preg_match_all($regex, $string, $matches); print_r($matches[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dS9LF
function name:  (null)
number of ops:  16
compiled vars:  !0 = $word, !1 = $string, !2 = $regex, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Song'
    4     1        ASSIGN                                                   !1, 'some+words+http%3A%2F%2FI_like_to_sing.mp3+and+then+some+other+words+http%3A%2F%2FAnother_song.mp3+and+some+words+at+the+end...'
    5     2        ROPE_INIT                                     3  ~7      '%2F%28https%3F%3A%5C%2F%5C%2F%28%3F%21%5B%5E.%5D%2A'
          3        ROPE_ADD                                      1  ~7      ~7, !0
          4        ROPE_END                                      2  ~6      ~7, '%29.%2B%3F%5C.mp3%29%2Fi'
          5        ASSIGN                                                   !2, ~6
    6     6        INIT_FCALL                                               'preg_match_all'
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !1
          9        SEND_REF                                                 !3
         10        DO_ICALL                                                 
    7    11        INIT_FCALL                                               'print_r'
         12        FETCH_DIM_R                                      ~11     !3, 1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
263.85 ms | 1002 KiB | 15 Q