carbonsphere / UHPPOTE

Network Communication Class
34 stars 9 forks source link

Setting HEX SN and get... PHP Parse error unexpected T_String #4

Closed sweddle closed 6 years ago

sweddle commented 6 years ago

Hi Carbon Sphere,

Thanks for working on a PHP UHPPOTE door controller. Happy to buy you a beer/send some bucks your way. You have PayPal account?

Anyhow on to the issue/problem.

1) To start I load example.php I get as I should a nice statement of "Please set Serial number before start"

2) I go an enter my HEX SN into UHPPOTE.php private $sn = 193927D6; https://www.screencast.com/t/1SUYvfEvn

3) Reload example.php and I get a 500 error. I check the logs and find this: PHP Parse error: syntax error, unexpected 'D6' (T_STRING), expecting',' or '<' ... line 5 https://www.screencast.com/t/379rEnFYFqN9 Note how it's not liking the D6 of my HEX address/sn.. If I change D to say 4 I get the "Please set SN" message. But using any letter makes it error.

Note: PHP Ver on all systems is 5.6

Any help or ideas would be much appreciated! /Shane

carbonsphere commented 6 years ago

SN is a string so you must enclose the value in quotes.

  1. in example.php use $a->setSn("193927D6");
  2. using static variable in UHPPOTE Class. private $sn = 'D6273919';
  3. should be related to #2