unexpected T_PAAMAYIM_NEKUDOTAYIM #1

Closed
tollmanz opened this Issue Aug 26, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@tollmanz

I developed with 1.0 locally. Everything seemed to work fine. After uploading and activating on another site, I was greeted an error "unexpected T_PAAMAYIM_NEKUDOTAYIM" on line 501. This line is:

"return $class_name::singleton();"

By manually replacing "$class_name" with "Post_Options_API_1_0", it fixed the error, although the same type of error popped up on line 512. I implemented the same fix for that error.

After some searching, I learned that this occurred because my dev server is running PHP 5.3.6, while the other server is on 5.2.14. PHP.net's article on scope resolution operator's states: "As of PHP 5.3.0, it's possible to reference the class using a variable." So, I guess this is only compatible with PHP 5.3+.

I think that either these functions should be altered, or there should be a note that the API will only work with 5.3+

@kovshenin

This comment has been minimized.

Show comment
Hide comment
@kovshenin

kovshenin Aug 26, 2011

Owner

Yeah PHP version is another thing we'll have to deal with. I wouldn't want this to work with 5.3+ only so I'll probably find a way, even If I have to do it through create_function :) Thanks for reporting this!

Owner

kovshenin commented Aug 26, 2011

Yeah PHP version is another thing we'll have to deal with. I wouldn't want this to work with 5.3+ only so I'll probably find a way, even If I have to do it through create_function :) Thanks for reporting this!

@kovshenin

This comment has been minimized.

Show comment
Hide comment
@kovshenin

kovshenin Aug 27, 2011

Owner

There we go. Zack, I tested this with 5.2 seems to work fine, if you have some time would you please give it a spin as well? Should work fine since I'm now using call_user_func, thanks!

Owner

kovshenin commented Aug 27, 2011

There we go. Zack, I tested this with 5.2 seems to work fine, if you have some time would you please give it a spin as well? Should work fine since I'm now using call_user_func, thanks!

@tollmanz

This comment has been minimized.

Show comment
Hide comment
@tollmanz

tollmanz Aug 27, 2011

I can confirm that this is fixed. Nice work!

I can confirm that this is fixed. Nice work!

@tollmanz tollmanz closed this Aug 27, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment