What is the difference between php reload and rewrite? What is the difference between heavy load and other languages (such as java?

Source: Internet
Author: User
Problem: The PHP manual contains the following content about overloading: & quot; overloading & quot; (overloading) provided by PHP means to dynamically & quot; Create & quot; class attributes and methods. We use magicmethods. For example, _ call ($ funcname, $ arguments) and _ callStatic (... problem:
The reloads in the PHP Manual are as follows: the "overloading" provided by PHP means to dynamically "create" class attributes and methods.
We use magic methods.
For example, _ call ($ funcname, $ arguments) and _ callStatic ($ funcname, $ arguments)

JAVA overload means that multiple methods can be created in the class. they have the same name, but have different parameters and different definitions.

When calling a method, you can determine the method to use by the number and type of different parameters passed to them.

Q: php and java have some differences on the concept of overload, but I don't know what the real difference is?

Reply content:

Problem:
The reloads in the PHP Manual are as follows: the "overloading" provided by PHP means to dynamically "create" class attributes and methods.
We use magic methods.
For example, _ call ($ funcname, $ arguments) and _ callStatic ($ funcname, $ arguments)

JAVA overload means that multiple methods can be created in the class. they have the same name, but have different parameters and different definitions.

When calling a method, you can determine the method to use by the number and type of different parameters passed to them.

Q: php and java have some differences on the concept of overload, but I don't know what the real difference is?

Java is strongly typed

public class DataArtist {    ...    public void draw(String s) {        ...    }    public void draw(int i) {        ...    }    public void draw(double f) {        ...    }    public void draw(int i, double f) {        ...    }}

The so-called overloading of php is just a rewriting of some magic methods.
There is a good comment in the comment.

This article shocould call this technique "interpreter hooks ".

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.