[PHP-DEV] Bug #11070 Updated: '@' does not turn off error checking in foreach()

2001-08-28 Thread sander

ID: 11070
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Duplicate
Bug Type: Feature/Change Request
Operating System: linux
PHP Version: 4.0.5
New Comment:

Duplicate of 6118.

Previous Comments:


[2001-05-23 18:52:59] [EMAIL PROTECTED]

Use

if (is_array($a))
foreach ($a as $key = $val) {
/* Do something */
}

until it is added, which it may not be.

-Chris



[2001-05-23 18:47:32] [EMAIL PROTECTED]

it would be nice to see the '@' turn off error reporting on the foreach() command. ie.

?php
  foreach($test as $pos = $val)
  {

  }
?
gives an error because $test is not set.

?php
  foreach(@$test as $pos = $val)
  {

  }
?
gives an error because its the wrong data type.

?php
  @foreach($test as $pos = $val)
  {

  }
?
gives a syntax error. it would be nice if this last command worked :)

  Chris Lee
  [EMAIL PROTECTED]







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


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #11070 Updated: '@' does not turn off error checking in foreach()

2001-05-23 Thread cnewbill

ID: 11070
Updated by: cnewbill
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Feature/Change Request
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

Use

if (is_array($a))
foreach ($a as $key = $val) {
/* Do something */
}

until it is added, which it may not be.

-Chris

Previous Comments:
---

[2001-05-23 18:47:32] [EMAIL PROTECTED]
it would be nice to see the '@' turn off error reporting on the foreach() command. ie.

?php
  foreach($test as $pos = $val)
  {

  }
?
gives an error because $test is not set.

?php
  foreach(@$test as $pos = $val)
  {

  }
?
gives an error because its the wrong data type.

?php
  @foreach($test as $pos = $val)
  {

  }
?
gives a syntax error. it would be nice if this last command worked :)

  Chris Lee
  [EMAIL PROTECTED]



---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11070edit=2


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]