3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $name = "test"; $contact = "Test Contact"; $email = "test@testing.comm"; $phone = "12345678"; $obj = new stdClass(); $obj-> $obj->id = "12334567755"; $obj->Type = "0"; $obj->Name = $name; $obj->Contact = $contact; $obj->Email = $email; $obj->Phone = $phone; $obj->Cellular = $phone; $obj->Address = "הרחוב שלי 23"; $obj->City = "תל אביב"; $obj->Zip = "11233"; $obj->Comments = "הערות יתקבלו בברכה"; $data = json_encode($obj); $string = '{"NewAccount": '.$data.'"}"';
Output for 7.1.0
Recoverable fatal error: Object of class stdClass could not be converted to string in /in/DG3Qm on line 9
Process exited with code 255.
Output for 5.2.0 - 7.0.14
Catchable fatal error: Object of class stdClass could not be converted to string in /in/DG3Qm on line 9
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Notice: Object of class stdClass to string conversion in /in/DG3Qm on line 9 Strict Standards: Creating default object from empty value in /in/DG3Qm on line 9 Fatal error: Call to undefined function json_encode() in /in/DG3Qm on line 21
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Object to string conversion in /in/DG3Qm on line 9 Fatal error: Call to undefined function: json_encode() in /in/DG3Qm on line 21
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Object to string conversion in /in/DG3Qm on line 9 Fatal error: Call to undefined function: json_encode() in /in/DG3Qm on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Object to string conversion in /in/DG3Qm on line 9 Fatal error: Call to undefined function: json_encode() in /in/DG3Qm on line 21