3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = 'Yth. ErzaPay.com (DS008206). Sal:465.670, Dlm proses:0. Pemakaian hr ini:126.885 Komisi:0 #*IDN1,IDN3 Open harga naik'; echo preg_match('~Sal:\K[^,]+~', $input, $out) ? $out[0] : 'no match'; echo "\n---\n"; echo preg_replace('~^.*?Sal:|,.*?$~', '', $input); echo "\n---\n"; echo strstr(explode('Sal:', $input, 2)[1], ',', true); echo "\n---\n"; echo explode(',', explode('Sal:', $input, 2)[1], 2)[0]; echo "\n---\n"; if (($startPos = strpos($input, 'Sal:')) !== false && ($endPos = strpos($input, ',', $startPos)) !== false) { $substrPos = $startPos + 4; $substrLen = $endPos - $substrPos; echo substr($input, $substrPos, $substrLen); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 45, Position 2 = 50
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 58
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
Branch analysis from position: 50
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 45, Position 2 = 50
Branch analysis from position: 45
Branch analysis from position: 50
filename:       /in/a81VQ
function name:  (null)
number of ops:  59
compiled vars:  !0 = $input, !1 = $out, !2 = $startPos, !3 = $endPos, !4 = $substrPos, !5 = $substrLen
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'Yth.+ErzaPay.com+%28DS008206%29.+Sal%3A465.670%2C+Dlm+proses%3A0.+Pemakaian+hr+ini%3A126.885+Komisi%3A0+%23%2AIDN1%2CIDN3+Open+harga+naik'
    4     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%7ESal%3A%5CK%5B%5E%2C%5D%2B%7E'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $7      
          6      > JMPZ                                                         $7, ->10
          7    >   FETCH_DIM_R                                          ~8      !1, 0
          8        QM_ASSIGN                                            ~9      ~8
          9      > JMP                                                          ->11
         10    >   QM_ASSIGN                                            ~9      'no+match'
         11    >   ECHO                                                         ~9
    6    12        ECHO                                                         '%0A---%0A'
    8    13        FRAMELESS_ICALL_3                preg_replace        ~10     '%7E%5E.%2A%3FSal%3A%7C%2C.%2A%3F%24%7E', ''
         14        OP_DATA                                                      !0
         15        ECHO                                                         ~10
   10    16        ECHO                                                         '%0A---%0A'
   12    17        INIT_FCALL                                                   'explode'
         18        SEND_VAL                                                     'Sal%3A'
         19        SEND_VAR                                                     !0
         20        SEND_VAL                                                     2
         21        DO_ICALL                                             $11     
         22        FETCH_DIM_R                                          ~12     $11, 1
         23        FRAMELESS_ICALL_3                strstr              ~13     ~12, '%2C'
         24        OP_DATA                                                      <true>
         25        ECHO                                                         ~13
   14    26        ECHO                                                         '%0A---%0A'
   16    27        INIT_FCALL                                                   'explode'
         28        SEND_VAL                                                     '%2C'
         29        INIT_FCALL                                                   'explode'
         30        SEND_VAL                                                     'Sal%3A'
         31        SEND_VAR                                                     !0
         32        SEND_VAL                                                     2
         33        DO_ICALL                                             $14     
         34        FETCH_DIM_R                                          ~15     $14, 1
         35        SEND_VAL                                                     ~15
         36        SEND_VAL                                                     2
         37        DO_ICALL                                             $16     
         38        FETCH_DIM_R                                          ~17     $16, 0
         39        ECHO                                                         ~17
   18    40        ECHO                                                         '%0A---%0A'
   20    41        FRAMELESS_ICALL_2                strpos              ~18     !0, 'Sal%3A'
         42        ASSIGN                                               ~19     !2, ~18
         43        TYPE_CHECK                                      1018  ~20     ~19
         44      > JMPZ_EX                                              ~20     ~20, ->50
         45    >   FRAMELESS_ICALL_3                strpos              ~21     !0, '%2C'
         46        OP_DATA                                                      !2
         47        ASSIGN                                               ~22     !3, ~21
         48        TYPE_CHECK                                      1018  ~23     ~22
         49        BOOL                                                 ~20     ~23
         50    > > JMPZ                                                         ~20, ->58
   21    51    >   ADD                                                  ~24     !2, 4
         52        ASSIGN                                                       !4, ~24
   22    53        SUB                                                  ~26     !3, !4
         54        ASSIGN                                                       !5, ~26
   23    55        FRAMELESS_ICALL_3                substr              ~28     !0, !4
         56        OP_DATA                                                      !5
         57        ECHO                                                         ~28
   24    58    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
205.97 ms | 2089 KiB | 15 Q