ID:               26601
 User updated by:  tomas dot matousek at matfyz dot cz
 Reported By:      tomas dot matousek at matfyz dot cz
 Status:           Open
 Bug Type:         Class/Object related
 Operating System: WinXP
 PHP Version:      4.3.4
 New Comment:

Sorry for a mistake in code. There should be:

  // so do this:
  $a->{18.5*1} = 1;

  // and this too:
  $a->{1*1} = 1;


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

[2003-12-12 07:29:57] tomas dot matousek at matfyz dot cz

Description:
------------
The rules for property names are inconsistent.
See comments in submitted code.


Reproduce code:
---------------
<?
  // this is ok  
  $a->{"x"} = 1;

  // fatal error:
  $a->{18.5} = 1;

  // fatal error:
  $a->{1} = 1;

  // but this one passes thru:
  $a->{true} = 1;

  // so do this:
  $a->{18.5} = 1;

  // and this too:
  $a->{1} = 1;
?>

Expected result:
----------------
Either convert floats, integers and booleans to strings automatically
or report fatal error in all cases when property name is not a string
(i.e. if it is object, array, resource, boolean, integer, float,
NULL).


Actual result:
--------------
Fatal error: Property name must be a string ...


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


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

Reply via email to