3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $feed = new StdClass; $feed->name = 'foo'; $feed->url = 'bar'; $feed->bob->toy = 'fred'; $html = <<<HTML onclick="javascript:modify_feed('{$feed->name}','{$feed->url}');" HTML; echo $html; print_r($feed);
Output for 5.4.0 - 7.1.0
Warning: Creating default object from empty value in /in/gnJJX on line 5 onclick="javascript:modify_feed('foo','bar');"stdClass Object ( [name] => foo [url] => bar [bob] => stdClass Object ( [toy] => fred ) )
Output for 5.0.0 - 5.3.29
Strict Standards: Creating default object from empty value in /in/gnJJX on line 5 onclick="javascript:modify_feed('foo','bar');"stdClass Object ( [name] => foo [url] => bar [bob] => stdClass Object ( [toy] => fred ) )
Output for 4.3.0 - 4.4.9
onclick="javascript:modify_feed('foo','bar');"stdClass Object ( [name] => foo [url] => bar [bob] => stdClass Object ( [toy] => fred ) )