TAILIEUCHUNG - OBJECT-ORIENTED PHP Concepts, Techniques, and Code- P20

OBJECT-ORIENTED PHP Concepts, Techniques, and Code- P20:A number of years ago, before I started using PHP, I created dynamic web pages using C. This really wasn’t too different from some of the other options available at the time, though it seems almost unthinkable now. Creating a dynamic page meant outputting HTML from your script and recompiling that script if any changes needed to be made. | PHP 5 PHP 4 Notes Operators function foo variable function foo variable Note that this example shows a function declaration not a function call. Passing objects by reference explicitly is recommended in PHP 4 but not required in PHP 5 because objects are automatically passed by reference. In PHP 5 you only ever need use a reference as a parameter with non-objects. foo var Deprecated. Call-time pass by reference is deprecated in PHP 5. For more information see Appendix A. Use a reference in the function definition when passing non-objects not required for objects as noted above . In PHP 5 assignment of objects is equivalent to assignment by reference under PHP 4. obj new ClassName obj new ClassName In PHP 5 new automatically returns a reference. PHP 4 style is deprecated. clone In PHP 4 assignment clones an object. instanceof is_a is_a is the only function of the Class Object functions that has been deprecated as of PHP 5 . Other Changes of Interest get class get class In PHP 5 these methods return a get_class_methods and get_parent_class get_class_methods and get_parent_class case-sensitive result. functionName ObjectType o N A In PHP 5 you may type hint object parameters to functions. As of PHP you may also type hint arrays. Type hinting return values of functions or methods is also planned. This will of course only apply to objects. Conversion Table PHP 4 and PHP 5 171 GLOSSARY A abstract method A method that is declared but not defined. Any class that contains an abstract method must use this keyword in the class definition. All of the methods of an interface are abstract. A class that has only abstract methods is a pure abstract class. accessor method A public method used to retrieve or change data members. Accessor methods are also called get and set methods. It is considered good programming practice to make data members private and alter or retrieve them only through accessor methods. aggregate class A class having at least one data member that is itself

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.