ID:               30112
 User updated by:  jw at jwscripts dot com
 Reported By:      jw at jwscripts dot com
 Status:           Closed
 Bug Type:         Reproducible crash
 Operating System: *
 PHP Version:      5.0.2
 New Comment:

Works as expected now, thanks!


Previous Comments:
------------------------------------------------------------------------

[2004-11-04 13:54:07] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Now prints out:

Fatal error: Method Foo::__toString() must return a string value in
/usr/home/thekid/test.php on line 14

------------------------------------------------------------------------

[2004-09-27 14:08:19] ante dot dfg at moj dot net

I can confirm this on Win XP sp1 using Apache 1.3.31 and php 5.0.2

szAppName : Apache.exe     szAppVer : 0.0.0.0     szModName :
php5ts.dll     
szModVer : 5.0.2.2     offset : 0004e27f

------------------------------------------------------------------------

[2004-09-25 14:40:42] [EMAIL PROTECTED]

#0  0x08136dc9 in zend_get_class_entry (zobject=0x81f735c) 
    at /home/johannes/src/php/php-5.0.2/Zend/zend_API.c:204 
#1  0x0814d413 in zend_std_cast_object_tostring 
(readobj=0x81f735c, 
    writeobj=0xbfffca40, type=3, should_free=0) 
    at /home/johannes/src/php/php-5.0.2/Zend/zend_object_handlers.c:938

#2  0x0815bd96 in zend_echo_handler 
(execute_data=0xbfffcbb0, 
    opline=0x81f57a0, op_array=0x81f124c) 
    at /home/johannes/src/php/php-5.0.2/Zend/zend_execute.c:1984 
#3  0x0815be3c in zend_print_handler 
(execute_data=0xbfffcbb0, 
    opline=0x81f57a0, op_array=0x81f124c) 
    at /home/johannes/src/php/php-5.0.2/Zend/zend_execute.c:2002 
#4  0x0815ab28 in execute (op_array=0x81f124c) 
    at /home/johannes/src/php/php-5.0.2/Zend/zend_execute.c:1400 
#5  0x081365bf in zend_execute_scripts (type=8, 
retval=0x0, file_count=3) 
    at /home/johannes/src/php/php-5.0.2/Zend/zend.c:1060 
#6  0x080f0edc in php_execute_script 
(primary_file=0xbfffeff0) 
    at /home/johannes/src/php/php-5.0.2/main/main.c:1629 
#7  0x0816775a in main (argc=1, argv=0xbffff094) 
    at /home/johannes/src/php/php-5.0.2/sapi/cli/php_cli.c:943 
 

------------------------------------------------------------------------

[2004-09-25 13:33:35] jw at jwscripts dot com

Bug persists in version 5.0.2, the notice and fatal error are not
displayed (crash is more severe).

------------------------------------------------------------------------

[2004-09-16 13:39:45] jw at jwscripts dot com

Description:
------------
When the __toString() method is called from a returned object to return
an undefined property, Apache 2.0.48 crashes.



Reproduce code:
---------------
<?

class Foo {
        public function doSomething() {
                return new Foo;
        }

        public function __toString () {
                return $this->undefined;
        }
}

$foo = new Foo;
print $foo->doSomething();

?>

Expected result:
----------------
Notice:  Undefined property:  Foo::$undefined
Fatal error:  Method Foo::__toString() must return a string value

Actual result:
--------------
Apache Crash:
=============
szAppName : Apache.exe  szAppVer : 2.0.48.0     
szModName : php5ts.dll     
szModVer  : 5.0.1.1     offset   : 0004dd7f

+ the above messages 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30112&edit=1

Reply via email to