Analysis of the reference delivery considerations for PHP function passing value

Source: Internet
Author: User
This article mainly introduces the PHP function to pass the value of the reference delivery considerations, involving the PHP configuration file settings and the use of array function skills, the need for friends can refer to the next

This article describes the reference delivery considerations for PHP function transfer values. Share to everyone for your reference, as follows:

Strict standards:only variables should be passed by reference

Online to find the information there is such a sentence:

In php5.3 above version of this problem, should also be related to the configuration of PHP, as long as the sentence to split into two sentences there is no problem. because the arguments of Array_walk are passed by reference, more than 5.3 by default can only pass specific variables, and cannot return a value through a function. Of course you can also modify the error_reporting in php.ini = E_all | E_strict, but it does not conform to the norm.

$suffix = Array_pop (Explode (".", $file _name));

Why is the higher version of this restriction?

I'll go see the function prototypes in the manual:

Mixed Array_pop (array & $array) bool Array_walk (array & $array, callable $funcname [, mixed $userdata = NULL] )

The & symbol specifies that the variable is passed in and is referenced.

Switch

$file _name_arr = Explode (".", $file _name); $suffix = Array_pop ($file _name_arr);

We can.

In fact, it's just a warning. is not a fatal error. The normal result is to be able to get. For example, it is normal to get the suffix of the file name here.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.