3v4l.org

run code in 300+ PHP versions simultaneously
<?php $appt_notes = "Packet emailed 09-26-2014 14:21:47"; preg_match_all("/packet (e{0,1}mailed) (\d{2,4}-\d{2}-\d{2,4})/i",$appt_notes,$matches,PREG_SET_ORDER); if (!empty($matches)) { $packet_sentby = $matches[count($matches)-1][1]; if (preg_match("/^\d4/",$matches[count($matches)-1][2])) $packet_date = date('m-d',strtotime($matches[count($matches)-1][2])); else $packet_date = date_format(date_create_from_format('Y-m-d',$matches[count($matches)-1][2]),'m-d'); } else { $packet_sentby = ""; $packet_date = ""; } echo "Notes = $appt_notes <br>\n<br>\n"; echo $packet_sentby . "<br>\n" . $packet_date; echo "<hr>\n"; print_r($matches); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 51
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 37
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0PMlk
function name:  (null)
number of ops:  65
compiled vars:  !0 = $appt_notes, !1 = $matches, !2 = $packet_sentby, !3 = $packet_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Packet+emailed+09-26-2014+14%3A21%3A47'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2Fpacket+%28e%7B0%2C1%7Dmailed%29+%28%5Cd%7B2%2C4%7D-%5Cd%7B2%7D-%5Cd%7B2%2C4%7D%29%2Fi'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        DO_ICALL                                                 
    5     7        ISSET_ISEMPTY_CV                                 ~6      !1
          8        BOOL_NOT                                         ~7      ~6
          9      > JMPZ                                                     ~7, ->51
    7    10    >   COUNT                                            ~8      !1
         11        SUB                                              ~9      ~8, 1
         12        FETCH_DIM_R                                      ~10     !1, ~9
         13        FETCH_DIM_R                                      ~11     ~10, 1
         14        ASSIGN                                                   !2, ~11
    8    15        INIT_FCALL                                               'preg_match'
         16        SEND_VAL                                                 '%2F%5E%5Cd4%2F'
         17        COUNT                                            ~13     !1
         18        SUB                                              ~14     ~13, 1
         19        FETCH_DIM_R                                      ~15     !1, ~14
         20        FETCH_DIM_R                                      ~16     ~15, 2
         21        SEND_VAL                                                 ~16
         22        DO_ICALL                                         $17     
         23      > JMPZ                                                     $17, ->37
         24    >   INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'm-d'
         26        INIT_FCALL                                               'strtotime'
         27        COUNT                                            ~18     !1
         28        SUB                                              ~19     ~18, 1
         29        FETCH_DIM_R                                      ~20     !1, ~19
         30        FETCH_DIM_R                                      ~21     ~20, 2
         31        SEND_VAL                                                 ~21
         32        DO_ICALL                                         $22     
         33        SEND_VAR                                                 $22
         34        DO_ICALL                                         $23     
         35        ASSIGN                                                   !3, $23
         36      > JMP                                                      ->50
    9    37    >   INIT_FCALL                                               'date_format'
         38        INIT_FCALL                                               'date_create_from_format'
         39        SEND_VAL                                                 'Y-m-d'
         40        COUNT                                            ~25     !1
         41        SUB                                              ~26     ~25, 1
         42        FETCH_DIM_R                                      ~27     !1, ~26
         43        FETCH_DIM_R                                      ~28     ~27, 2
         44        SEND_VAL                                                 ~28
         45        DO_ICALL                                         $29     
         46        SEND_VAR                                                 $29
         47        SEND_VAL                                                 'm-d'
         48        DO_ICALL                                         $30     
         49        ASSIGN                                                   !3, $30
         50    > > JMP                                                      ->53
   12    51    >   ASSIGN                                                   !2, ''
   13    52        ASSIGN                                                   !3, ''
   16    53    >   ROPE_INIT                                     3  ~35     'Notes+%3D+'
         54        ROPE_ADD                                      1  ~35     ~35, !0
         55        ROPE_END                                      2  ~34     ~35, '+%3Cbr%3E%0A%3Cbr%3E%0A'
         56        ECHO                                                     ~34
   17    57        CONCAT                                           ~37     !2, '%3Cbr%3E%0A'
         58        CONCAT                                           ~38     ~37, !3
         59        ECHO                                                     ~38
   18    60        ECHO                                                     '%3Chr%3E%0A'
   21    61        INIT_FCALL                                               'print_r'
         62        SEND_VAR                                                 !1
         63        DO_ICALL                                                 
   23    64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.27 ms | 1395 KiB | 28 Q