ircmaxell / PHP-PasswordLib

A library for generating and validating passwords
373 stars 61 forks source link

unexpected (T_VARIABLE) error #9

Closed bens545 closed 11 years ago

bens545 commented 11 years ago

I have a file that contains the following to test the script and make sure it will hash the password and that it is not a fault somewhere else.

<?php
require_once "/home/benj545.ath.cx/bocsy/assets/PasswordLib/bootstrap.php";

$password = "password"
$crypt = new PasswordLib\PasswordLib;
$hash = $crypt->createPasswordHash($password, '$a2$'); // Blowfish
echo $hash;

Although when I try to run this script I get the following error which does not occur when I am running on my local machine although happens on my webserver. My webserver is running PHP version 5.4.12 and my localhost is running PHP 5.3.9

PHP Parse error:  syntax error, unexpected '$crypt' (T_VARIABLE) in /home/benj545.ath.cx/bocsy/test.php on line 5
mfrost503 commented 11 years ago

I'm going to go out on a limb here and say that you're missing a semi-colon after password :)

jpetazzo commented 11 years ago

Ditto

bens545 commented 11 years ago

Oh, I hate it when it is something as simple as that. Anyway, thanks for looking at it.