function and variables inside a string highlighting

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!
Post Reply
digi_al
Posts: 6
Joined: Wed Oct 28, 2009 1:33 pm

function and variables inside a string highlighting

Post by digi_al »

Hi,

1. It would be great if we can get code highlighting for PHP function names.

2. Also for variables inside a string, eg:
"SELECT * from platform where id=$id"

Thanks and keep up the good work,

alan
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: function and variables inside a string highlighting

Post by EvilBMP »

digi_al wrote:"SELECT * from platform where id=$id"
Please write:

Code: Select all

'SELECT * FROM platform WHERE id = '. (int)$id
This is a much better coding style - better to read and more secure (see the type cast) - you don't have these issues then.
And as another sidenote - don't use the * selector in MySQL statements ;)

But, this is just a private opinion / hint :)

Greets Evil
digi_al
Posts: 6
Joined: Wed Oct 28, 2009 1:33 pm

Re: function and variables inside a string highlighting

Post by digi_al »

please dont tell me how to program.

using a variable inside an sql statement is fine - you method is in no way more secure.

how do you know i have not already checked the variable for security? or its created inside the code and not been passed in?

for me (with an app that highlights variables like this correctly :) ), the way i wrote the code is more readable - even more so if i have lots of variables.
not sure about speed of executing though but i have never had speed problems with php

Anyway my post was about the bug in the application's code highlight routine.
davenz

Re: function and variables inside a string highlighting

Post by davenz »

Ouch, so much for that suggestion.
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: function and variables inside a string highlighting

Post by EvilBMP »

digi_al wrote:not sure about speed of executing though but i have never had speed problems with php
Good for you ... but it's definitely slower, because PHP has to interpret each doublequote string to look for variables inside. So in large-scale applications this does matter. Nevertheless, that has nothing to do with your request. Again just a side note. Sorry for Offtopic.

Greets Evil
Post Reply