fork(94) download
  1. <?php
  2.  
  3.  
  4. $fruit = array('apples'=>2, 'oranges'=>5, 'pears'=>0);
  5. echo $fruit['oranges']; // echoes 5
  6. $fruit = "new string";
  7. echo $fruit['oranges']; // causes illegal string offset error
  8.  
  9.  
Success #stdin #stdout #stderr 0.01s 20568KB
stdin
Standard input is empty
stdout
5n
stderr
PHP Warning:  Illegal string offset 'oranges' in /home/rezrYZ/prog.php on line 7