In past episodes, we talked about caching a collection of elements to avoid multiple returns to the DOM to fetch the elements. Let’s talk about it now in the context of the script you are writing. You’ll see an additional “why” of caching.
Let’s talk about scoping, i.e. who can communicate with whom in your program. It defines the rules to define what code can talk with other code. This is a technical discussion which includes how memory is used and allocated.
It’s time to build out the HTML structure and put it into the view. What is a view? Why do you want to use it? Let’s talk about the qualities of clean, quality code. You will also learn about how to load the view as well as the variable scope. To learn more about variable scope and including files, go to the PHP Variables Bootcamp.
In order to be proficient in PHP, you need to first know variables. It’s learn and do time. In this lab, you are focusing on user-defined variables, the data they represent, how they are passed and assigned into function parameters’ list, naming, and their scope. For Pro members, you learn more about the PHP internals, how variables are linked to their data, and how memory moves around under the hood.
Let’s see what happens when you include files into another file. What happens with the variables between the files? In this episode, you will write code to include a view into a function and then access the variables between the files.
Let’s see how namespacing affects variables.
Now you’ve seen passing by reference in action. Let’s dive into how PHP manages it. You’re going into the PHP interpreter and its C language code.
Let’s dive into passing data by reference. By reference allows you to work with the same data between different variables. This means you can change the data and it is changed in both variables. You will build some code to test this concept and see how it works. Then you and I will talk about when to use it.