Skip to content

Commit

Permalink
闭包
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexchent committed Jan 19, 2019
1 parent a0132ea commit 88e1875
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions php_use.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* 闭包
* Created by PhpStorm.
* User: chentao
* Date: 2019/1/19
* Time: 1:09 PM
*/

$brr = [1,2,3,4,5,6];
$a = 3;
$test1 = function ($v) use ($a) {
// echo $v.'——'.$a."\n";
return $v + $a;
};

$newarr = array_map($test1, $brr);

var_dump($newarr);die;

0 comments on commit 88e1875

Please sign in to comment.