<?php
echo "openssl version text: " . OPENSSL_VERSION_TEXT . "\n";
echo "openssl version number: " . OPENSSL_VERSION_NUMBER . "\n";
?>
will output something like:
openssl version text: OpenSSL 1.0.2d 9 Jul 2015
openssl version number: 268443727
see also: https://wiki.openssl.org/index.php/Manual:OPENSSL_VERSION_NUMBER(3)