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
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: 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: Tue Oct 08 13:01:26 2024 UTC