3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = 'hello | Hello there price | Lets talk about our support. how are you ?| Im fine '; $avp = []; if (preg_match_all('/^ \h* (?<key>[^|]+?) \h* \| \h* (?<value>[^$]+?) \h* $ /mx', $data, $matches, PREG_SET_ORDER)) { foreach ($matches as [, $key, $value]) { $avp[$key] = $value; } } print_r($avp); $word = 'how are you ?'; echo $avp[$word];
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 20
filename:       /in/uMBAg
function name:  (null)
number of ops:  27
compiled vars:  !0 = $data, !1 = $avp, !2 = $matches, !3 = $key, !4 = $value, !5 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'hello+%7C+Hello+there%0Aprice+%7C+Lets+talk+about+our+support.%0Ahow+are+you+%3F%7C+Im+fine+'
    6     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2F%5E+%5Ch%2A+%28%3F%3Ckey%3E%5B%5E%7C%5D%2B%3F%29+%5Ch%2A+%5C%7C+%5Ch%2A+%28%3F%3Cvalue%3E%5B%5E%24%5D%2B%3F%29+%5Ch%2A+%24+%2Fmx'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        SEND_VAL                                                 2
          7        DO_ICALL                                         $8      
          8      > JMPZ                                                     $8, ->20
    8     9    > > FE_RESET_R                                       $9      !2, ->19
         10    > > FE_FETCH_R                                               $9, $10, ->19
         11    >   FETCH_LIST_R                                     $11     $10, 1
         12        ASSIGN                                                   !3, $11
         13        FETCH_LIST_R                                     $13     $10, 2
         14        ASSIGN                                                   !4, $13
         15        FREE                                                     $10
    9    16        ASSIGN_DIM                                               !1, !3
         17        OP_DATA                                                  !4
    8    18      > JMP                                                      ->10
         19    >   FE_FREE                                                  $9
   13    20    >   INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   15    23        ASSIGN                                                   !5, 'how+are+you+%3F'
   16    24        FETCH_DIM_R                                      ~18     !1, !5
         25        ECHO                                                     ~18
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.39 ms | 1012 KiB | 15 Q