Skip to content

Instantly share code, notes, and snippets.

@patrobinson
Last active November 14, 2017 09:11
Show Gist options
  • Save patrobinson/94e2c071376540c622e86b3bfd912fec to your computer and use it in GitHub Desktop.
Save patrobinson/94e2c071376540c622e86b3bfd912fec to your computer and use it in GitHub Desktop.
INIT='eval $(docker-machine env docker5)'
PARSE = 'echo parse_url("http://google.com#@example.com/", PHP_URL_HOST);'
READ = 'echo readfile("http://google.com#@example.com/");'
versions = []
14.upto 25 do |i|
versions << "7.0.#{i}"
end
def test_version(version)
cmd = "#{INIT} && docker run -it php:#{version}-alpine php -r '#{PARSE}'"
resp_parse = `#{cmd}`
cmd = "#{INIT} && docker run -it php:#{version}-alpine php -r '#{READ}'"
puts cmd
resp_read = `#{cmd}`
puts resp_read
puts resp_parse
if resp_read =~ /iana.org/ and resp_parse =~ /google/
puts "WIN"
elsif resp_read =~ /Google/i and resp_parse =~ /example/
puts "WIN2"
end
end
versions.each do |version|
puts version
test_version(version)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment