php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70569 Conditional check error
Submitted: 2015-09-24 09:19 UTC Modified: 2015-09-24 09:27 UTC
From: call at woola dot net Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.5Git-2015-09-24 (Git) OS: window
Private report: No CVE-ID: None
 [2015-09-24 09:19 UTC] call at woola dot net
Description:
------------
for example:

1. 

$result = (true and false);

now this right  $result  is "false"

2.


$result = true && false;

now this right  $result  is "false"


3.

$result = true and false;

now is will error  $result  is "true"




Test script:
---------------
<?php

//for example:1. 

$result = (true and false);

echo "right result: $result";
//for example:2. 
$result = true && false;

echo "right result: $result";

//for example:3. 
$result = true and false;

echo "error result: $result";



?>

Expected result:
----------------
$result = true and false;

it should be equal to "false"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-24 09:27 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2015-09-24 09:27 UTC] requinix@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

http://php.net/manual/en/language.operators.precedence.php
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 11:00:02 2026 UTC