This code requires PHP's asp_tags option to be on to run under PHP. This was written to abuse that totally useless feature of PHP. The values in the substr require the script to have windows line endings (\r\n). <% ''; echo substr(' Response.Write("Hello, world!") ', 18, -3); %> Run as either ASP or PHP it outputs "Hello, world!".