<?php
$obj = ( object) [
'foo' => 'Valor de bar' ,
'foo-bar' => 'Valor de foo-bar' ,
'123-456' => 'Valor de 123-456' ,
'123x456' => 'Valor de 123x456' ,
'0a' => 'Valor de 0a'
] ;
echo "
{$obj->foo}
{$obj ->{'foo-bar'}}
{$obj ->{'123-456'}}
{$obj ->{'123x456'}}
{$obj ->{'0a'}}
" ;
echo <<<EOT
{$obj->foo}
{$obj->{'foo-bar'}}
{$obj->{'123-456'}}
{$obj->{'123x456'}}
{$obj->{'0a'}}
EOT ;
PD9waHAKCiRvYmogPSAob2JqZWN0KSBbCgknZm9vJyA9PiAnVmFsb3IgZGUgYmFyJywKCSdmb28tYmFyJyA9PiAnVmFsb3IgZGUgZm9vLWJhcicsCgknMTIzLTQ1NicgPT4gJ1ZhbG9yIGRlIDEyMy00NTYnLAoJJzEyM3g0NTYnID0+ICdWYWxvciBkZSAxMjN4NDU2JywKCScwYScgPT4gJ1ZhbG9yIGRlIDBhJwpdOwoKZWNobyAiCnskb2JqLT5mb299Cnskb2JqLT57J2Zvby1iYXInfX0KeyRvYmotPnsnMTIzLTQ1Nid9fQp7JG9iai0+eycxMjN4NDU2J319Cnskb2JqLT57JzBhJ319CiI7CgplY2hvIDw8PEVPVAp7JG9iai0+Zm9vfQp7JG9iai0+eydmb28tYmFyJ319Cnskb2JqLT57JzEyMy00NTYnfX0KeyRvYmotPnsnMTIzeDQ1Nid9fQp7JG9iai0+eycwYSd9fQpFT1Q7