3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Cheese\Topping\Please { class Foo { public $bar = 'barValue'; protected $baz = 'bazValue'; private $biz = 'bizValue'; } } $foo = new Cheese\Topping\Please\Foo(); $arrayFoo = (array) $foo; $out = json_encode($arrayFoo); $out = preg_replace('/\\\u0000[*a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\\u0000/', '', $out); $newArray = json_decode($out, true); var_dump($newArray);
Output for 5.3.0 - 5.4.21
Fatal error: No code may exist outside of namespace {} in /in/OCIBm on line 11
Process exited with code 255.