Skip to content

Instantly share code, notes, and snippets.

@netojoaobatista
Created June 5, 2012 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netojoaobatista/2876729 to your computer and use it in GitHub Desktop.
Save netojoaobatista/2876729 to your computer and use it in GitHub Desktop.
Espaço nos nomes das propriedades
<?php
$o = new stdClass();
$o->{' '} = 1;
$o->{' '} = 2;
$o->{' '} = 3;
var_dump($o);
/* Saída
* [neto@localhost ~]$ php -v
* PHP 5.4.3 (cli) (built: May 9 2012 15:06:10)
* Copyright (c) 1997-2012 The PHP Group
* Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
* with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
* [neto@localhost ~]$ php o.php
* class stdClass#1 (3) {
* public $ =>
* int(1)
* public $ =>
* int(2)
* public $ =>
* int(3)
* }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment