fork(1) download
  1. <?php
  2.  
  3. $obj = (object) [
  4. 'foo' => 'Valor de bar',
  5. 'foo-bar' => 'Valor de foo-bar',
  6. '123-456' => 'Valor de 123-456',
  7. '123x456' => 'Valor de 123x456',
  8. '0a' => 'Valor de 0a'
  9. ];
  10.  
  11. echo "
  12. {$obj->foo}
  13. {$obj->{'foo-bar'}}
  14. {$obj->{'123-456'}}
  15. {$obj->{'123x456'}}
  16. {$obj->{'0a'}}
  17. ";
  18.  
  19. echo <<<EOT
  20. {$obj->foo}
  21. {$obj->{'foo-bar'}}
  22. {$obj->{'123-456'}}
  23. {$obj->{'123x456'}}
  24. {$obj->{'0a'}}
  25. EOT;
Success #stdin #stdout 0.02s 26108KB
stdin
Standard input is empty
stdout
Valor de bar
Valor de foo-bar
Valor de 123-456
Valor de 123x456
Valor de 0a
Valor de bar
Valor de foo-bar
Valor de 123-456
Valor de 123x456
Valor de 0a