3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = "resultCode:NoOp errorMessage:null processMessage:2014-08-08 02:18:01:659 INFO begin appName=ixp_app appVersion=2012_11_v01 integrationCode= clientId=999999 userName=autosuggest1 docId=12963337 docType=RFQ recipientId=58992 encodingTypeCode=UTF-8 2014-08-08 02:18:01:659 DEBUG Opening connection to the database 2014-08-08 02:18:01:660 DEBUG Validating client's account 2014-08-08 02:18:01:668 DEBUG Reading original document details from database 2014-08-08 02:18:01:668 DEBUG Reading Header from Database 2014-08-08 02:18:01:671 DEBUG Reading Line Items from Database 2014-08-08 02:18:01:673 DEBUG Reading Party Contacts from Database 2014-08-08 02:18:01:675 DEBUG Constructing Interchange 2014-08-08 02:18:01:675 DEBUG Constructing Request For Quote 2014-08-08 02:18:01:678 DEBUG Constructing Dates 2014-08-08 02:18:01:678 DEBUG Constructing References 2014-08-08 02:18:01:678 DEBUG Constructing Comments 2014-08-08 02:18:01:679 DEBUG Constructing Parties 2014-08-08 02:18:01:679 DEBUG Constructing Line Items 2014-08-08 02:18:01:680 DEBUG Saving original document content to file - raw 2014-08-08 02:18:01:705 INFO Found 1 possible RFQ matches with a Reference No.: 14/440 that was forwarded by Match Buyer 11107 to Supplier 58992 2014-08-08 02:18:01:705 INFO RFQ with Internal Ref No.: 12884046 2014-08-08 02:18:01:706 INFO RFQ 12963337 will now be compared with the list of possible RFQ matches 2014-08-08 02:18:01:706 INFO Comparing RFQ 12963337 with RFQ 12884046 2014-08-08 02:18:01:706 DEBUG Reading Header from Database 2014-08-08 02:18:01:708 DEBUG Reading Line Items from Database 2014-08-08 02:18:01:720 DEBUG Reading Party Contacts from Database 2014-08-08 02:18:01:727 DEBUG Constructing Interchange 2014-08-08 02:18:01:728 DEBUG Constructing Request For Quote 2014-08-08 02:18:01:730 DEBUG Constructing Dates 2014-08-08 02:18:01:730 DEBUG Constructing References 2014-08-08 02:18:01:731 DEBUG Constructing Comments 2014-08-08 02:18:01:731 DEBUG Constructing Parties 2014-08-08 02:18:01:732 DEBUG Constructing Line Items 2014-08-08 02:18:01:733 DEBUG Doc Changed on //Interchange/RequestForQuote/LineItem/@Description 2014-08-08 02:18:01:733 DEBUG Electric motor, Vertical mounted, Type- 4AP 71-45, 3phase, 440 Volts, 60 Hz, 0.29 KW, 0.8 Amp & 1656 RPM, Fan Motor, 3-phase, 440Volts, 0.8 Amp, 60 Hz, 0.29KW & RPM-1656 not equal to 2/2 way solenoid valve- servo assisted for emergency fire pump, Maker: Burkert, Details: 5281 A 13.0 NBR, MS, G 1/2, PNO 0.2 - 16 bar, 230 V, 50-60 Hz8 W, G 1/2, PNO 0.2-16 Bar 2014-08-08 02:18:01:733 DEBUG Committing database transaction 2014-08-08 02:18:01:733 DEBUG Closing connection to the database 2014-08-08 02:18:01:734 INFO end status=NOOP filename=999999_20140808021801_f90e96c9 elapsed=74ms fileContents:null "; $lines = explode(PHP_EOL, $txt); $messages = array(); foreach ($lines as $line) { // 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]; // now filter by the first word of the message if (!preg_match('/^(.*) .*$/', $message, $words)) { // no first word means only one word, skip it continue; } $word = $words[1]; print $word . PHP_EOL; if (in_array($word, array( 'opening', 'validating', 'reading', 'constructing', 'saving', 'found', 'rfq', 'comparing', 'committing', 'closing', 'end' ))) { // skip know technical message continue; } $messages[] = $message; } print_r($messages);
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.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Array ( )
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Array ( )
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/X7miH on line 55 Array ( )

preferences:
317.09 ms | 401 KiB | 457 Q