3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mystring = "something/2018/02/something_else"; if(preg_match("~/\d{4}/\d{2}/~",$mystring,$out)){ echo "Found: {$out[0]}"; }else{ echo "Date components not found"; }
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 = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OQpH1
function name:  (null)
number of ops:  14
compiled vars:  !0 = $mystring, !1 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'something%2F2018%2F02%2Fsomething_else'
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%2F%5Cd%7B4%7D%2F%5Cd%7B2%7D%2F%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->12
    5     7    >   NOP                                                      
          8        FETCH_DIM_R                                      ~4      !1, 0
          9        FAST_CONCAT                                      ~5      'Found%3A+', ~4
         10        ECHO                                                     ~5
    4    11      > JMP                                                      ->13
    7    12    >   ECHO                                                     'Date+components+not+found'
    8    13    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.91 ms | 1009 KiB | 14 Q