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

 ID:                 61529
 Patch added by:     larue...@php.net
 Reported by:        asserte at gmail dot com
 Summary:            Parsing error
 Status:             Verified
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.4.1RC/5.5.0-dev
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

The following patch has been added/updated:

Patch Name: bug61529.phpt
Revision:   1333025478
URL:        
https://bugs.php.net/patch-display.php?bug=61529&patch=bug61529.phpt&revision=1333025478


Previous Comments:
------------------------------------------------------------------------
[2012-03-29 12:49:51] larue...@php.net

Dmitry, could you review my patch for this bug plz?  thanks

------------------------------------------------------------------------
[2012-03-29 12:49:24] larue...@php.net

The following patch has been added/updated:

Patch Name: bug61529.patch
Revision:   1333025364
URL:        
https://bugs.php.net/patch-display.php?bug=61529&patch=bug61529.patch&revision=1333025364

------------------------------------------------------------------------
[2012-03-28 08:51:33] yohg...@php.net

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
----------

------------------------------------------------------------------------
[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