In this episode, you are going to do an experiment to discover the answers and see how the operator precedence actually works. When you combine complex expressions together, each expression is evaluated following the operator precedence. However, which side of the expression is evaluated first? And if one part is false what happens to the other parts? It’s important that you know how your conditional expressions will be evaluated and in what order to ensure you do not get unexpected behavior.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Logical Operator Experiment
Which side of the expression runs first? And when you do an && if the left side is false, does it run the right side? How about an ||? If the left side is true, does it run the right side? In this experiment, you’ll write code that proves the order and which sides actually run for the logical operators. You’ll get some tips too.
Operator Truth Tables
Logical operators work just like their hardware digital gate counterparts. Let’s figure out truth tables to discover how the And, OR, and Xor actually work.
Assignment in the Conditional Expression
PHP allows you to make an assignment within a conditional expression. What order are the expressions evaluated? In this episode, you’ll roll up your sleeves and write some code to find out while Tonya explains it to you.
Functions in the Conditional Expression
A conditional expression can be comprised of functions, literals, constants, and variables. How do functions work? What is the evaluation order? In this episode, you will build expressions with functions and discover the flow and order.
Anatomy of a Conditional Expression
Let’s talk about what a conditional expression is, what’s its purpose (intent), and what it does. In this episode, we setup this series for you to deeply learn about conditional expressions.
Falsey Conditional Expression
What constitutes a falsey state? And when there is one variable in a conditional expression, what is it doing? How does it work? In this episode, you will build code to explore the falsey conditional expression. You will learn about what and why the state is falsey.
What is a DocBlock?
What is a DocBlock? In this video, I’ll take you to phpDocumentor and discuss what a DocBlock is, as well as why you want to follow this PHP documenting standard. Then you’ll go to the WordPress PHP coding standard for contributing to core. The reasons why you want to learn how to properly document your code using PHP DocBlock are: Human readability – you and anyone else can read your code. You are able to read other people’s code. You know what it requires and what to expect from it when you call that function or method. Code – the […]
Install Composer PHP Dependency Manager – Windows Users
In this lab, you will install Composer, the PHP Dependency Manager, onto your Windows machine. We use Composer in our library videos for the basic plugin which includes Kint and Whoops. In your projects, you will Composer to package up your project as well as load and manage dependencies for you and autoload your files.
Install Composer PHP Dependency Manager – Mac Users
In this lab, you will install Composer, the PHP Dependency Manager, onto your Mac. We use Composer in our library videos for the basic plugin which includes Kint and Whoops. In your projects, you will Composer to package up your project as well as load and manage dependencies for you and autoload your files.