3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = "resultCode:NoOp errorMessage:null processMessage:2014-08-01 23:39:01:992 INFO begin appName=ixp_app appVersion=2012_11_v01 integrationCode= clientId=999999 userName=autosuggest1 docId=12928265 docType=RFQ recipientId=63880 encodingTypeCode=UTF-8 2014-08-01 23:39:01:992 DEBUG Opening connection to the database 2014-08-01 23:39:01:993 DEBUG Validating client's account 2014-08-01 23:39:02:000 DEBUG Reading original document details from database 2014-08-01 23:39:02:000 DEBUG Reading Header from Database 2014-08-01 23:39:02:002 DEBUG Reading Line Items from Database 2014-08-01 23:39:02:004 DEBUG Reading Party Contacts from Database 2014-08-01 23:39:02:006 DEBUG Constructing Interchange 2014-08-01 23:39:02:007 DEBUG Constructing Request For Quote 2014-08-01 23:39:02:009 DEBUG Constructing Dates 2014-08-01 23:39:02:010 DEBUG Constructing References 2014-08-01 23:39:02:010 DEBUG Constructing Comments 2014-08-01 23:39:02:010 DEBUG Constructing Parties 2014-08-01 23:39:02:011 DEBUG Constructing Line Items 2014-08-01 23:39:02:011 DEBUG Saving original document content to file - raw 2014-08-01 23:39:02:025 INFO Match RFQ QOT Not Found. 2014-08-01 23:39:02:025 INFO There is no RFQ with a Reference No.: TBE140180 found within the last 60days that was sent by Buyer 10529 to Match Supplier 999999 that was forwarded by Match Buyer 11107 to Supplier 63880 2014-08-01 23:39:02:025 DEBUG Committing database transaction 2014-08-01 23:39:02:026 DEBUG Closing connection to the database 2014-08-01 23:39:02:026 INFO end status=NOOP filename=999999_20140801233901_d8aa3e22 elapsed=33ms 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.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 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] => Match RFQ QOT Not Found. [1] => There is no RFQ with a Reference No.: TBE140180 )
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/IgHak on line 36 Array ( )

preferences:
326.49 ms | 401 KiB | 464 Q