php 5.3 does not allow call_user_func to pass references.
The settings for date_timezone calls $form as &$form, yet it also returns the $form. This is a bug, regardless of the php version, but the reference causes a fatal error in 5.3x.

I have not tested or scanned other date-api modules for this error.
I have not tested this patch on post php5.3 versions.

Comments

arlinsandbulte’s picture

Status: Needs review » Closed (cannot reproduce)

I could not find this error.

Bèr Kessels’s picture

When you searched, did you try that on a PHP5.3 installation? Because I can reproduce it there really easy.

arlinsandbulte’s picture

Status: Closed (cannot reproduce) » Active

I think I misread your post.

I am not an expert in PHP (just learning), but it sounds like you are saying that a function like my_function(&$form) cannot return $form?

It think that is done in lots of other places without errors.

How can you reproduce this and what error do you receive on the white screen (or is it totally blank)?
Does this only apply to date 5.x-2.x or 6.x-2.x affected too?

Bèr Kessels’s picture

It is a problem with PHP 5.3, has nothing to do with any drupal version. In previous PHP-versions one could safely pass pointers into call_user_func(), as of PHP5.3 that is no longer allowed.

And, yes, it is done all over the place. We are trying to solve this in Drupal 5.x (core) to make it PHP5.3 compatible. In Drupal 6.x (core) this is already been "solved"(hacked around, really).

Next step is to find all the contributions that fail on this "deprecation error" and fix them too.

See:
http://stackoverflow.com/questions/1055812/how-to-avoid-call-time-pass-b...
And many, many posts (google it) for: "Deprecated: Call-time pass-by-reference has been deprecated"

arlinsandbulte’s picture

In my search, I did not find any places where pass by reference was used in function call, only at function definition, which is the correct way to do it, no?

mvc’s picture

StatusFileSize
new1.46 KB

The attached patch against date 5.x-2.8 fixed my PHP 5.3 errors when used in conjunction with patches #11 AND #19 from #853064: Alter INSTALL.txt to be clear PHP 5.3 is not compatible with Drupal 5.

Bèr, it looks like you accidentally attached the git-diff man page, so I wasn't able to compare my patch to yours :)

heine’s picture

Quoted from that that issue:

Removing references from the user hooks is wrong. Remember, D5 still has to support PHP 4. Also, it is simply hiding the error. Do something about the caller(s).

karens’s picture

Status: Active » Closed (won't fix)

I'm not going to try to figure out what this change will break for people still using php4 on this very old code (and it will very likely break php4 installations). I would have to set up a Drupal 5 installation in both php4 and php5.3, as well as the php5.2 version I use now, to test things out, which I just have no time to do.

The combination of the D5 version of Date and php5.3 is just going to be a combination that isn't supported.