3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class security { private function addSalt($pass) { $salt1='abcdefghijkl'; //OUR FIRST 12 CHAR SALT $salt2='opqrstuvwxyz'; //OUR 2ND 12 CHAR SALT $md5 = (md5($pass)); $hash1 = $salt1.$md5.$salt2;// SALT1-MD5-SALT2 COMBINED $hash2 = strrev($hash1); //WE FLIP-REVERSE THE HASH return $hash2;//CHANGE TO RETURN }//end func private function unSalt($pass2) { $a1 = substr($pass2, -44); // WE STRIP THE FIRST 12 CHAR SALT $b1 = strrev($a1); //WE UN-FLIP THE HASH return substr($b1, -32); // WE FETCH OUR ORIGINAL MD5 AND STRIP THE 2ND SALT }//end func }//end class $h = ''; $sc = new security; for ($i = 0; $i < 100; ++$i) { echo $sc->addSalt($i), "\n"; }
based on T0HKN
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to private method security::addSalt() from context '' in /in/DSVN8:28 Stack trace: #0 {main} thrown in /in/DSVN8 on line 28
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to private method security::addSalt() from context '' in /in/DSVN8 on line 28
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/DSVN8 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/DSVN8 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/DSVN8 on line 6
Process exited with code 255.