#24744 [Opn->Csd]: Using a function that returns a reference crashes php

From: Date: Tue, 22 Jul 2003 08:21:14 +0000
Subject: #24744 [Opn->Csd]: Using a function that returns a reference crashes php
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-44482@lists.php.net to get a copy of this message
ID: 24744 Updated by: sniper@php.net Reported By: vma1 at abv dot bg -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Slackware Linux 9.0 PHP Version: 4CVS-2003-07-21 (stable) New Comment: Fixed in PHP 5, won't be fixed for PHP 4. Previous Comments: ------------------------------------------------------------------------ [2003-07-21 17:41:00] vma1 at abv dot bg Description: ------------ The following code causes the apache 1.3.27 compiled statically with php to crash. The apache process that tries to execute the script terminates with a segfault. When the function returns the value not by reference everything works OK. These are my php.ini specific settings: allow_call_time_pass_reference = Off expose_php = Off max_execution_time = 120 ; Maximum execution time of each script, in seconds error_reporting = E_ALL display_startup_errors = On log_errors = On error_log = /usr/local/apache/logs/php_log register_argc_argv = Off magic_quotes_gpc = Off always_populate_raw_post_data = On upload_tmp_dir = /tmp upload_max_filesize = 16M ; SMTP = localhost ; sendmail_from = me@localhost.com sendmail_path = "/usr/local/sbin/ssmtp -t" Reproduce code: --------------- lass lala { var $val; function lala () { $this->val = 0; } function &get_val () { $inf = 88; $this->val = $inf; return ($inf); } } $obj = new lala; $vvv = &$obj->get_val (); echo $obj->val; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24744&edit=1

« previous php.bugs (#44482) next »