Page 1 of 1

PHP References

Posted: Sun Sep 11, 2005 2:42 am
by sjg
Wow. So I've upgraded my development box to PHP 5.0.5, which has the new, more restrictive references model (as does PHP 4.4.0). It turns out that a lot of things I thought were acceptable are no longer permitted. For example, immediate functions are restricted:

For Example, the following is now forbidden:

Code: Select all

$var = array_pop(explode('/',$path));
Instead, you have to store the output of the explode in an intermediate variable. You may be able to get away with:

Code: Select all

$var = array_pop(@explode('/',$path));
as well.

Another thing that's breaking a bunch of my modules is smarty references. I do a lot of things like:

Code: Select all

$this->smarty->assign_by_ref('localized_string', $this->Lang('my_string'));
which, as far as I know, have to be changed to

Code: Select all

$this->smarty->assign('localized_string', $this->Lang('my_string'));
I'll be updating all of my modules as time permits. First will be the Skeleton, so my bad coding practices don't screw anyone who's working on writing their own modules.

Re: PHP References

Posted: Wed Sep 21, 2005 2:12 am
by seliger
Neat finds. That might explain some strangeness I've seen too. Though most things work fine under PHP 5 on any environments I have control over. My hosting company, that's the screwball. :-)

Keep us posted on the Skeleton. I want to build a module that will help me be lazy with integrating Paypal into my site. The skeleton is going to be my first stop.


Corey

Re: PHP References

Posted: Wed Sep 21, 2005 5:09 pm
by sjg
I've currently got BrowserStyler, RadioRoster, and Skeleton updated to work correctly.

FeedbackForm doesn't use most of the things that break other modules, so it should be OK, although it's slated for update anyway. I think Ell-Nav and SectionImages also fit into this category.

ContentAliases and PunBB/ProtectedPages still need to be updated.

Re: PHP References

Posted: Fri Sep 30, 2005 12:31 am
by trick
This is prettry OT, but I was wondering if anybody knew of any PHP5 hosters, preferably free ones or for a pretty low price.