3v4l.org

run code in 300+ PHP versions simultaneously
<?php $kod = ' - '; if ( preg_match('/kód SAM(?<digit>\d{3}?)/', 'cokoliv (kód SAM123)', $matches) ) {$kod = trim($matches['digit']);} echo $kod;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/s9C0A
function name:  (null)
number of ops:  14
compiled vars:  !0 = $kod, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '+-+'
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2Fk%C3%B3d+SAM%28%3F%3Cdigit%3E%5Cd%7B3%7D%3F%29%2F'
          3        SEND_VAL                                                 'cokoliv+%28k%C3%B3d+SAM123%29'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->12
          7    >   INIT_FCALL                                               'trim'
          8        FETCH_DIM_R                                      ~4      !1, 'digit'
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !0, $5
    4    12    >   ECHO                                                     !0
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.74 ms | 1394 KiB | 17 Q