Safari Responsive Design Mode

While most browsers have responsive emulation available from their web inspector, Safari has a completely separate system available from the debug menu. If you don’t have the debug menu enabled, check the “Show Develop menu in menu bar” checkbox at the bottom of the Advanced tab in Safari’s preferences: Responsive Design Mode can be enabled by using the ^⌘R (control + command + R) shortcut, or by selecting it from the Develop menu:

PHP Keywords: xor

Welcome to my series on every PHP keyword and its usage. Today’s item: xor. The xor (exclusive or) operator is a logical operator that will result in true if only one of its operands are true. If neither is true, or both of them are true, the result of the expression is false. Example 1 2 3 4 5 6 7 8 <?php // False $a = false xor false; $b = true xor true; // True $c = false xor true; $d = true xor false;

PHP Keywords: try, catch and finally

Welcome to my series on every PHP keyword and its usage. Today’s items: try, catch and finally. These keywords help your code to gracefully handle exceptions that would otherwise end its execution with an ugly error message. The try block includes the code that might throw an exception, while the catch block(s) handle any exceptions thrown in the try block. Simple example 1 2 3 4 5 6 7 8 9 10 <?

PHP Keywords: return

Welcome to my series on every PHP keyword and its usage. Today’s item: return. The return keyword ends the current scope, and optionally passes a value back to the calling scope. It can be used inside of functions/methods, and in the global scope. When used inside a function, the function will finish and the result will be passed back to the caller. When used inside the global scope, it will end the current script.

PHP Keywords: list()

Welcome to my series on every PHP keyword and its usage. Today’s item: list(). The list() construct simplifies extracting variables from an array, allowing you to assign several variables to values in an array using one statement. Usage Basic extraction 1 2 3 <?php $coordinate = [37, 12]; list($x, $y) = $coordinate; Note: The list of variables to extract can be shorter than the number of items in the array, it will just ignore any further items.