Req #72589 [NEW]: "OR" is used differently
From: xxalfa at gmail dot com
Operating system: macOS 10.11.5
PHP version: 7.0.8
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:"OR" is used differently
Description:
------------
I want to "OR" like to use otherwise. I like the program structure with
"GOTO" and "THROW". Is this sensible?
Test script:
---------------
<?php
//-------------------------------------------------
// TEST "OR"
//-------------------------------------------------
$test = true;
//-------------------------------------------------
// EXIT
//-------------------------------------------------
// $test == true or exit;
// echo 'TEST TRUE';
//-------------------------------------------------
// DIE
//-------------------------------------------------
// $test == true or die ( 'TEST END' );
// echo 'TEST TRUE';
//-------------------------------------------------
// GOTO
//-------------------------------------------------
// Parse error: syntax error, unexpected 'goto' (T_GOTO) in
/xamppfiles/htdocs/1.php on line 32
// $test == true or goto TEST_END;
// echo 'TEST TRUE';
// TEST_END:
// echo 'TEST END';
//-------------------------------------------------
// THROW
//-------------------------------------------------
// Parse error: syntax error, unexpected 'throw' (T_THROW) in
/xamppfiles/htdocs/1.php on line 42
// try
// {
// $test == true or throw new Exception( 'TEST ERROR', 1 );
// echo 'TEST TRUE';
// }
// catch ( Exception $exception )
// {
// echo $exception->getMessage();
// }
//-------------------------------------------------
// Apache Version
//-------------------------------------------------
// Apache/2.4.18 (Unix) OpenSSL/1.0.2h PHP/7.0.8 mod_perl/2.0.8-dev
Perl/v5.16.3
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=72589&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72589&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72589&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72589&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72589&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72589&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72589&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72589&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72589&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72589&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72589&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72589&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72589&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72589&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72589&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72589&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72589&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72589&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72589&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72589&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72589&r=mysqlcfg
Thread (9 messages)
- xxalfa at gmail dot com