TAILIEUCHUNG - PHP Object-Oriented Solutions phần 2

Như bạn có thể thấy, cả hai chương trình đánh dấu ngoặc đóng trên dòng 80, chứ không phải là dấu chấm phẩy mất tích ở phần cuối của dòng 79. Nhưng đây là cách PHP báo cáo lỗi cú pháp, và nó nhanh hơn rất nhiều so với thử nghiệm kịch bản trong một trình duyệt | Simpo PDF Merge and Split Unregistered Version - http PHP OBJECT-ORIENTED SOLUTIONS As you can see both programs highlight the closing brace on line 80 rather than the missing semicolon at the end of line 79. But this is the way PHP reports syntax errors and it s a lot quicker than testing the script in a browser and then hunting for the rogue semicolon. Code introspection This is really important when working with OOP. The IDE keeps track of user-defined classes variables and functions in the current project and enables code completion for them too. Figure 1-4 shows the code hints generated by PhpED for the Pos_Validator class in Chapter 4. Figure 1-4. Code hints for the Pos_Validator class as displayed in PhpED Automatic documentation If you comment your code using the PHPDoc format as described in Chapter 2 both PhpED and Zend Studio generate automatic documentation that is displayed as part of the code hints although they display them in slightly different ways. Figure 1-5 shows how PhpED handles automatic documentation displaying the full description in a pop-up window when the cursor is between the parentheses of a function or method. If you use a heavily documented framework such as the Zend Framework this can look rather overwhelming onscreen. Ề Ễi Djj I- 1 2 1 ubhc Pos_Va1idator isInt string fieldName int Snax iesơiption Checks whether the submitted value IS an integer. Ifsuppfed the Í. B- M optional second and third aguments set a range of permitted numbers. . third argument IS set to the PHP constant for the largest integer Q s _vai a 0 ỊỷygỊ be handled by PHP vanes according to operating system . 1 El php Ths means that you can set a minimum number without the need to 2 if array key ex 3 4 5 6 7 m3Xìmum Ths can be useful to test for positive numbers t 4 y by setting the second argument to 1. To set a lower maximum for the require Pos acceptable range supply the third argument. If the third argument ts 4 .

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.