TAILIEUCHUNG - Publishing PHP eclipse - part 13

Báo chí Bước vào ba nhiều lần để tiến tới đường 17, các tuyên bố trở lại. Tất cả ba biến trong getHairball () phải được thiết lập bao gồm $ hairball, mà sẽ được trả lại và được lưu trữ trong $ hb. Báo chí Bước vào một lần nữa. Trình gỡ rối sẽ thoát khỏi chức năng và nhận chính xác ngay sau khi đường dây, nơi nó được đưa vào chức năng. Trong trường hợp này, trình sửa lỗi đi vào dòng chín | Testing and Debugging Press Step Into three more times to advance to line 17 the return statement. All three variables within getHai rbal l should be set including hairball which will be returned and stored in hb. Press Step Into one more time. The debugger will exit the function and pick up exactly right after the line where it entered the function. In this case the debugger goes to line nine. All the variables have been set. Click on T erminate and Remove on the toolbar to quit and clear this debugging session. We just ran through the entire script line by line and saw how our variables change and how PHP navigates through an application. Let s see how the other two navigation commands Step Over and Step Return work. The Step Over button is used to step over a function invocation in the debugging session. The function still executes and any changes to the application still occur. Since the process stops at a line before it executes it Step Over works in a line where a function is called. The calling function moves to the next line of code to be executed after it returns from the function. See this in action by executing the Debug test session again. From the very beginning instead of clicking Step Into press Step Over. Even though the first line does not have code that executes a function Step Over still advances. Its job is to move to the next line in the function and nothing fancier. Press Step Over twice after line four to get to line seven where we encounter the call to getHairbal l . Last time we pressed Step Into to move into this function but this time press Step Over instead. The debugger will execute the function but you will not be taken into the function. 120 Chapter 5 You ll see that the screen is exactly the same as if we just exited the program via a series of Step Into s like from the last example. Step Over is helpful if you just want to test the output of a function or if you are confident that the function works and the problem lies elsewhere. .

TỪ KHÓA LIÊN QUAN
Đã 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.