Bug #16857 Updated: short if assignment syntax for static vars
| From: | sniper@php.net | Date: | Mon, 29 Apr 2002 00:03:21 +0000 |
| Subject: | Bug #16857 Updated: short if assignment syntax for static vars | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-6388@lists.php.net to get a copy of this message | ||
ID: 16857
Updated by: sniper@php.net
Reported By: msopacua@idg.nl
-Status: Open
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 4.2.0
New Comment:
Works fine for me. Can you please add a short and complete
example which shows clearly what you're exactly asking for?
--Jani
Previous Comments:
------------------------------------------------------------------------
[2002-04-26 12:09:37] msopacua@idg.nl
Would be nice if this worked. But the short syntax isn't accepted for a
static var, even it's not in the initial declaration.
<?php
function sql_num_rows($result)
{
static $cmd='undefined';
if($cmd == 'undefined')
{
$cmd=($this->pg_new_api) ? 'pg_num_rows' : 'pg_numrows';
}
return @$cmd($result);
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16857&edit=1