[ create a new paste ] login | about

Link: http://codepad.org/phKfL4qj    [ raw code | output | fork ]

steadweb - PHP, pasted on Apr 23:
1
2
3
4
5
6
7
8
9
10
11
<?php

$x = new stdclass();
$x->{"42"} = 'foo';
$x = (array)$x;
var_dump($x);
$x[42] = 'bar';
var_dump($x);

echo $x["42"];
echo $x[42];


Output:
1
2
3
4
5
6
7
8
9
10
11
array(1) {
  ["42"]=>
  string(3) "foo"
}
array(2) {
  ["42"]=>
  string(3) "foo"
  [42]=>
  string(3) "bar"
}
barbar


Create a new paste based on this one


Comments: