3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'https://someurl.com "This is a \"quote\" in the caption"'; list($url, $caption)=(preg_match('~(\S+) "(.+)"~', $input, $out) ? array_slice($out,1) : ['','']); echo "url: $url\ncaption: $caption";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RK3J1
function name:  (null)
number of ops:  25
compiled vars:  !0 = $input, !1 = $out, !2 = $url, !3 = $caption
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fsomeurl.com+%22This+is+a+%5C%22quote%5C%22+in+the+caption%22'
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%28%5CS%2B%29+%22%28.%2B%29%22%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $5      
          6      > JMPZ                                                     $5, ->13
          7    >   INIT_FCALL                                               'array_slice'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $6      
         11        QM_ASSIGN                                        ~7      $6
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      <array>
         14    >   FETCH_LIST_R                                     $8      ~7, 0
         15        ASSIGN                                                   !2, $8
         16        FETCH_LIST_R                                     $10     ~7, 1
         17        ASSIGN                                                   !3, $10
         18        FREE                                                     ~7
    4    19        ROPE_INIT                                     4  ~13     'url%3A+'
         20        ROPE_ADD                                      1  ~13     ~13, !2
         21        ROPE_ADD                                      2  ~13     ~13, '%0Acaption%3A+'
         22        ROPE_END                                      3  ~12     ~13, !3
         23        ECHO                                                     ~12
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.83 ms | 999 KiB | 15 Q