Edit report at http://bugs.php.net/bug.php?id=52401&edit=1

 ID:          52401
 Updated by:  ahar...@php.net
 Reported by: andrew at ajohnstone dot com
 Summary:     throw construct invalid within conditional
-Status:      Open
+Status:      Bogus
 Type:        Bug
 Package:     Scripting Engine problem
 PHP Version: 5.3.2

 New Comment:

By design; you can only use an expression in that context, not a

statement or control structure. Note that return wouldn't work there

either.


Previous Comments:
------------------------------------------------------------------------
[2010-07-22 12:17:47] andrew at ajohnstone dot com

Description:
------------
The following is a valid:



(!array_key_exists($class, $this->_data)) AND new
InvalidArgumentException("Class does not exist");



However the following is not:



(!array_key_exists($class, $this->_data)) AND throw new
InvalidArgumentException("Class does not exist");

Test script:
---------------
(!array_key_exists($class, $this->_data)) AND throw new
InvalidArgumentException("Class does not exist");

Expected result:
----------------
No syntax error

Actual result:
--------------
Parse error: syntax error, unexpected


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52401&edit=1

Reply via email to