Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Install Warning: Check that the php.ini setting allow_call_time_pass_reference is on

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2159 Views
  • HiltonT
    Avatar
    Community Member
    2 Posts

    Install Warning: Check that the php.ini setting allow_call_time_pass_reference is on Link to this post

    During installation of Silverstripe 2.2.3, I received the following warning:

    Check that the php.ini setting allow_call_time_pass_reference is on

    allow_call_time_pass_reference is set to '' in php.ini. You can install with allow_call_time_pass_reference not set, but some warnings may get displayed. For best results, turn it on.

    Interestingly, this is the information from php.net about this directive...

    allow_call_time_pass_reference boolean
    Whether to warn when arguments are passed by reference at function call time. This method is deprecated and is likely to be unsupported in future versions of PHP/Zend. The encouraged method of specifying which arguments should be passed by reference is in the function declaration. You're encouraged to try and turn this option Off and make sure your scripts work properly with it in order to ensure they will work with future versions of the language (you will receive a warning each time you use this feature).

    Passing arguments by reference at function call time was deprecated for code cleanliness reason. Function can modify its argument in undocumented way if it didn't declared that the argument is passed by reference. To prevent side-effects it's better to specify which arguments are passed by reference in function declaration only.

    So, it appears that the php developers recommend against the use of this directive as it is deprecated, however Silverstripe uses it. What's the likelihood that when this directive is unsupported (for reasons of code cleanliness), Silverstripe will have issues?

    I'm *very* surprised that I saw this warning during the installation of Silverstripe - this directive was deprecated because it wasn't a good way to pass arguments to a function, a much better way is (as mentioned in the php team response) to pass them by reference in a function declaration.

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Install Warning: Check that the php.ini setting allow_call_time_pass_reference is on Link to this post

    Its unlikely SS will break with this off. I've had it off for a long time and never encounted any issues with it being off. The warning is only there I guess as a note for the user so they are aware of it

  • HiltonT
    Avatar
    Community Member
    2 Posts

    Re: Install Warning: Check that the php.ini setting allow_call_time_pass_reference is on Link to this post

    ... any chance the code will be updated so that a) this isn't necessary and b) the warning isn't necessary? It seems that coding using this method of passing variables is far from recommended practice.

    2159 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.