|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2001-03-29 19:46 UTC] salna at ktl dot mii dot lt
 <? 
class objekt
{
	var $property;
	function objekt()
	{
		$this->property = 'okey';
	}
	function property()
	{
		echo "<br>$this->property";
	}
	function &gb_objekt()
	{
		$obj =& $GLOBALS['gb_objekt'];
		if (get_class($obj) != 'objekt')
		{
			$obj = new objekt();
		}
		return $obj;
	}
}
$gb_objekt =& objekt::gb_objekt();
// next line crashes 
$gb_objekt->property();
$objekt =& objekt::gb_objekt();
$objekt->property = 'more okey';
$objekt->property();
$gb_objekt->property();
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
Can reproduce this with CVS of 24-04-2001: Backtrace: Starting program: /dat/install/php/php-4.0.6dev/php -q bug10068.php Program received signal SIGSEGV, Segmentation fault. 0x80b7f30 in call_overloaded_function (T=0xbfffe764, arg_count=0, return_value=0x811da4c) at ./zend_execute.c:850#1 0x80bb7eb in execute (op_array=0x813958c) at ./zend_execute.c:1556 850#2 0x809f6b8 in zend_execute_scripts (type=8, file_count=3) at zend.c:743 #3 0x805aa28 in php_execute_script (primary_file=0xbffffab4) at main.c:1205 #4 0x8059241 in main (argc=3, argv=0xbffffb14) at cgi_main.c:735 #5 0x400b69cb in __libc_start_main (main=0x8058ba4 <main>, argc=3, argv=0xbffffb14, init=0x8057a50 <_init>, fini=0x80c07fc <_fini>, rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffffb0c) at ../sysdeps/generic/libc-start.c:92 (gdb)