tags:

views:

57

answers:

2

i know that its creating a reference in other cases. but what happens here?

$crawler = &new MyCrawler();
+2  A: 

It creates an instance of MyCrawler and passes the reference for that instance into $crawler. In PHP5 this is assumed so the use of the & is deprecated.

EDIT: It took me a minute to find this:

Object References (the Ampersand)

Joel Etherton
weng
@noname: Yah it'll still assign as expected.
Joel Etherton
+2  A: 

That is deprecated per the PHP documentation

Dancrumb
so i cant use it any longer?
weng
More that you shouldn't... deprecated features will ultimately be removed, resulting in broken code.
Dancrumb