nutballs

err, i just noticed something with perks webrequest class that made my head hurt...

The class is named webrequest2
the first function within that class is also name webrequest2

um, what?

when does that function ever get called? is it another method of intializing the class, like __construct?

vsloathe

Correct me if I'm wrong, but doesn't a function with the same name as the class constitute a constructor func, and as such wouldn't it be called every time the class is instantiated?

perkiset

That's a

PHP

 4 legacy piece.

in

PHP

 5 is where they introduced __construct() and the other magic functions. In

PHP

 4, the constructor HAD to be named the name of the class, just like

JavaScript

 . That class is due for a

PHP

 5ing, but until then it's still good to go in

PHP

 4.

vsloathe

lol

We posted @ the same time, Perk.

perkiset

great minds and all Applause

nutballs

ok, its what I figured, just wanted to confirm.

I am trying to strip down the webrequest class to the simplest little "get a URL" function possible.
Basically, file_get_contents, without using that function and keeping it in sockets.


Perkiset's Place Home   Politics @ Perkiset's