Advertisement
Evengar

Untitled

Mar 22nd, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. <?php
  2. declare(strict_types=1);
  3.  
  4. function test() {
  5.     return;
  6. }
  7.  
  8. // undef warning
  9. echo $test[0];
  10.  
  11. // undef warning
  12. echo $test['test'];
  13.  
  14.  
  15. //copy by reference empty variable
  16. $copy = &$test;
  17.  
  18. // no warnings, ref is NULL
  19. echo $copy[0];
  20. echo $copy['test'];
  21.  
  22. // NULL printed
  23. echo var_dump($copy[0]);
  24.  
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement