I tried to work around it with including a php file in the Yootheme Builder and then echo the article ID
{source}<?php
include JPATH_SITE.'/folder/file.php';
?>{/source}
echo $article->id;
...but I get the same error:
Warning: Undefined property: stdClass::$id in /folder/file.php on line 16
I then tried to archieve it thru a module, but after saving it the php tags are stripped. My backend editor is set to "None". If I try to add the code via the "</>Code" button the php tags are also stripped and a strange span is added:
Probably because you are using Yootheme, Sourcerer can't create the $article object, based on the current URL.
Placing your code in an external file doesn't change that (it actually just makes it more certain that the $article object is not available).
Are you trying to use this on normal article pages in Joomla? So are the URLs pointing to an article page?