3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "This is one string with this picture pic1.jpg and here there's another one pic2.png for example"; $pat = '/\w+\d\.[a-zA-Z]{3}/'; $arrImg = null; if (preg_match_all( $pat, $str, $matches, PREG_PATTERN_ORDER )) { $arrImg = array_pop($matches); print_r($arrImg); } else { echo "no matches"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UFc9e
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $pat, !2 = $arrImg, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+is+one+string+with+this+picture+pic1.jpg+and+here+there%27s+another+one+pic2.png+for+example'
    4     1        ASSIGN                                                   !1, '%2F%5Cw%2B%5Cd%5C.%5Ba-zA-Z%5D%7B3%7D%2F'
    6     2        ASSIGN                                                   !2, null
    7     3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !3
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->18
    8    10    >   INIT_FCALL                                               'array_pop'
         11        SEND_REF                                                 !3
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    9    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
    7    17      > JMP                                                      ->19
   13    18    >   ECHO                                                     'no+matches'
   14    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.6 ms | 1003 KiB | 16 Q