mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-07 06:26:45 +02:00
Merge pull request #952 from petk/patch-https
Update links to https in Basics section
This commit is contained in:
@@ -31,9 +31,9 @@ if (strpos('testing', 'test') !== false) { // true, as strict comparison was
|
|||||||
}
|
}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Comparison operators](http://php.net/language.operators.comparison)
|
* [Comparison operators](https://www.php.net/language.operators.comparison)
|
||||||
* [Comparison table](http://php.net/types.comparisons)
|
* [Comparison table](https://www.php.net/types.comparisons)
|
||||||
* [Comparison cheatsheet](http://phpcheatsheets.com/index.php?page=compare)
|
* [Comparison cheatsheet](https://phpcheatsheets.com/index.php?page=compare)
|
||||||
|
|
||||||
## Conditional statements
|
## Conditional statements
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ function test($a)
|
|||||||
|
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [If statements](http://php.net/control-structures.if)
|
* [If statements](https://www.php.net/control-structures.if)
|
||||||
|
|
||||||
### Switch statements
|
### Switch statements
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ function test($a)
|
|||||||
}
|
}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Switch statements](http://php.net/control-structures.switch)
|
* [Switch statements](https://www.php.net/control-structures.switch)
|
||||||
* [PHP switch](http://phpswitch.com/)
|
* [PHP switch](http://phpswitch.com/)
|
||||||
|
|
||||||
## Global namespace
|
## Global namespace
|
||||||
@@ -131,8 +131,8 @@ function array()
|
|||||||
}
|
}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Global space](http://php.net/language.namespaces.global)
|
* [Global space](https://www.php.net/language.namespaces.global)
|
||||||
* [Global rules](http://php.net/userlandnaming.rules)
|
* [Global rules](https://www.php.net/userlandnaming.rules)
|
||||||
|
|
||||||
## Strings
|
## Strings
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ $a = 'Multi-line example' // concatenation operator (.)
|
|||||||
. 'of what to do';
|
. 'of what to do';
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [String Operators](http://php.net/language.operators.string)
|
* [String Operators](https://www.php.net/language.operators.string)
|
||||||
|
|
||||||
### String types
|
### String types
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ echo 'This is my string, look at how pretty it is.'; // no need to parse a si
|
|||||||
*/
|
*/
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Single quote](http://php.net/language.types.string#language.types.string.syntax.single)
|
* [Single quote](https://www.php.net/language.types.string#language.types.string.syntax.single)
|
||||||
|
|
||||||
#### Double quotes
|
#### Double quotes
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ $juice = array('apple', 'orange', 'plum');
|
|||||||
echo "I drank some juice made of {$juice[1]}s"; // $juice[1] will be parsed
|
echo "I drank some juice made of {$juice[1]}s"; // $juice[1] will be parsed
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Double quotes](http://php.net/language.types.string#language.types.string.syntax.double)
|
* [Double quotes](https://www.php.net/language.types.string#language.types.string.syntax.double)
|
||||||
|
|
||||||
#### Nowdoc syntax
|
#### Nowdoc syntax
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ EOD; // closing 'EOD' must be on its own line, and to the
|
|||||||
*/
|
*/
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Nowdoc syntax](http://php.net/language.types.string#language.types.string.syntax.nowdoc)
|
* [Nowdoc syntax](https://www.php.net/language.types.string#language.types.string.syntax.nowdoc)
|
||||||
|
|
||||||
#### Heredoc syntax
|
#### Heredoc syntax
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ EOD; // closing 'EOD' must be on its own line, and to the
|
|||||||
*/
|
*/
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
* [Heredoc syntax](http://php.net/language.types.string#language.types.string.syntax.heredoc)
|
* [Heredoc syntax](https://www.php.net/language.types.string#language.types.string.syntax.heredoc)
|
||||||
|
|
||||||
> It should be noted that multiline strings can also be formed by continuing them across multilines in a statement. _e.g._
|
> It should be noted that multiline strings can also be formed by continuing them across multilines in a statement. _e.g._
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ Regardless of what you are doing with strings, none of the types will ever have
|
|||||||
application. Trying to rewrite code to use one or the other is always an exercise in futility, so avoid this
|
application. Trying to rewrite code to use one or the other is always an exercise in futility, so avoid this
|
||||||
micro-optimization unless you really understand the meaning and impact of the differences.
|
micro-optimization unless you really understand the meaning and impact of the differences.
|
||||||
|
|
||||||
* [Disproving the Single Quotes Performance Myth](http://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html)
|
* [Disproving the Single Quotes Performance Myth](https://www.npopov.com/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html)
|
||||||
|
|
||||||
|
|
||||||
## Ternary operators
|
## Ternary operators
|
||||||
@@ -413,4 +413,4 @@ return ($a != 3 && $b != 4) || $c == 5;
|
|||||||
Since PHP 5.3, it is possible to leave out the middle part of the ternary operator.
|
Since PHP 5.3, it is possible to leave out the middle part of the ternary operator.
|
||||||
Expression "expr1 ?: expr3" returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.
|
Expression "expr1 ?: expr3" returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.
|
||||||
|
|
||||||
* [Ternary operators](http://php.net/language.operators.comparison)
|
* [Ternary operators](https://www.php.net/language.operators.comparison)
|
||||||
|
Reference in New Issue
Block a user