Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.
I've recently taken up PHP as my language of choice for learning how to program.

I now have a simple question regarding naming conventions in PHP.

When a variable or function is declared with a single underscore as the first character (i.e. $_foo or $_fake_function()), what exactly does this tell me as a programmer?

Adbot
ADBOT LOVES YOU

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.

Standish posted:

It has no set meaning, but it's often used to denote an class member or an internal function i.e. anything that shouldn't be directly used except by the original author of the code.

That's what I was looking for. Thanks!

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.
I'm writing a script to validate URLs, and one part of the script validation is a check to see if the document exists (i.e. seeing if there's a response). Is there a faster function to use than get_headers? For me, get_headers is extremely slow and I'm going to be validating thousands of URLs.

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.

Lankiveil posted:

What is the current cool framework to use for PHP? At the moment I'm playing with CodeIgniter, but I'm happy to jump ship if there's something better out there.

If you like CodeIgnitor, check out Kohana. It's a PHP5 based framework originally built from CI, but completely rewritten to take advantage of PHP5's 'features'.

It is a really robust framework and I use it all the time in my projects.

https://www.kohanaphp.com

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.
I have a 'dataprocessor' library written in PHP that parses through a CSV file that varies in size (1K to 2M). The larger files end up taking quite a bit of memory because of the looping required to manipulate the actual data itself.

Now my question - is there a way to free up memory in PHP during the execution of the script? I call the unset() function on the variables that are unused but I don't think that unset is actually meant to free up memory.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply