3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array("tid"=>192, "Xname"=>"System", "descr"=>"TICKET FOR ORGANIZATION: System | ID: 0","severity"=>4,"roa_id"=>0,"xid"=>0), array("tid"=>5395, "Xname"=>"System", "descr"=>"New Customer - Sky Scape","severity"=>1,"roa_id"=>3,"xid"=>0), array("tid"=>5399, "Xname"=>"System", "descr"=>"New Customer - ","severity"=>1,"roa_id"=>0,"xid"=>0), array("tid"=>6269, "Xname"=>"dishant.sciencelogic.local", "descr"=>"CRITICAL MESSAGE FOR ALLY","severity"=>4,"roa_id"=>10,"xid"=>0) ); //print_r($data); foreach ($data as $key=>$val){ $sql = "SELECT id, notes FROM master_biz.ticket_notes WHERE notes REGEXP '.*SOW Request:.*' AND tid = " . $val['tid'] . " ORDER BY id DESC LIMIT 10"; } $notes = "<strong>SOW Request: Needed by 3/14/2016</strong><br /><table><tbody><tr><td>Request Type</td><td>Other</td></tr><tr><td>Request Date</td><td>3/2/2016</td></tr><tr><td>Needed By</td><td>3/14/2016</td></tr><tr><td>Customer Point of Contact (Requestor)</td><td>Wendy Wooley</td></tr></tbody></table>"; $regex = "/Needed\s+By.*(([1-9]|0[1-9]|1[012])\/([1-9]|[12][0-9]|3[01])\/20\d\d).*Customer Point of Contact/"; $reg_match = preg_match($regex,$notes,$matches); print_r($mateches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/AFdco
function name:  (null)
number of ops:  22
compiled vars:  !0 = $data, !1 = $val, !2 = $key, !3 = $sql, !4 = $notes, !5 = $regex, !6 = $reg_match, !7 = $matches, !8 = $mateches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $10     !0, ->9
          2    > > FE_FETCH_R                                       ~11     $10, !1, ->9
          3    >   ASSIGN                                                   !2, ~11
   13     4        FETCH_DIM_R                                      ~13     !1, 'tid'
          5        CONCAT                                           ~14     'SELECT+id%2C+notes+FROM+master_biz.ticket_notes+WHERE+notes+REGEXP+%27.%2ASOW+Request%3A.%2A%27+AND+tid+%3D+', ~13
          6        CONCAT                                           ~15     ~14, '+ORDER+BY+id+DESC+LIMIT+10'
          7        ASSIGN                                                   !3, ~15
   12     8      > JMP                                                      ->2
          9    >   FE_FREE                                                  $10
   16    10        ASSIGN                                                   !4, '%3Cstrong%3ESOW+Request%3A+Needed+by+3%2F14%2F2016%3C%2Fstrong%3E%3Cbr+%2F%3E%3Ctable%3E%3Ctbody%3E%3Ctr%3E%3Ctd%3ERequest+Type%3C%2Ftd%3E%3Ctd%3EOther%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3E%3Ctd%3ERequest+Date%3C%2Ftd%3E%3Ctd%3E3%2F2%2F2016%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3E%3Ctd%3ENeeded+By%3C%2Ftd%3E%3Ctd%3E3%2F14%2F2016%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3E%3Ctd%3ECustomer+Point+of+Contact+%28Requestor%29%3C%2Ftd%3E%3Ctd%3EWendy+Wooley%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Ftbody%3E%3C%2Ftable%3E'
   18    11        ASSIGN                                                   !5, '%2FNeeded%5Cs%2BBy.%2A%28%28%5B1-9%5D%7C0%5B1-9%5D%7C1%5B012%5D%29%5C%2F%28%5B1-9%5D%7C%5B12%5D%5B0-9%5D%7C3%5B01%5D%29%5C%2F20%5Cd%5Cd%29.%2ACustomer+Point+of+Contact%2F'
   19    12        INIT_FCALL                                               'preg_match'
         13        SEND_VAR                                                 !5
         14        SEND_VAR                                                 !4
         15        SEND_REF                                                 !7
         16        DO_ICALL                                         $19     
         17        ASSIGN                                                   !6, $19
   20    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !8
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.04 ms | 1396 KiB | 17 Q