3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "2 x Brew Coffeee Panas: RM7.42 x Tongkat Ali Ais: RM8.6"; var_export(preg_match_all('~(\d+) x ([^:]+): RM(\d+\.\d)~', $string, $m) ? array_slice($m, 1) : []);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FbOC0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $string, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2+x+Brew+Coffeee+Panas%3A+RM7.42+x+Tongkat+Ali+Ais%3A+RM8.6'
    6     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%7E%28%5Cd%2B%29+x+%28%5B%5E%3A%5D%2B%29%3A+RM%28%5Cd%2B%5C.%5Cd%29%7E'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->14
          8    >   INIT_FCALL                                               'array_slice'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $4      
         12        QM_ASSIGN                                        ~5      $4
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~5      <array>
         15    >   SEND_VAL                                                 ~5
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.49 ms | 1395 KiB | 19 Q