php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73306 php ver 7.0.4,5.6.8
Submitted: 2016-10-12 16:12 UTC Modified: 2016-10-12 17:19 UTC
From: 13353540 at qq dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.0.11 OS: centos6,7
Private report: No CVE-ID: None
 [2016-10-12 16:12 UTC] 13353540 at qq dot com
Description:
------------
I'm sorry.Bug #73304,#73305 is wrong.
Hello,
    It is a sample script.I think the script will be print 2,but 1.
If I change:
  if($ret_obj->result==false && $ret_obj->code=99 ) 
to:
   if($ret_obj->result=="aa"&& $ret_obj->code=99 )

It's  print 1.

I tested this script in version 7.0.4,5.6.8,have the same problem

Regards,
Jian Zhao

Test script:
---------------
<?
$ret="";
$ret_obj=json_decode($ret);
if($ret_obj->result==false && $ret_obj->code=99 )
	echo 1;
else
	echo 2;
exit;
?>

Expected result:
----------------
print 2

Actual result:
--------------
print 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-12 16:36 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: PHP Language Specification +Package: *General Issues
 [2016-10-12 16:36 UTC] requinix@php.net
1. Set error_reporting=-1 and display_errors=on in php.ini and you will see multiple warnings about your code.
2. Count your equals signs.
 [2016-10-12 17:13 UTC] 13353540 at qq dot com
requinix@php.net,
1. Set error_reporting=-1 and display_errors=on in php.ini and you will see multiple warnings about your code.

multiple warnings  do not affect the results.

2. Count your equals signs.

I am sorry , Bug #73306 is wrong ,i renew the report to #73308 	
I think it is must be a bug.
 [2016-10-12 17:18 UTC] 13353540 at qq dot com
<?
error_reporting(E_ERROR);
$ret="";
$ret_obj=json_decode($ret);
if($ret_obj->result==false && $ret_obj->code=99 )
	echo 1;
else
	echo 2;
?>
It's  print 1.
It's a mistake.
 [2016-10-12 17:19 UTC] requinix@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

That report is the same. If you need help with your code then try a mailing list or online forum, not this bug tracker.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 11:01:31 2024 UTC