ID: 28165
Updated by: [EMAIL PROTECTED]
Reported By: daniel at rozsnyo dot com
-Status: Open
+Status: Suspended
-Bug Type: Zend Engine 2 problem
+Bug Type: Feature/Change Request
-Operating System: WinXP
+Operating System: *
-PHP Version: 5CVS-2004-04-26 (dev)
+PHP Version: 5.0.*
New Comment:
There are no plans for this. Maybe in PHP 6.
Previous Comments:
------------------------------------------------------------------------
[2004-04-26 19:10:48] daniel at rozsnyo dot com
Description:
------------
While the docs says that i can use use objects as needle, i actually
can not - it might be missing some implicit conversion to integer from
objects.
(I use the published RC2 version (for win32), not the CVS version, the
RC2 option is not available in the listbox for posting a bug-report)
Another problem is the notice (in RC1 there was no notice, here is a
notice... so I am posting as bug... by the way, it would be nice to
have functions like __toInteger() [in_array], __toArray() [for]
besides the known __toString [echo,print]
Daniel
Reproduce code:
---------------
<?php
class A { }
$a = Array( new A, new A, new A );
echo $x = new A; // should be object # 4
echo (in_array($x,$a)) ? 'There' : 'NOT there';
?>
Expected result:
----------------
I am expecting this result:
---
Object id #4
NOT there
Actual result:
--------------
Look to notices:
---
Object id #4
Notice: Object of class A could not be converted to integer in
C:\www\default\test\index.php on line 9
Notice: Object of class A could not be converted to integer in
C:\www\default\test\index.php on line 9
There
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28165&edit=1