3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strLimit = explode(',',"rpt_Job_Tracking,rpt_Customer_Routing_Report"); $str ="<optgroup label='Billing Summary Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='JobTracking'>Job Tracking</option> <option style='color:black; font-weight:normal' value='CustomerRouting' selected>Customer Routing Report</option> <option style='color:black; font-weight:normal' value='BillingStatistics'>Billing Statistics</option> <option style='color:black; font-weight:normal' value='BranchReport'>Branch Report</option> <option style='color:black; font-weight:normal' value='BranchBilling'>Branch Billing Report</option> <option style='color:black; font-weight:normal' value='BillingActivityDetail'>Billing Activity Details</option> </optgroup> <optgroup label='e-Adoption Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='eAdoptionDashboard'>e-Adoption Dashboard</option> <option style='color:black; font-weight:normal' value='eAdoptionReport'>e-Adoption Chart</option> <option style='color:black; font-weight:normal' value='TopBillingCusts'>Top Paper Customers</option> <option style='color:black; font-weight:normal' value='TopBillingCustsAcctNum'>Top Paper Custs by Acct Num</option> <option style='color:black; font-weight:normal' value='BranchEBillReport'>Branch Electronic Report</option> <option style='color:black; font-weight:normal' value='EasyImportUsage'>EasyImport Usage</option> </optgroup> <optgroup label='eBilling and ePayment' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='OnlinePayments'>Online Payments</option> <option style='color:black; font-weight:normal' value='PaymentFile'>Payment File Report</option> <option style='color:black; font-weight:normal' value='ACHTransfers'>ACH Transfers</option> <option style='color:black; font-weight:normal' value='IGUsage'>Invoice Gateway Usage Report</option> <option style='color:black; font-weight:normal' value='ObpAccountAudit'>Online Account Audit Report</option> <option style='color:black; font-weight:normal' value='EUsageReport'>Invoice Central Usage Report</option> <option style='color:black; font-weight:normal' value='IGUsers'>Online User Report</option> <option style='color:black; font-weight:normal' value='eDSOReport'>eDSO By Month</option> <option style='color:black; font-weight:normal' value='AutoPay'>Auto Pay Report</option> </optgroup> <optgroup label='Bullpen Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='BPInvoices'>Bullpenned Invoices</option> <option style='color:black; font-weight:normal' value='BPStatistics'>Bullpen Statistics</option> </optgroup> <optgroup label='Address Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='UncertifiedAddresses'>Uncertified Addresses</option> <option style='color:black; font-weight:normal' value='NCOAAddressesReport'>NCOA Addresses</option> </optgroup> <optgroup label='Miscellaneous' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='InvoiceExtract'>Invoice Extract</option> <option style='color:black; font-weight:normal' value='FaxFailures'>Fax Failures</option> <option style='color:black; font-weight:normal' value='EmailFailures'>Transmittal Failures</option>"; $newStrItem = $newList = array(); foreach($strLimit as $strItem){ $strItem = str_replace('_', ' ', $strItem); $strItem = str_replace('rpt ', '', $strItem); $newStrItem[] = $strItem; } $rptList = array(); $doc = new DOMDocument(); $doc->loadHTML($str); $headings = $doc->getElementsByTagName('optgroup'); foreach($headings as $heading) { $parentItem = $heading->getAttribute('label'); if($heading->hasChildNodes()) { $childItems = $heading->getElementsByTagName('option'); foreach ($childItems as $childItem) { $rptList[$parentItem][] = $childItem->nodeValue; } } } foreach($rptList as $listKey=> $listVal) { $newArray[$listKey] = array_intersect($newStrItem, $listVal); } $newList = array_filter($newArray); $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadHTML($str); $headings = $doc->getElementsByTagName('optgroup'); foreach($newList as $arrKey => $arrVal){ if($arrKey != $heading->getAttribute('label')){ $dom->removeChild($headings); } } echo $dom->saveHTML(); //print_r($newList);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 59
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 59
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 58
Branch analysis from position: 46
2 jumps found. (Code = 77) Position 1 = 51, Position 2 = 57
Branch analysis from position: 51
2 jumps found. (Code = 78) Position 1 = 52, Position 2 = 57
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 57
Branch analysis from position: 58
Branch analysis from position: 59
2 jumps found. (Code = 77) Position 1 = 61, Position 2 = 70
Branch analysis from position: 61
2 jumps found. (Code = 78) Position 1 = 62, Position 2 = 70
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 70
2 jumps found. (Code = 77) Position 1 = 88, Position 2 = 99
Branch analysis from position: 88
2 jumps found. (Code = 78) Position 1 = 89, Position 2 = 99
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 95, Position 2 = 98
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
Branch analysis from position: 98
Branch analysis from position: 99
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 99
Branch analysis from position: 70
Branch analysis from position: 59
Branch analysis from position: 25
filename:       /in/DkXsZ
function name:  (null)
number of ops:  104
compiled vars:  !0 = $strLimit, !1 = $str, !2 = $newStrItem, !3 = $newList, !4 = $strItem, !5 = $rptList, !6 = $doc, !7 = $headings, !8 = $heading, !9 = $parentItem, !10 = $childItems, !11 = $childItem, !12 = $listVal, !13 = $listKey, !14 = $newArray, !15 = $dom, !16 = $arrVal, !17 = $arrKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '%2C'
          2        SEND_VAL                                                 'rpt_Job_Tracking%2Crpt_Customer_Routing_Report'
          3        DO_ICALL                                         $18     
          4        ASSIGN                                                   !0, $18
    5     5        ASSIGN                                                   !1, '%3Coptgroup+label%3D%27Billing+Summary+Reports%27+style%3D%27color%3Ablue%3Bfont-weight%3Abold%3B%27%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27JobTracking%27%3EJob+Tracking%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27CustomerRouting%27+selected%3ECustomer+Routing+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BillingStatistics%27%3EBilling+Statistics%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BranchReport%27%3EBranch+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BranchBilling%27%3EBranch+Billing+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BillingActivityDetail%27%3EBilling+Activity+Details%3C%2Foption%3E%0A%3C%2Foptgroup%3E%0A%3Coptgroup+label%3D%27e-Adoption+Reports%27+style%3D%27color%3Ablue%3Bfont-weight%3Abold%3B%27%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27eAdoptionDashboard%27%3Ee-Adoption+Dashboard%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27eAdoptionReport%27%3Ee-Adoption+Chart%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27TopBillingCusts%27%3ETop+Paper+Customers%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27TopBillingCustsAcctNum%27%3ETop+Paper+Custs+by+Acct+Num%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BranchEBillReport%27%3EBranch+Electronic+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27EasyImportUsage%27%3EEasyImport+Usage%3C%2Foption%3E%0A%3C%2Foptgroup%3E%0A%3Coptgroup+label%3D%27eBilling+and+ePayment%27+style%3D%27color%3Ablue%3Bfont-weight%3Abold%3B%27%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27OnlinePayments%27%3EOnline+Payments%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27PaymentFile%27%3EPayment+File+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27ACHTransfers%27%3EACH+Transfers%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27IGUsage%27%3EInvoice+Gateway+Usage+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27ObpAccountAudit%27%3EOnline+Account+Audit+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27EUsageReport%27%3EInvoice+Central+Usage+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27IGUsers%27%3EOnline+User+Report%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27eDSOReport%27%3EeDSO+By+Month%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27AutoPay%27%3EAuto+Pay+Report%3C%2Foption%3E%0A%3C%2Foptgroup%3E%0A%3Coptgroup+label%3D%27Bullpen+Reports%27+style%3D%27color%3Ablue%3Bfont-weight%3Abold%3B%27%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BPInvoices%27%3EBullpenned+Invoices%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27BPStatistics%27%3EBullpen+Statistics%3C%2Foption%3E%0A%3C%2Foptgroup%3E%0A%3Coptgroup+label%3D%27Address+Reports%27+style%3D%27color%3Ablue%3Bfont-weight%3Abold%3B%27%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27UncertifiedAddresses%27%3EUncertified+Addresses%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27NCOAAddressesReport%27%3ENCOA+Addresses%3C%2Foption%3E%0A%3C%2Foptgroup%3E%0A%3Coptgroup+label%3D%27Miscellaneous%27+style%3D%27color%3Ablue%3Bfont-weight%3Abold%3B%27%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27InvoiceExtract%27%3EInvoice+Extract%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27FaxFailures%27%3EFax+Failures%3C%2Foption%3E%0A++++%3Coption+style%3D%27color%3Ablack%3B+font-weight%3Anormal%27+value%3D%27EmailFailures%27%3ETransmittal+Failures%3C%2Foption%3E'
   46     6        ASSIGN                                           ~21     !3, <array>
          7        ASSIGN                                                   !2, ~21
   47     8      > FE_RESET_R                                       $23     !0, ->25
          9    > > FE_FETCH_R                                               $23, !4, ->25
   48    10    >   INIT_FCALL                                               'str_replace'
         11        SEND_VAL                                                 '_'
         12        SEND_VAL                                                 '+'
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $24     
         15        ASSIGN                                                   !4, $24
   49    16        INIT_FCALL                                               'str_replace'
         17        SEND_VAL                                                 'rpt+'
         18        SEND_VAL                                                 ''
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $26     
         21        ASSIGN                                                   !4, $26
   50    22        ASSIGN_DIM                                               !2
         23        OP_DATA                                                  !4
   47    24      > JMP                                                      ->9
         25    >   FE_FREE                                                  $23
   53    26        ASSIGN                                                   !5, <array>
   55    27        NEW                                              $30     'DOMDocument'
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !6, $30
   56    30        INIT_METHOD_CALL                                         !6, 'loadHTML'
         31        SEND_VAR_EX                                              !1
         32        DO_FCALL                                      0          
   57    33        INIT_METHOD_CALL                                         !6, 'getElementsByTagName'
         34        SEND_VAL_EX                                              'optgroup'
         35        DO_FCALL                                      0  $34     
         36        ASSIGN                                                   !7, $34
   58    37      > FE_RESET_R                                       $36     !7, ->59
         38    > > FE_FETCH_R                                               $36, !8, ->59
   59    39    >   INIT_METHOD_CALL                                         !8, 'getAttribute'
         40        SEND_VAL_EX                                              'label'
         41        DO_FCALL                                      0  $37     
         42        ASSIGN                                                   !9, $37
   60    43        INIT_METHOD_CALL                                         !8, 'hasChildNodes'
         44        DO_FCALL                                      0  $39     
         45      > JMPZ                                                     $39, ->58
   61    46    >   INIT_METHOD_CALL                                         !8, 'getElementsByTagName'
         47        SEND_VAL_EX                                              'option'
         48        DO_FCALL                                      0  $40     
         49        ASSIGN                                                   !10, $40
   62    50      > FE_RESET_R                                       $42     !10, ->57
         51    > > FE_FETCH_R                                               $42, !11, ->57
   63    52    >   FETCH_OBJ_R                                      ~45     !11, 'nodeValue'
         53        FETCH_DIM_W                                      $43     !5, !9
         54        ASSIGN_DIM                                               $43
         55        OP_DATA                                                  ~45
   62    56      > JMP                                                      ->51
         57    >   FE_FREE                                                  $42
   58    58    > > JMP                                                      ->38
         59    >   FE_FREE                                                  $36
   68    60      > FE_RESET_R                                       $46     !5, ->70
         61    > > FE_FETCH_R                                       ~47     $46, !12, ->70
         62    >   ASSIGN                                                   !13, ~47
   69    63        INIT_FCALL                                               'array_intersect'
         64        SEND_VAR                                                 !2
         65        SEND_VAR                                                 !12
         66        DO_ICALL                                         $50     
         67        ASSIGN_DIM                                               !14, !13
         68        OP_DATA                                                  $50
   68    69      > JMP                                                      ->61
         70    >   FE_FREE                                                  $46
   72    71        INIT_FCALL                                               'array_filter'
         72        SEND_VAR                                                 !14
         73        DO_ICALL                                         $51     
         74        ASSIGN                                                   !3, $51
   74    75        NEW                                              $53     'DOMDocument'
         76        DO_FCALL                                      0          
         77        ASSIGN                                                   !15, $53
   75    78        ASSIGN_OBJ                                               !15, 'preserveWhiteSpace'
         79        OP_DATA                                                  <false>
   76    80        INIT_METHOD_CALL                                         !15, 'loadHTML'
         81        SEND_VAR_EX                                              !1
         82        DO_FCALL                                      0          
   77    83        INIT_METHOD_CALL                                         !6, 'getElementsByTagName'
         84        SEND_VAL_EX                                              'optgroup'
         85        DO_FCALL                                      0  $58     
         86        ASSIGN                                                   !7, $58
   78    87      > FE_RESET_R                                       $60     !3, ->99
         88    > > FE_FETCH_R                                       ~61     $60, !16, ->99
         89    >   ASSIGN                                                   !17, ~61
   79    90        INIT_METHOD_CALL                                         !8, 'getAttribute'
         91        SEND_VAL_EX                                              'label'
         92        DO_FCALL                                      0  $63     
         93        IS_NOT_EQUAL                                             !17, $63
         94      > JMPZ                                                     ~64, ->98
   80    95    >   INIT_METHOD_CALL                                         !15, 'removeChild'
         96        SEND_VAR_EX                                              !7
         97        DO_FCALL                                      0          
   78    98    > > JMP                                                      ->88
         99    >   FE_FREE                                                  $60
   83   100        INIT_METHOD_CALL                                         !15, 'saveHTML'
        101        DO_FCALL                                      0  $66     
        102        ECHO                                                     $66
   85   103      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.19 ms | 1408 KiB | 21 Q