ID: 31635 User updated by: ivar at stvk dot no Reported By: ivar at stvk dot no -Status: Feedback +Status: Open Bug Type: Zend Engine 2 problem Operating System: Irrelevant (WinXP) PHP Version: 5.0.3 New Comment:
The only way I am able to reproduce this behavior is using COM, but the nature of the bug is not directly linked to the COM libraries itself. Because of this, I am unable to make a test case that is platform independent and that does not require external resources. I will try just once more: Create a Visual Basic ActiveX DLL project. Name the project 'NullClass', and name the class 'Null'. Add this single function to the class code: Public Property Get Value() Value = Null End Property Place the cursor inside the function, Click the menu "Tools", "Procedure Properties", "Advanced", and select "User Interface Default". Click "File", "Make NullClass.dll". Then run this PHP script: <?php $Obj = new COM('NullClass.Null'); echo $Obj; ?> EXPECTED: The script does not output anything, because the object contains a NULL value. ACTUAL: The script either outputs garbage or causes an Access Violation message. Previous Comments: ------------------------------------------------------------------------ [2005-01-29 20:41:32] [EMAIL PROTECTED] Could you please provide an example that doesn't require any external resources (especially those that exist only under a particular OS) ? Also please post what you expect and what you got when you execute the reproduce code. ------------------------------------------------------------------------ [2005-01-25 08:53:51] ivar at stvk dot no To reproduce the bug, use this script. Let 'TestDatabase' be any kind of database, and let the table field 'Table'.'NullField' be any database field that contains a NULL value. <?php try { $DB = new COM("ADODB.Connection") or die("Cannot start ADO"); $DB->Open("DRIVER={SQL Server};SERVER=SERVER\WEB;DATABASE=TestDatabase"); $RS = new COM("ADODB.Recordset"); $RS->Open("SELECT TEXT FROM Table", $DB); echo $RS["NullField"]; } catch (Exception $e) { echo $e->getTraceAsString() . "<br>"; echo $e->getMessage(); } ?> ------------------------------------------------------------------------ [2005-01-25 01:01:58] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2005-01-21 15:15:04] ivar at stvk dot no Description: ------------ zend_make_printable_zval: Before returning with *use_copy=1, this function assumes that the preceding code has successfully converted the value to a sting, and therefore sets expr_copy->type = IS_STRING. If the original value IS_OBJECT, this function relies on any 3rd party cast handler to successfully return a string. Some libraries have been observed to break this rule, and return a value only initialized by ZVAL_NULL. This makes the system try to print a string from a garbage pointer. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31635&edit=1