php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25652 ZE2 Crashes in non-debug mode (CLI only)
Submitted: 2003-09-25 06:29 UTC Modified: 2003-12-30 20:24 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: john@php.net Assigned: andi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-11-29 OS: Redhat 8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: john@php.net
New email:
PHP Version: OS:

 

 [2003-09-25 06:29 UTC] john@php.net
Description:
------------
ZE2 is bailing on with a fatal error when calling a method dyanmically using a properity of the class (an array) as the dynamic function name. I.e.

$this->myarr[0]("function paramer");

returns:

Fatal error: Method name must be a string in....

It worked in PHP4, so I don't know if this is intended as invalid in PHP5, or if it is a bug...


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

	class foo {

		var $arr = array("test");
		function test($var) {
			
			echo "Test $var";
			
		}
		
	}
	
	$a = new foo();
	echo "<PRE>"; var_dump($a); echo "</PRE>";
	$a->arr[0]("testvalue");
	
?>

Expected result:
----------------
Test testvalue

Actual result:
--------------
Fatal error: Method name must be a string in...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-25 06:44 UTC] john@php.net
Opps. Bad code example -- this is the code:

<?php

	function test($var) {
		
		echo "Test $var\n";
		
	}
	
	class foo {

		var $arr = array("test");
	
		function bar() {
			
			$this->arr[0]('testvalue');
			
		}
			
	}
	
	$a = new foo();
	$a->bar();
	
?>
 [2003-11-18 16:51 UTC] sniper@php.net
Works with PHP 4 fine, not with PHP 5..

 [2003-12-08 07:46 UTC] derick@php.net
Making it assigned so that Andi gets all mail about it.
 [2003-12-30 20:24 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 29 01:01:28 2025 UTC