From: mnbob70 at earthlink dot net Operating system: Linux lion.phpwebhosting.com 2.4 PHP version: 4.3.4 PHP Bug Type: PCRE related Bug description: Change from PCRE Library 3.9 to PCRE library 4.3 has resulted in broken code.
Description: ------------ A friend running PHP 4.3.4 is experiencing an error with code that I wrote that works fine with PHP 4.3.2. The code parses stat information from a Madden 2004 game log. I'm guessing that something has changed in moving from PCRE Library 3.9 to 4.3. Here is a sample of the text file being parsed. <pre> Madden NFL 2004 PC v4.1.0.0 Game Log - Topdogs at Muleys Game Time: Sun Oct 12 13:31:48 2003 Skill Level: Pro Quarter Length: 9 minute(s) Slider Human CPU QB Accuracy 45 25 Pass Blocking 65 40 Receiver Catching 48 40 Running Ability 52 50 Offensive line Run Blocking 55 55 Defensive Awareness 65 50 Defensive line Knockdowns 50 50 Interceptions 20 20 Defensive Break Blocks 55 50 Tackling 55 50 Fieldgoal Length 60 50 Fieldgoal Accuracy 50 40 Punt Length 75 80 Punt Accuracy 70 50 Kickoff Length 55 50 Weather Forecast: Fair Wind: 1 mph Temp: 34 degrees Team Q1 Q2 Q3 Q4 OT FINAL Topdogs 0 14 21 3 0 38 Muleys 14 14 0 7 0 35 Game Statistics: Topdogs Muleys First Downs 18 11 Third Down Conversions 5 6 Third Downs 14 11 Third Down Percentage 35.7% 54.5% Forth Down Conversions 0 0 Fourth Downs 0 1 Fourth Down Percentage 0.0% 0.0% Two Pt Conversions Made 0 0 Two Pt Conversions Attempted 0 0 Two Pt Conversion Percentage 0.0% 0.0% Offense Redzone Num 3 6 Offense Redzone TDs 3 4 Offense Redzone FGs 0 0 Offense Redzone Percentage 100.0% 66.7% Rushing Attempts 35 15 Rushing Yards 147 40 Rushing Average 4.2 2.7 Rushing TDs 1 3 Passing Yards 219 295 Passing Completions 16 19 Passing Attempts 30 38 Completion Percentage 53.3% 50.0% Passing Average 7.3 7.8 Passing TDs 3 2 Offensive Pass Interceptions 3 4 TOTAL OFFENSE 366 335 Defensive Pass Interceptions 4 3 Punt Return Yards 15 75 Kick Return Yards 106 131 Punts 5 4 Punt Avg 43.0 43.3 Fumbles 1 2 Fumbles Lost 0 1 Penalties 6 2 Penalty Yds 42 15 Turnovers 3 5 TIME OF POSSESSION 22:31 13:31 Individual Stats: Muleys PASSING CMP ATT YDS PCT YPA SACK TD INT LONG RATING Lyle Coen 19 38 310 50 8.1 3 2 4 80 55.7 RUSHING ATT YDS AVG LONG TD FUM Derrick Walton 10 26 2.5 10 2 1 Paul Johnson 4 15 3.7 8 1 0 Lyle Coen 1 -1 -1.0 0 0 1 RECEIVING REC YDS AVG LONG TD DROP YAC Wade Van Dyke 3 117 39.0 80 1 1 55 Derrick Walton 2 76 38.0 57 0 0 45 Eugene Nixon 7 64 9.1 22 1 0 11 Victor Fitzgerald 4 29 7.2 16 0 1 3 Jimmy Harper 1 14 14.0 14 0 0 0 Willie Linde 1 6 6.0 6 0 0 1 Seth Henry 1 4 4.0 4 0 0 0 KICKING FGM FGA PCT FGSBLOCKED XPA XPM PCT XPSBLOCKED KICKOFFS TOUCHBACKS Cortez Penn 0 0 0 0 5 5 100 0 0 0 Clint Louis 0 0 0 0 0 0 0 0 6 0 PUNTING ATT YDS AVG LONG BLOCKS IN20 TOUCHBACKS Clint Louis 4 173 43.2 46 0 2 0 KICK RETURNS ATT YDS AVG TD LONG Justin Thomas 4 76 19.0 0 22 Wade Van Dyke 3 55 18.3 0 20 PUNT RETURNS ATT YDS AVG LONG TD Wade Van Dyke 4 75 18.7 25 0 Justin Thomas 0 0 0.0 0 0 DEFENSE TOT LOSS SACK FF FREC YDS TD INT RET AVG DEFLECTIONS SAFETIES Terrell Valentine 8 2 2 0 0 0 0 0 0 0.0 1 0 Darryl Cordes 7 0 0 0 0 0 0 0 0 0.0 0 0 Kerry Foster 6 1 0 0 0 0 0 1 36 36.0 1 0 Spencer Stone 6 0 1 0 0 0 0 0 0 0.0 2 0 Oliver Green 5 1 0 0 0 0 0 0 0 0.0 2 0 Nate Ottis 5 1 0 0 0 0 0 0 0 0.0 0 0 Chris Taylor 4 0 0 1 0 0 0 2 30 15.0 1 0 Andre Owens 3 1 0 0 0 0 0 0 0 0.0 0 0 Corey Craig 3 0 0 0 0 0 0 0 0 0.0 0 0 Cade Rogers 3 0 0 0 0 0 0 0 0 0.0 0 0 Mikey Fontaine 2 0 0 0 0 0 0 0 0 0.0 0 0 Seth Henry 1 0 0 0 0 0 0 0 0 0.0 0 0 Dwayne Rodgers 1 0 0 0 0 0 0 0 0 0.0 0 0 Marco Love 1 0 0 0 0 0 0 0 0 0.0 0 0 Paul Johnson 1 0 0 0 0 0 0 0 0 0.0 0 0 Victor Fitzgerald 1 0 0 0 0 0 0 0 0 0.0 0 0 Jeff Bell 1 0 1 0 0 0 0 0 0 0.0 0 0 Rob Cross 1 0 0 0 0 0 0 0 0 0.0 0 0 Al Irwin 1 0 0 0 0 0 0 0 0 0.0 0 0 Justin Thomas 1 0 0 0 0 0 0 0 0 0.0 0 0 BLOCKING PANCAKES SACKS ALLOWED Darius Manning 6 0 Marvin Riggs 5 0 Dwayne Rodgers 2 1 Adrian Poole 2 1 Dexter Bell 2 0 Terrell Valentine 1 0 Individual Stats: Topdogs PASSING CMP ATT YDS PCT YPA SACK TD INT LONG RATING Donny Kingford 16 30 241 53 8.0 4 3 3 39 73.7 RUSHING ATT YDS AVG LONG TD FUM Quincy Smith 26 124 4.7 43 1 1 Ray Blake 6 13 2.1 6 0 0 Lonnie Douglas 2 12 6.0 11 0 0 Donny Kingford 1 -2 -2.0 0 0 0 RECEIVING REC YDS AVG LONG TD DROP YAC Angelo Doeberling 3 57 19.0 23 0 0 14 Darrius Scott 4 57 14.2 22 1 0 15 Tyrone Hennings 2 52 26.0 39 1 0 21 Quincy Smith 3 41 13.6 25 0 0 11 Alan Benson 2 20 10.0 12 1 0 2 Antonio Jackson 1 8 8.0 8 0 0 0 Ray Blake 1 6 6.0 6 0 0 3 KICKING FGM FGA PCT FGSBLOCKED XPA XPM PCT XPSBLOCKED KICKOFFS TOUCHBACKS Joe Darius 1 2 50 0 5 5 100 0 7 0 PUNTING ATT YDS AVG LONG BLOCKS IN20 TOUCHBACKS Dewayne Jenkins 5 215 43.0 49 0 0 1 KICK RETURNS ATT YDS AVG TD LONG Jordan Younger 5 106 21.1 0 24 Darrius Scott 1 0 0.0 0 0 Desmond Turner 0 0 0.0 0 0 PUNT RETURNS ATT YDS AVG LONG TD Desmond Turner 1 15 15.0 15 0 Jordan Younger 0 0 0.0 0 0 Darrius Scott 0 0 0.0 0 0 DEFENSE TOT LOSS SACK FF FREC YDS TD INT RET AVG DEFLECTIONS SAFETIES Trenton Crawford 6 0 0 0 0 0 0 0 0 0.0 2 0 Cody Marshall 6 0 0 0 0 0 0 0 0 0.0 1 0 Kenny Martin 4 1 0 0 0 0 0 2 19 9.5 3 0 Allen Buchanan 4 0 0 1 0 0 0 0 0 0.0 1 0 Damien McAndrews 2 1 0 0 0 0 0 0 0 0.0 0 0 Marshall Jones 2 0 0 0 0 0 1 2 79 39.5 2 0 Randy Parkman 2 0 0 0 0 0 0 0 0 0.0 0 0 Desmond Turner 2 0 0 0 0 0 0 0 0 0.0 0 0 Keith Gray 2 0 0 0 0 0 0 0 0 0.0 0 0 Mike Black 2 0 0 0 0 0 0 0 0 0.0 0 0 Corey Callens 2 1 1 0 1 15 0 0 0 0.0 0 0 Pauly Shore 2 0 0 0 0 0 0 0 0 0.0 2 0 Lonnie Fox 1 0 0 0 0 0 0 0 0 0.0 0 0 Thurman Barker 1 0 0 0 0 0 0 0 0 0.0 0 0 Tyrone Hennings 1 0 0 0 0 0 0 0 0 0.0 0 0 Alan Benson 1 0 0 0 0 0 0 0 0 0.0 0 0 LaBron Maddox 1 0 2 1 0 0 0 0 0 0.0 0 0 Jordan Younger 1 0 0 0 0 0 0 0 0 0.0 0 0 BLOCKING PANCAKES SACKS ALLOWED Leon Greer 7 1 Orlando Swain 4 1 Jason Johnson 2 0 David Norton 1 0 Darrius Scott 1 0 Antonio Jackson 1 0 Luke Ottis 0 1 Game Log Ends ------------------------------------------------------------ </pre> Reproduce code: --------------- // $away_team = Topdogs in this case, $this->gamelog_text is the contents listed in the description. preg_match("/$away_team\s+([\d|-]+)\s+([\d|-]+)\s+([\d|-]+)\s+([\d|-]+)\s+([\d|-]+)\s+([\d|-]+).*/", $this->gamelog_text, $regs, PCRE_DOTALL); Expected result: ---------------- This is the result under php 4.3.2: array(7) { [0]=> string(53) "Topdogs 0 14 21 3 0 38 " [1]=> string(1) "0" [2]=> string(2) "14" [3]=> string(2) "21" [4]=> string(1) "3" [5]=> string(1) "0" [6]=> string(2) "38" } Actual result: -------------- This is the result under php 4.3.4: array(3) { [0]=> string(57) "Madden NFL 2004 PC v4.1.0.0 Game Log - Topdogs at Muleys " [1]=> string(7) "Topdogs" [2]=> string(6) "Muleys" } -- Edit bug report at http://bugs.php.net/?id=26295&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26295&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26295&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26295&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26295&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26295&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=26295&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26295&r=support Expected behavior: http://bugs.php.net/fix.php?id=26295&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26295&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26295&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26295&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26295&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26295&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26295&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26295&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26295&r=float