php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7513 unset not allowed in ?-if or an or
Submitted: 2000-10-28 08:09 UTC Modified: 2000-10-30 09:47 UTC
From: wico at cnh dot nl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (28/10/2000) OS: linux
Private report: No CVE-ID: None
 [2000-10-28 08:09 UTC] wico at cnh dot nl
Strange parser thingy:

// this is allowed
if ($skip_name) {
	unset($data[id], $data[name]);
} else {
	unset($data[id]);
}

// this gives parse error:
	$skip_name ? unset($data[id]) : unset($data[id], $data[name]);

$plop OR unset($plop) also makes parser unhappy

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-30 09:47 UTC] stas@php.net
unset is not a function, so you cannot use it in an expression.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Sep 27 22:01:26 2024 UTC