php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64658 BOOLEAN TO VARIABLE RETURN ILOGICAL VALUE
Submitted: 2013-04-17 15:33 UTC Modified: 2013-04-17 15:53 UTC
From: mrsnikivan at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS: WINDOW XP
Private report: No CVE-ID: None
 [2013-04-17 15:33 UTC] mrsnikivan at gmail dot com
Description:
------------
I AM USING XAMPP PHP, using assing 

$A= 1==1 AND 2==2;     RETURN TRUE

$A= 1==1 AND 2==7;     RETURN ILOGICAL, RETURN TRUE (TRUNCATE IN AND)

$A= (1==1 AND 2==7);   RETURN FALSE 

$A= 1==2 AND 2==2;     RETURN FALSE



Test script:
---------------




Expected result:
----------------
No truncate assign into instruction "and"  


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-17 15:53 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See operator precedence - http://php.net/operators.precedence AND comes after =

This allows code like
   $conn = mysql_connect() or die("Error");
 [2013-04-17 15:53 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 01:01:32 2024 UTC