3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new STDClass(); $a->id = "123"; $a->idE = "123456"; $a->idC = "024680"; $a->nome = "ppppp pp pppppp"; $a->setor = "ssss ss "; $a->email = "email@email.com"; $a->telefone = "(54) 1234-1234"; $a->ramal = "123"; print_r($a); print_r((array)$a); print_r(get_object_vars($a)); $aC["ccc"] = "aaa"; $aC["ccc"][] = (array) $a; print_r ($aC) ;
based on tCn2X
Output for 7.0.0 - 7.1.0
stdClass Object ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Array ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Array ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Fatal error: Uncaught Error: [] operator not supported for strings in /in/Mu4AR:20 Stack trace: #0 {main} thrown in /in/Mu4AR on line 20
Process exited with code 255.
Output for 4.3.2 - 5.6.25
stdClass Object ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Array ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Array ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Fatal error: [] operator not supported for strings in /in/Mu4AR on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
stdClass Object ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Array ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Array ( [id] => 123 [idE] => 123456 [idC] => 024680 [nome] => ppppp pp pppppp [setor] => ssss ss [email] => email@email.com [telefone] => (54) 1234-1234 [ramal] => 123 ) Fatal error: [] operator not supported for strings in /in/Mu4AR on line 20