3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pswd($password) { $conf = new DataStorage(); /*if($conf->value('app.password.salt') !== false) $salt = '$2y$'.$conf->value('app.password.salt').'$'; else*/ $salt = '$2y$'.substr(md5('zaqDFGDws123xc456derfPOADv78bg9tyGISh0nmjukiolp'), 0, 22).'$'; if(!function_exists('password_hash')) return crypt($password, $salt); else return password_hash($password, PASSWORD_DEFAULT, ['salt' => $salt, 'cost' => 12]); } echo pswd('1q2w3e4r5t');
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
Fatal error: Uncaught Error: Class 'DataStorage' not found in /in/DgO0U:4 Stack trace: #0 /in/DgO0U(16): pswd('1q2w3e4r5t') #1 {main} thrown in /in/DgO0U on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Class 'DataStorage' not found in /in/DgO0U on line 4
Process exited with code 255.

preferences:
115.01 ms | 401 KiB | 101 Q