|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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. 


Add a Patch

Pull Requests

Add a Pull Request


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-2021 The PHP Group
All rights reserved.
Last updated: Wed Aug 04 06:01:24 2021 UTC