1

Just see the code ~

<?php
$foo = [ 'foo' => 1 ];

$nothing = &$foo['foo'];

$bar = $foo;
$bar['foo'] = '2';

echo $foo['foo'];

Every version of php get result 2 but why ?

Isn't bar a totally different variable besides foo ?

NotUser9123
  • 143
  • 1
  • 1
  • 9

0 Answers0