3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = "O'Connor, Doris B. - 09-01-2014 - a00005213.exe"; preg_match("/^[\w']+/", $name, $matches); if (strlen($matches[0]) >= 4) $searchstr = substr($matches[0], 0 ,4); else $searchstr = $matches[0]; print($searchstr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QhaZU
function name:  (null)
number of ops:  22
compiled vars:  !0 = $name, !1 = $matches, !2 = $searchstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'O%27Connor%2C+Doris+B.+-+09-01-2014+-+a00005213.exe'
    7     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%5B%5Cw%27%5D%2B%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   10     6        FETCH_DIM_R                                      ~5      !1, 0
          7        STRLEN                                           ~6      ~5
          8        IS_SMALLER_OR_EQUAL                                      4, ~6
          9      > JMPZ                                                     ~7, ->18
         10    >   INIT_FCALL                                               'substr'
         11        FETCH_DIM_R                                      ~8      !1, 0
         12        SEND_VAL                                                 ~8
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 4
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
         17      > JMP                                                      ->20
   11    18    >   FETCH_DIM_R                                      ~11     !1, 0
         19        ASSIGN                                                   !2, ~11
   14    20    >   ECHO                                                     !2
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.02 ms | 1395 KiB | 17 Q