3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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>"; $doc = new DOMDocument(); $doc->loadHTML($str); $headings = $doc->getElementsByTagName('optgroup'); $books = $doc->getElementsByTagName('option'); foreach($headings as $heading) { print_r($heading->attributes->item('label')); } echo "\n\n\n"; foreach ($books as $book) { echo $book->nodeValue, PHP_EOL; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: DOMNamedNodeMap::item(): Argument #1 ($index) must be of type int, string given in /in/uZXuN:50 Stack trace: #0 /in/uZXuN(50): DOMNamedNodeMap->item('label') #1 {main} thrown in /in/uZXuN on line 50
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: DOMNamedNodeMap::item() expects parameter 1 to be int, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be int, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be int, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be int, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be int, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be int, string given in /in/uZXuN on line 50 Job Tracking Customer Routing Report Billing Statistics Branch Report Branch Billing Report Billing Activity Details e-Adoption Dashboard e-Adoption Chart Top Paper Customers Top Paper Custs by Acct Num Branch Electronic Report EasyImport Usage Online Payments Payment File Report ACH Transfers Invoice Gateway Usage Report Online Account Audit Report Invoice Central Usage Report Online User Report eDSO By Month Auto Pay Report Bullpenned Invoices Bullpen Statistics Uncertified Addresses NCOA Addresses Invoice Extract Fax Failures Transmittal Failures
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Warning: DOMNamedNodeMap::item() expects parameter 1 to be integer, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be integer, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be integer, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be integer, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be integer, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be integer, string given in /in/uZXuN on line 50 Job Tracking Customer Routing Report Billing Statistics Branch Report Branch Billing Report Billing Activity Details e-Adoption Dashboard e-Adoption Chart Top Paper Customers Top Paper Custs by Acct Num Branch Electronic Report EasyImport Usage Online Payments Payment File Report ACH Transfers Invoice Gateway Usage Report Online Account Audit Report Invoice Central Usage Report Online User Report eDSO By Month Auto Pay Report Bullpenned Invoices Bullpen Statistics Uncertified Addresses NCOA Addresses Invoice Extract Fax Failures Transmittal Failures
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: DOMNamedNodeMap::item() expects parameter 1 to be long, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be long, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be long, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be long, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be long, string given in /in/uZXuN on line 50 Warning: DOMNamedNodeMap::item() expects parameter 1 to be long, string given in /in/uZXuN on line 50 Job Tracking Customer Routing Report Billing Statistics Branch Report Branch Billing Report Billing Activity Details e-Adoption Dashboard e-Adoption Chart Top Paper Customers Top Paper Custs by Acct Num Branch Electronic Report EasyImport Usage Online Payments Payment File Report ACH Transfers Invoice Gateway Usage Report Online Account Audit Report Invoice Central Usage Report Online User Report eDSO By Month Auto Pay Report Bullpenned Invoices Bullpen Statistics Uncertified Addresses NCOA Addresses Invoice Extract Fax Failures Transmittal Failures

preferences:
174.51 ms | 404 KiB | 213 Q