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.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | d5.date_.php53.patch | 1.46 KB | mvc |
| date_call_user_fun_cannot_get_ref_php5.3_compat.diff | 26.51 KB | Bèr Kessels |
Comments
Comment #1
arlinsandbulte commentedI could not find this error.
Comment #2
Bèr Kessels commentedWhen you searched, did you try that on a PHP5.3 installation? Because I can reproduce it there really easy.
Comment #3
arlinsandbulte commentedI 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?
Comment #4
Bèr Kessels commentedIt 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"
Comment #5
arlinsandbulte commentedIn 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?
Comment #6
mvcThe 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 :)
Comment #7
heine commentedQuoted from that that issue:
Comment #8
karens commentedI'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.