Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

108 users online



Tutorials - Variable Scope, Variable Variables, Sessions

Tutorials - Variable Scope, Variable Variables, Sessions

Currently viewing this thread: 1 (0 members and 1 guests)


Page 2 out of 3
Dan1

Dan1

TF Retiree
Status: Offline!

I'm fourteen and have no problems with the manual. Am having some trouble with OOP, but that's a whole nother ballgame. Tongue

Jeremie

Jeremie

Neversidian
Status: Offline!

OOP is easy.

I dont know how you can still use PHP without knowing the greats of OOP Grin Shocked

___________________

Jeremie - Used to be the Director of Community Development

phpmonkey

phpmonkey

whoa, wtf?
Status: Offline!

I use OOP a lot with PHP, but I often forget its not C++ and make some syntax boo boos.

I can't wait for PHP5, namespaces.... YUM!

___________________

Fomerly known as lasnaranjas. Holler.
http://card.mygamercard.net/gelsig/blackdood.png

Jeremie

Jeremie

Neversidian
Status: Offline!

heh i'm not the only one who cant wait for PHP5 with new OOP toys to play with Grin

___________________

Jeremie - Used to be the Director of Community Development

trunks

trunks

asdf
Status: Offline!

could you please add "function" before storeCurrentSong() {, if you wanna make this tutorial understandable.. some could think you're calling a function like that!

Phil

Phil

with Mr. Jones
Status: Offline!

The fact of the matter is that 85% of the questions in this forum can be solved with a simple search of the manual, and 10% more could be solved by searching tF or google. The thing is, people don't. Week after week we get topics about headers already sent errors and stuff like that. We get too few posts about optimization, security, logic errors and stuff like that, which, imo, i think the majority of the posts should be.

On OOP, its hard as hell if you don't know any theory going into it and start right with code, but if you take 5 minutes and figure out the theory and purpose its a whole lot easier.

EG - I disagree with "I dont know how you can still use PHP without knowing the greats of OOP ". As PHP is currently not a OOP language in many, many ways the very vast majority of scripts can be made with out any OOP at all.

___________________

http://www.philbrodeur.com - Expert PHP Development and Tutorials

Jeremie

Jeremie

Neversidian
Status: Offline!

erm i'm sorry for any confusion made, that was only some kind of humour. I know that it's possible to do almost every existing PHP applications without OOP. (We all did this before we knew how to use objects)

But you can't disagree if I say that OOP is a great feature of PHP.

I agree 100% when you say we dont get enough posts about optimizations (I still see people using echo "$var"; very often, even in some tutorials!!), security (like using $_POST['var'] directly in a query, without double checking if the var is set and if the value is valid), etc

___________________

Jeremie - Used to be the Director of Community Development

phpmonkey

phpmonkey

whoa, wtf?
Status: Offline!
Quote:

Originally posted by EvilGenius

(I still see people using echo "$var"; very often, even in some tutorials!!)

whats wrong with echo "$var"; ?

___________________

Fomerly known as lasnaranjas. Holler.
http://card.mygamercard.net/gelsig/blackdood.png

CDude

CDude

nothing
Status: Offline!

four more key strokes

___________________

http://celerondude.com

Jeremie

Jeremie

Neversidian
Status: Offline!

lasnaranjas: there's nothing wrong, it's just unoptimized (since you can do it without the quotes and it will be executed faster)

with double quotes, PHP interpret this as a string, send it to the string parser, which check the whole string for excaped characters (\r, \n, etc) and variables to replace them with the right values.

without double quotes, PHP simply throw the variable to the echo function, without having to parse a string

___________________

Jeremie - Used to be the Director of Community Development

Page 2 out of 3
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0078 seconds.