3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = "resultCode:NoOp errorMessage:null processMessage:2014-08-07 03:33:01:705 INFO begin appName=ixp_app appVersion=2012_11_v01 integrationCode= clientId=999999 userName=autosuggest1 docId=12956633 docType=RFQ recipientId=54784 encodingTypeCode=UTF-8 2014-08-07 03:33:01:706 DEBUG Opening connection to the database 2014-08-07 03:33:01:706 DEBUG Validating client's account 2014-08-07 03:33:01:712 DEBUG Reading original document details from database 2014-08-07 03:33:01:712 DEBUG Reading Header from Database 2014-08-07 03:33:01:715 DEBUG Reading Line Items from Database 2014-08-07 03:33:01:719 DEBUG Reading Party Contacts from Database 2014-08-07 03:33:01:721 DEBUG Constructing Interchange 2014-08-07 03:33:01:721 DEBUG Constructing Request For Quote 2014-08-07 03:33:01:724 DEBUG Constructing Dates 2014-08-07 03:33:01:725 DEBUG Constructing References 2014-08-07 03:33:01:725 DEBUG Constructing Comments 2014-08-07 03:33:01:725 DEBUG Constructing Parties 2014-08-07 03:33:01:726 DEBUG Constructing Line Items 2014-08-07 03:33:01:726 DEBUG Saving original document content to file - raw 2014-08-07 03:33:01:740 INFO Found 1 possible RFQ matches with a Reference No.: 14/449 that was forwarded by Match Buyer 11107 to Supplier 54784 2014-08-07 03:33:01:740 INFO RFQ with Internal Ref No.: 12870348 2014-08-07 03:33:01:740 INFO RFQ 12956633 will now be compared with the list of possible RFQ matches 2014-08-07 03:33:01:740 INFO Comparing RFQ 12956633 with RFQ 12870348 2014-08-07 03:33:01:740 DEBUG Reading Header from Database 2014-08-07 03:33:01:742 DEBUG Reading Line Items from Database 2014-08-07 03:33:01:744 DEBUG Reading Party Contacts from Database 2014-08-07 03:33:01:754 DEBUG Constructing Interchange 2014-08-07 03:33:01:754 DEBUG Constructing Request For Quote 2014-08-07 03:33:01:756 DEBUG Constructing Dates 2014-08-07 03:33:01:756 DEBUG Constructing References 2014-08-07 03:33:01:756 DEBUG Constructing Comments 2014-08-07 03:33:01:756 DEBUG Constructing Parties 2014-08-07 03:33:01:757 DEBUG Constructing Line Items 2014-08-07 03:33:01:758 DEBUG Doc Changed on Actual Line Item Count 2014-08-07 03:33:01:758 DEBUG 1 not equal to 7 2014-08-07 03:33:01:758 DEBUG Committing database transaction 2014-08-07 03:33:01:758 DEBUG Closing connection to the database 2014-08-07 03:33:01:759 INFO end status=NOOP filename=999999_20140807033301_7b536076 elapsed=53ms fileContents:null "; $lines = explode(PHP_EOL, $txt); $userMessages= array(); foreach ($lines as $line) { //print $line . PHP_EOL . '---------' . PHP_EOL; // regexp is 'timestamp debug_level message' if (!preg_match( '/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}:\d{3} \w+ (.*)$/', $line, $matches )) { // top lines with no timestamp, safe to skip them continue; } $message = $matches[1]; $words = explode(' ', $message); if (empty($words)) { // single words are also skipped continue; } if (in_array(strtolower($words[0]), array( 'opening', 'validating', 'reading', 'constructing', 'saving', 'found', 'rfq', 'comparing', 'committing', 'closing', 'end' ))) { // skip know technical message continue; } $userMessages[] = $message; } print_r($userMessages);
Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.9, 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Array ( [0] => Doc Changed on Actual Line Item Count [1] => 1 not equal to 7 )
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/X1Rvv on line 50 Array ( )

preferences:
209.66 ms | 402 KiB | 311 Q