gabian Posted March 21, 2018 Share Posted March 21, 2018 Hi everybody, I'm dusting off my PHP with this book. I'm using a kindle edition. In chapter 2 I can read: $months = [1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; This doesn't work for me (PHP 5.3.1) I think it should read: $months = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); Link to comment Share on other sites More sharing options...
Larry Posted March 21, 2018 Share Posted March 21, 2018 Yeah, the short array syntax, shown there, was added in PHP 5.4. On earlier versions of PHP you'll need to use the older, longer syntax. This is explained earlier in the chapter when the short array syntax is introduced. 1 Link to comment Share on other sites More sharing options...
Recommended Posts