Re: regex or 'tidy' script to fix broken <? tags and introspection of variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10-08-2011, at 16:54, Daevid Vincent wrote:

>> -----Original Message-----
>> From: Camilo Sperberg [mailto:unreal4u@xxxxxxxxx]
>> Sent: Tuesday, August 09, 2011 5:27 PM
>> 
>> For the first one, it may be that zend studio does have an internal script
>> to do the job. Check the general preferences tab, template stuff. 
> 
> Nope. Nothing there. Those templates are for when you create new blurbs of
> code, not modifying existing code.
> 
> There is a formatter however, sadly it doesn't have an option to force these
> (you'd think that would be the perfect place to do this too huh.) In fact, I
> posted this here:
> 
> http://forums.zend.com/viewtopic.php?f=59&t=19173#p59348

That is sad to hear, I have never done the same thing you are now, but I thought it could help.

> 
> Many people mistakenly think that short version is going to be deprecated
> away. It is not. The PHP Devs have already clarified only the "<?" version
> is, not this one.
> 
> http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
> 

I had no idea, I thought short tags also implied short if-else, short echo and so on, good to know that, thanks for the clarification ;)

> 
>> Second question: zend studio displays all variables used by a script by
>> clicking the arrow next to te file name. 
> 
> I've used ZS for 4+ years now, and comicaly have never even used those
> little down arrows next to a file. HAHAH! Good to know. Although it is a
> little strange as they seem to only be where you use a "=" assignment. It
> doesn't know about "->" or other instances of that variable (like if you
> echo it or something). But still could prove useful.

Eclipse/Zend Studio is so full of options that you can miss a lot of them. Another downside of the little arrow thing is that it doesn't recognize arrays, which is obvious because arrays can only be read on runtime, well, same thing as objects.

> 
>> If you want to display it in runtime, you can: print_r($GLOBALS);
> 
> Whoa nelly! That prints out WAAAAAAY too much information ;-)
> 
> But thanks. Not sure why I didn't think of that one. Maybe because at one
> time I did use it, got sensory overload from the amount of data it spews to
> the page, and then blocked it out of my mind for future use. :)

Yeah I know it displays a lot of information, but I use it sometimes and it's the only way I know to display all variables, arrays and stuff in a neat and nice way. You can also install xDebug and use the included debugger in ZS, but sometimes using a simple print_r is faster.

Greetings :)

_______________________
Mi blog
CHW
Mi Twitter


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux