3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dn="cn=admin"; $pass="\x00\x41"; if (empty($dn) or empty($pass)) { exit(); } //check for empty strings //if (preg_match('/[^a-zA-Z]/',$dn) or preg_match('/[^a-zA-Z0-9\x20!@#$%^&*()]/',$pass)) { exit(); } //check for expected values (whitelisting) //if (preg_match('/\x00/',$dn) or preg_match('/\x00/',$pass)) { exit(); } //check for null byte (blacklisting) $ldapconn=ldap_connect("challenge01.root-me.org", "54013") or die("Could not connect to LDAP server."); if ($ldapconn) { ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); $ldapbind=ldap_bind($ldapconn, $dn, $pass); if ($ldapbind) { echo("success"); } else { echo("fail"); } } ?>
based on 1UqOZ
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught Error: Call to undefined function ldap_connect() in /in/umN77:7 Stack trace: #0 {main} thrown in /in/umN77 on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.24
Fatal error: Call to undefined function ldap_connect() in /in/umN77 on line 7
Process exited with code 255.