php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #318 elseif failure with function calls
Submitted: 1998-04-27 08:38 UTC Modified: 1998-04-27 09:43 UTC
From: mjacob at picture-safe dot de Assigned: rasmus (profile)
Status: Closed Package: Parser error
PHP Version: other OS: Solaris 2.5.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mjacob at picture-safe dot de
New email:
PHP Version: OS:

 

 [1998-04-27 08:38 UTC] mjacob at picture-safe dot de
In PHP V2.0b12 there is a problem with
calling functions from elseif-statements.

e.g.:
---------------------------------------
<HTML>
  <HEAD>
    <TITLE>skdjh</TITLE>
  </HEAD>
  <BODY>
<?

Function func $par (
    $r_val = 1;
    return $r_val;
);

if (0)
{
   echo ("men");
}
elseif (func ("par"))
{
   echo ("Bingo");
}
else
{
   echo ("Default");
}

echo ("<BR>r_val=" + func ("par") + ".");
>
  </BODY>
</HTML>   
----------------------------------

In this example the elseif()-block is
not executed although the function should
return 1. If you change "$r_value=1;return $r_value;"
to "return 1;" the elseif-block is executed.
The only chance is to use not elseif but if.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-04-27 09:43 UTC] rasmus
2.0b12?  Why are you running such an ancient version?  This bug has
been fixed and all the code rewritten several times since 2.0b12.  Upgrade!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC