This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 打印 Laravel 框架 sql 带参数 sql | |
|-------------------------------------------------------------------------- | |
| | |
| 打印 Laravel 框架 sql 带参数 sql 语句。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 数组常量 | |
|-------------------------------------------------------------------------- | |
| | |
| 可定义数组常量。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| NULL 合并运算符 | |
|-------------------------------------------------------------------------- | |
| | |
| 由于日常使用中存在大量同时使用三元表达式和 isset() 的情况,NULL 合并运算符使得变量存在且值不为 NULL, 它就会返回自身的值,否则返回它的第二个操作数。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 分组使用声明 | |
|-------------------------------------------------------------------------- | |
| | |
| 可以使用 {} 包含相同路径命名空间。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 标量类型声明 | |
|-------------------------------------------------------------------------- | |
| | |
| 在 PHP 5 中只能是类名、接口、array 或者 callable,新增 string、int、float 和 bool。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 返回类型声明 | |
|-------------------------------------------------------------------------- | |
| | |
| PHP 7 增加了对返回类型声明的支持。 类似于参数类型声明,返回类型声明指明了函数返回值的类型。可用的类型与参数声明中可用的类型相同。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 安全随机字符串 | |
|-------------------------------------------------------------------------- | |
| | |
| 安全随机安字符串函数使用。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| 快速数组转对象 | |
|-------------------------------------------------------------------------- | |
| | |
| 一个效率非常快的把数组转对象的方法。 | |
| | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$bird = new Parrot(); | |
$bird->fly(); | |
interface BirdInterface | |
{ | |
public function fly(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$car = new Car(); | |
$driver = new Driver($car); | |
$driver->go(); | |
class Driver | |
{ |
NewerOlder