php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1767 Problem with new
Submitted: 1999-07-20 16:55 UTC Modified: 1999-07-27 13:43 UTC
From: georgeh at blowtorch dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 1 OS: Linux 2.2.10
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: georgeh at blowtorch dot com
New email:
PHP Version: OS:

 

 [1999-07-20 16:55 UTC] georgeh at blowtorch dot com
I think this is related to bug 1766, but I'm not positive, so I'm entering it separately.

Code like this worked in PHP3 and doesn't work in PHP4:

function get_MyObject ( $var == "" ) {   // stupid 4.0
                                        // initialization 
                                        // change
	if ($var == "") { $var = $GLOBALS[MY_ENV_VAR]; };
	return new MyObject ($this, $var);
}

assuming function is a member of a parent class.

The parser dies on the "return" line with a parser error. This looks like it may be the same as bug 1766, where it seems you need to assign the object to a temp variable, then return the variable. That's a problem for me, I've got 5k+ lines of PHP script I'd have to dig through to fix this one. :)

Not sure if that's really the problem, but it seems to be. 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-20 16:58 UTC] georgeh at blowtorch dot com
Oops, that should be $var = "" not $var == "" in the function line.

But you knew that, huh? :)
 [1999-07-23 14:50 UTC] zeev at cvs dot php dot net
This is indeed an incompatibility, but one we'll do our best to resolve before Beta 2.
 [1999-07-27 13:43 UTC] andi at cvs dot php dot net
Fixed in latest CVS!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC