|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2011-02-28 13:23 UTC] pajoye@php.net
 
-Status: Open
+Status: Feedback
  [2011-02-28 13:23 UTC] pajoye@php.net
  [2011-02-28 15:50 UTC] damien at commerceguys dot com
 
-Status: Feedback
+Status: Open
  [2011-02-28 15:50 UTC] damien at commerceguys dot com
  [2011-02-28 17:08 UTC] cataphract@php.net
 
-Status: Open
+Status: Duplicate
  [2011-02-28 17:09 UTC] cataphract@php.net
  [2011-02-28 19:22 UTC] pajoye@php.net
 
-Status:      Duplicate
+Status:      Assigned
-Assigned To:
+Assigned To: cataphract
  [2011-02-28 19:22 UTC] pajoye@php.net
  [2011-02-28 19:22 UTC] pajoye@php.net
 
-Operating System: Linux
+Operating System:
  [2011-03-01 00:02 UTC] cataphract@php.net
 
-Status:      Assigned
+Status:      Duplicate
-Assigned To: cataphract
+Assigned To:
  [2011-03-01 00:02 UTC] cataphract@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 06:00:01 2025 UTC | 
Description: ------------ See test script: when returning a undefined key from stream_stat(), the behavior of the Zend interpretor changes. I confirmed this on PHP 5.3.5, pjoye reproduced it separately. Test script: --------------- --TEST-- Test that user space streams do not break the fabric of the universe. --FILE-- <?php class UserSpaceStream { public function stream_open($uri, $mode, $options, &$opened_path) { return TRUE; } public function stream_read($count) { return ''; } public function stream_write($data) { return TRUE; } public function stream_eof() { return FALSE; } public function stream_stat() { $stat = array(); // This triggers (correctly) a "Notice: Undefined index: size in %s on line %d". $array = array(); $stat['size'] = $array['size']; return $stat; } } stream_wrapper_register("test", "UserSpaceStream"); // Alone, the assignment of a key to an undefined variable is legal. $undefined_variable['key'] = 'value'; // This fstat() call triggers something weird... $h = fopen('test://anyfile', 'r'); fstat($h); // ... from this point, PHP triggers a "Warning: Cannot use a scalar value as // an array" for each assignement of array keys to undefined variables. $undefined_variable2['key'] = 'value'; ?> --EXPECTF-- Notice: Undefined index: size in %s on line %d