PHP’s Safe-ish Types and the Return of Initialization

1 · Alan Storm · June 21, 2021, 8 p.m.
In languages like C and C++, most teaching approaches will have you think about creating variables in two distinct phases. First, you’ll declare the variable. int c; and then you’ll initialize the variable with its default value c = 42 When you declare the variable, you’ll telling the compiler what sort of value the variable is going to store. When you initialize the variable, you’ll telling the compiler what the initial/default value of that variable should be. This is important in languages li...