Req #72589 [Opn->Asn]: "OR" is used differently

From: Date: Wed, 13 Jul 2016 01:23:41 +0000
Subject: Req #72589 [Opn->Asn]: "OR" is used differently
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202257@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72589&edit=1

 ID:                 72589
 Updated by:         kalle@php.net
 Reported by:        xxalfa at gmail dot com
 Summary:            "OR" is used differently
-Status:             Open
+Status:             Assigned
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   macOS 10.11.5
 PHP Version:        7.0.8
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

I've personally wished for this for a long time, especially the or throw part.

Assigning it to you Nikita for some input, can this be implemented in a sensible manner with ZE?


Previous Comments:
------------------------------------------------------------------------
[2016-07-12 18:51:46] xxalfa at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=72589&edit=1


Thread (9 messages)

« previous php.bugs (#202257) next »