Php error

software development

#1

dear all

some of my web show error like this bellow , can me advice what should i do ?.

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of call_user_method_array(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/.sanders/userku/www.domainku.com/classes/Validate.php on line 40

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of call_user_method_array(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/.sanders/userku/www.domainku.com/classes/FormGroup.php on line 511

My regards


#2

I found this by googling the phrase:

well if you set allow_call_time_pass_reference to true in your php.ini it will go away. they are calling a function that was depreciated

Its always a good idea to make a problem into a learning experience. Are you familiar with the online php manual?

best of luck


#3

You can also switch to using PHP4, where it is enabled by default, if your application does not need PHP5.

–rlparker


#4

I don’t know if this came from something you downloaded or something you wrote, but I want to make a comment on it. I like the concept of passing something to my functions that has a variable number of arguments. This way I can modify the function without having to modify every place that the function is called from.

My technique it to create a structure, which I think is called an associative array in PHP…basically just named values for the elements of my array instead of simply using array indexing. This allows me to use “isset” in the function itself instead of expecting a fixed number of arguments.

I’d be happy to provide you with some examples if this is something that you’re thinking about modifying. I quickly put together a crappy article about it as well.


#5

I’m not sure that I’d ever want to work on any code that you’ve written this way :wink:

What you’ve described in your article is a problem that definitely comes up in the context of active software development. I think we’ve probably all suffered the frustration of discovering that a funciton needs to be called differently than how we originally imagined. Especially if the function gets used in a lot of places, that can definitely mean a lot of find and replace to get it called correctly everywhere.

What makes me nervous about your technique is that it seems to take API instability like it’s some sort of inherent condition rather than a temporary state that will eventually be moved past. This sort of perpetual instability would make me rather concerned that someday a change is going to take place that completely shifts th world beneath my feet even on code which I think is supposed to be complete. Even more importantly, I lose a bit of built-in error-proofing. PHP can sort of tell me if I’m using a function wrong if I call it with the wrong number of arguments; if every function accepts a generic object, I lose that layer of protection.

For the example in your blog post there, I would probably recommend using default parameters to accomplish that same level of flexibility.


#6

I hear you, and must admit that you share the sentiments of some other people who I’ve spoken too. Here is the sort of scenario that drove this technique in the first place.

I have some websites that use multiple levels of admin capability. One in particular maintains a database of houses. There are 40-50 attributes having a one-to-one relationship with a given house. Master administrators have the capability of modifying just about all of them. Second-tier administrators can only maintain about 30 of those fields.

For me to have to list 50 individual arguments in one function call sounded like an exercise in frustration. Then to implement that same “updateProperty” function for the second tier admins, I would have to create a call with 30 arguments passed from their admin page, and pass in the other 20 as values that were defaulted on the calling page.

Simply using defaults to allow me to pass less data seems limited to only one argument in my mind. If I have 7 expected function arguments and only want to pass 4, there isn’t a way to tell the function that argument 2,3,6 are missing or if it’s arguments 3,5,6 that are missing.

For my purpose I felt like using a structure was the right choice, especially in an instance when I’ll be updating 4 or 5 fields based on an action. The only other option in my mind would be to create several different functions all doing very similar operations with the relevent data that expect a subset of the arguments. Keeping my functionality encapsulated in one place seemed far superior in my mind to having 11 different functions that would all need to be addressed individually for any sort of data model change.

I might also mention that I had to figure out a rapid development framework because I was trying to juggle 9 different projects with short timelines, and I am the only programmer.

The double-blessing of that is that there weren’t any pointy-headed project management types trying to force six-sigma methodologies down my throat. Given that my timeline was on the order of a couple weeks instead of the 18+ months that some SDLCs can be permitted.

Getting paid by the project and not being on salary had a big impact on my choice too. I am all about project gates when I am going to be getting the same amount in my check whether the project is completed or continues to be ongoing.

As with everything else on the Internet, YMMV. It was a good fit for me though.


#7

i try switch to php4 still same error, than i switch back to php5 and change some code and modification in php.ini ( search in forum change php.ini).and working but some function need to be remodification to working out dh server.
any thq for all respond …

My regards