3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generatePassword($username, $password ) { /* 1. RESULT = LOWER_CASE ( username ) + PASSWORD 2. RESULT = LOWER_CASE ( SHA1_HEX(RESULT) ) 3. RESULT = SESSIONID + RESULT 4. RESULT = UPPER_CASE ( SHA1_HEX(RESULT) ) */ $this->_sessionid = 'GEW4JHV7H7JOR5IV868R'; if( $this->_sessionid ) { //1. $result = strtolower( $username ) . $password; //2. $result = strtolower( sha1( $result ) ); //3. $result = $this->_sessionid . $result; //4. $result = strtoupper( sha1( $result ) ); } else { $result = false; } return $result; } print_r(generatePassword('lg_kerketi', '4321')); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Using $this when not in object context in /in/bJLbg:10 Stack trace: #0 /in/bJLbg(28): generatePassword('lg_kerketi', '4321') #1 {main} thrown in /in/bJLbg on line 10
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
68.7 ms | 401 KiB | 8 Q