Guest User

Untitled

a guest
Sep 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  1. <?php
  2. function fn() {
  3.     $private = '';
  4.     return function($value = ''){        
  5.         global $private;
  6.         if(empty($value)) return $private;        
  7.         $private = $value;
  8.         return $private;
  9.     };
  10. }
  11.  
  12.  
  13. $fn = fn();
  14. echo $fn('a');
Add Comment
Please, Sign In to add comment