Re: notices nightmare - looking for a regex solution

From: Date: Thu, 02 Jun 2011 00:25:21 +0000
Subject: Re: notices nightmare - looking for a regex solution
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-313302@lists.php.net to get a copy of this message
I was thinking about this a little more and thought that the method I sent before will work, but it has the potential of clobbering variables that are not related to this warning/notice. Best bet would be to create a list of file names that contain the offending variables then feed that to sed using cat file_name | sed... You can use the find | xargs grep method to create the initial list, then work from there. On Wed, Jun 1, 2011 at 6:26 PM, Merlin Morgenstern <merlin_x@fastmail.fm>wrote: > Hi there, > > I am working on a pretty huge site with thousands of files with php code. > Unfortunatelly the app throws a ton of notices du to missing '' in arrays. > Of course I could simply disable the output on the dev server to surpress > notices, but I would rather like to get it fixed. > > Has somebody a good idea on how to fix this automated somehow with regex? > > The vars are right now: $var[element] and should be $var['element'] > > I was looking into sed, but I was hoping that there is also a way in php. > Has anybody a hint on how to get the regex done? > > I appreciate any help on that. > > Best regards, > > Merlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#313302) next »