Add test for php5 for pure php implementation (#8251)

* Add test for php5 for pure php implementation

* Add php5.6 to docker image

* Add php5.6 to php 32-bit docker image
diff --git a/kokoro/linux/dockerfile/test/php/Dockerfile b/kokoro/linux/dockerfile/test/php/Dockerfile
index f2fe836..4c9d69d 100644
--- a/kokoro/linux/dockerfile/test/php/Dockerfile
+++ b/kokoro/linux/dockerfile/test/php/Dockerfile
@@ -55,6 +55,26 @@
 # Download php source code
 RUN git clone https://github.com/php/php-src
 
+# php 5.6
+RUN cd php-src \
+  && git checkout PHP-5.6.39 \
+  && ./buildconf --force
+RUN cd php-src \
+  && ./configure \
+  --enable-bcmath \
+  --enable-mbstring \
+  --with-gmp \
+  --with-openssl \
+  --with-zlib \
+  --prefix=/usr/local/php-5.6 \
+  && make \
+  && make install \
+  && make clean
+
+RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \
+  && chmod +x phpunit \
+  && mv phpunit /usr/local/php-5.6/bin
+
 # php 7.0
 RUN cd php-src \
   && git checkout PHP-7.0.33 \
diff --git a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile b/kokoro/linux/dockerfile/test/php_32bit/Dockerfile
index ed2acbe..d657af1 100644
--- a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile
+++ b/kokoro/linux/dockerfile/test/php_32bit/Dockerfile
@@ -53,6 +53,25 @@
 # Download php source code
 RUN git clone https://github.com/php/php-src
 
+# php 5.6
+RUN cd php-src \
+  && git checkout PHP-5.6.39 \
+  && ./buildconf --force
+RUN cd php-src \
+  && ./configure \
+  --enable-bcmath \
+  --enable-mbstring \
+  --with-openssl \
+  --with-zlib \
+  --prefix=/usr/local/php-5.6 \
+  && make \
+  && make install \
+  && make clean
+
+RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \
+  && chmod +x phpunit \
+  && mv phpunit /usr/local/php-5.6/bin
+
 # php 7.0
 RUN wget https://github.com/php/php-src/archive/php-7.0.33.tar.gz -O /var/local/php-7.0.33.tar.gz
 
diff --git a/php/composer.json b/php/composer.json
index 28d379b..4c1b5ac 100644
--- a/php/composer.json
+++ b/php/composer.json
@@ -6,10 +6,10 @@
   "homepage": "https://developers.google.com/protocol-buffers/",
   "license": "BSD-3-Clause",
   "require": {
-    "php": ">=7.0.0"
+    "php": ">=5.5.0"
   },
   "require-dev": {
-    "phpunit/phpunit": ">=6.0.0"
+    "phpunit/phpunit": ">=5.0.0"
   },
   "autoload": {
     "psr-4": {
diff --git a/tests.sh b/tests.sh
index 75ebc12..1135f95 100755
--- a/tests.sh
+++ b/tests.sh
@@ -484,6 +484,16 @@
   internal_build_cpp
 }
 
+build_php5.6() {
+  use_php 5.6
+  pushd php
+  rm -rf vendor
+  composer update
+  composer test
+  popd
+  (cd conformance && make test_php)
+}
+
 build_php7.0() {
   use_php 7.0
   pushd php
@@ -683,6 +693,7 @@
 }
 
 build_php_all_32() {
+  build_php5.6
   build_php7.0
   build_php7.1
   build_php7.4