3v4l.org

run code in 300+ PHP versions simultaneously
<?php // https://regex101.com/r/dxft9p/1 $string = 'Directed by David Fincher. Written by Jim Uhls. Based on the novel by Chuck Palahniuk.'; $regex = '#Directed by (?<director>\w+\s?\w+). Written by (?<author>\w+\s?\w+)#'; preg_match($regex, $string, $matches); echo 'Director - '.$matches['director']."\n"; echo 'Author - '.$matches['author'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuDL0
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'Directed+by+David+Fincher.+Written+by+Jim+Uhls.+Based+on+the+novel+by+Chuck+Palahniuk.'
    6     1        ASSIGN                                                   !1, '%23Directed+by+%28%3F%3Cdirector%3E%5Cw%2B%5Cs%3F%5Cw%2B%29.+Written+by+%28%3F%3Cauthor%3E%5Cw%2B%5Cs%3F%5Cw%2B%29%23'
    7     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    9     7        FETCH_DIM_R                                      ~6      !2, 'director'
          8        CONCAT                                           ~7      'Director+-+', ~6
          9        CONCAT                                           ~8      ~7, '%0A'
         10        ECHO                                                     ~8
   10    11        FETCH_DIM_R                                      ~9      !2, 'author'
         12        CONCAT                                           ~10     'Author+-+', ~9
         13        ECHO                                                     ~10
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.78 ms | 999 KiB | 14 Q