By testing the problem is in the + character
It is deleted in the final code because it is not properly escaped.
A code that works here for you is this:
$Start = microtime(true);
ini_set('max_execution_time', 5);
$Code = <<<'Code'
<?php
for($i=0; $i < 300; $i++) {
echo $i . "\n";
};
?>
Code;
include_once 'data://text/plain,' . urlencode($Code);
echo microtime(true) - $Start;
?>
And here using what you mentioned about php: // memory
<?php
$Start = microtime(true);
ini_set('max_execution_time', 5);
$Code = <<<'Code'
<?php
for($i=0; $i < 300; $i++) {
echo $i . "\n";
};
?>
Code;
$fp = fopen('php://memory', 'rw');
fwrite($fp, urlencode($Code)); // escapando corretamente os caracteres
fseek($fp, 0); // Retornando o ponteiro ao inicio do bloco de memória
include_once 'data://text/plain,' . stream_get_contents($fp); // incluindo como um arquivo
echo microtime(true) - $Start;
?>