I have two servers, one running PHP 5.2 and another running PHP 5.3.
I’m using a class that has a function that accepts 2 parameters in it’s definition.
When I call that function on PHP 5.2 and pass 2 parameters (first being an object and second a string) everything works fine. But when I call that same function using PHP 5.3, again passing 2 parameters, only the first parameter is available in the function. The second string parameter never makes it to the function for use.
Anyone experience this before? Any ideas what could be the cause?
No error message?
Without seeing any code I can only guess. Maybe a “pass by reference” thing?
Can you post the method in question here? Or even better, the full class definition.
Nope, no error message… just no value.
I was hoping this was one of those things that’s so odd that it’s a obvious ini setting or something that was off.
You can download the library I’m using here. It’s located in application/libraries/datamapper.php. It’s a CodeIgniter library so without installing the whole thing in an instance of the framework you won’t be able to run it.
The method in question is save() on line 1614. To test this I put an exit() right after and print out the value of $related_field. On PHP 5.2 I get the value but on PHP 5.3 I don’t.
Put a breakpoint at the function call and run though the code keeping an eye on the variables in the Watch/Local panes. If you are using an editor that does not have the capability of debugging in this way, get one that can.