ID:               41205
 Updated by:       [EMAIL PROTECTED]
 Reported By:      paul at santasoft dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: centos (linux)
 PHP Version:      Irrelevant
-Assigned To:      
+Assigned To:      colder
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.




Previous Comments:
------------------------------------------------------------------------

[2007-04-27 02:58:41] judas dot iscariote at gmail dot com

<?php
list($bobdole) = 'Bob Dole Smells Like Old Socks!';
echo($bobdole);
?>

atal error: Invalid opcode 98/1/1.was a bug already fixed in CVS.
however there $bobdole should be set to NULL and not to "B" as you
expect ( or at least that is the bahviuor it has in CVS)

IMHO it should trow a fatal error: "cannot use string as an array"

------------------------------------------------------------------------

[2007-04-26 16:45:49] paul at santasoft dot com

Description:
------------
clarification is needed in the documentation in the case of a
one-to-one assignment using list() and a string.  see reproduction code
example 1.  i understand that in this case, the string is being treated
as an array of characters.  But this was not as expected initially.

Plus, a fatal error is generated if the string is directly provided
instead of returning from a function.  Inconsistent and confusing.

Reproduce code:
---------------
Example 1:

<?php
function bob_dole_is_a_dork() {
        return 'Bob Dole Smells Like Old Socks!';
}
list($bobdole) = bob_dole_is_a_dork();
echo($bobdole);
?>


Example 2:

<?php
list($bobdole) = 'Bob Dole Smells Like Old Socks!';
echo($bobdole);
?>

Expected result:
----------------
Example 1:

Bob Dole Smells Like Old Socks!



Example 2:

Bob Dole Smells Like Old Socks!


Actual result:
--------------
Example 1 gives:

B

Example 2 gives:

Fatal error: Invalid opcode 98/1/1. in /the/path/doesnt/matter/pp.php
on line 2



------------------------------------------------------------------------


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

Reply via email to