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

 ID:                 61529
 Updated by:         yohg...@php.net
 Reported by:        asserte at gmail dot com
 Summary:            Parsing error
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Debian
 PHP Version:        5.4.0
 Block user comment: N
 Private report:     N

 New Comment:

Verified.

$ php -r '1 && unset($var["a"]);'

is enough.

----------
[yohgaki@dev php-src]$ ./sapi/cli/php -v
PHP 5.5.0-dev (cli) (built: Mar 28 2012 17:33:51) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

[yohgaki@dev php-src]$ ./sapi/cli/php -r 'unset($var["a"]);'
[yohgaki@dev php-src]$ ./sapi/cli/php -r '1 && unset($var["a"]);'

Parse error: syntax error, unexpected 'unset' (T_UNSET) in Command line code on 
line 1
----------


Previous Comments:
------------------------------------------------------------------------
[2012-03-27 13:49:14] asserte at gmail dot com

Move to SE problems

------------------------------------------------------------------------
[2012-03-27 13:45:26] asserte at gmail dot com

Description:
------------
isset() && unset()

PHP Parse error:  syntax error, unexpected 'unset' (T_UNSET), expecting ')' in 
/tmp/isset.php on line 4

Tested on PHP 5.4.0-3 (cli) (built: Mar 22 2012 07:59:57) 


Test script:
---------------
$> cat /tmp/isset.php
  1 <?php
  2     
  3     $entity = array('id' => 1, 'name' => 'example');
  4     isset( $entity['id'] ) && unset( $entity['id'] );

$> php /tmp/isset.php
PHP Parse error:  syntax error, unexpected 'unset' (T_UNSET), expecting ')' in 
/tmp/isset.php on line 3

Expected result:
----------------
unset should works.



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



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

Reply via email to