Unexpected hyphen in namespace [duplicate] - php

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 4 years ago.
Error coming up saying
Parse error: syntax error, unexpected '-', expecting ',' or ';
alluding to
use Firebase\php-jwt\src\ExpiredException;
i pulled the file from git so not sure if it would be wise to rename the files

That is the location of the file, not the namespace.
Try this instead:
use Firebase\JWT\ExpiredException;

Related

I can't get what's worng in this code it made website down [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 1 year ago.
I'm getting error in the PHP code it's a Wordpress custom theme, it made my website down.
PHP Syntax Check:
Parse error: syntax error, unexpected '$', expecting variable (T_VARIABLE) in your code on line 1
Here is the code:
$path = "/home/u921722263/domains/fallcomlegal.co/public_html/wp-content/!function($){$.easing.jswing=$.easing.swing,$.extend($.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){return(t/94256)}";
There is a Syntax errorin this part:
{return $.easing$.easing.def},
because $.easing is followed with a $ there should be a , or something else.
Try fixing this part.

Return array value straight from the function in PHP? [duplicate]

This question already has answers here:
Access array returned by a function in php
(5 answers)
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 3 years ago.
When I run this, it works: $content = get_content(); echo $content['content']; but when I run this echo get_content()['content']; I get Parse error: syntax error, unexpected '[', expecting ',' or ';'
Is there a way around this? I can provide the actual get_content() function if that is necessary but thought I'd start here.
Thanks!

Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ',' or ';' in C:\xampp\htdocs\policycode\sample_code\policy1.php on line 54 [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 4 years ago.
Below is the program i have created using PHP.
foreach (.$resource->getAttributeMap()->entrySet() as .$entry);
if($entrey->getkey()->equal($Resource->RESOURCE_ID_KEY))
continue;
echo".$entry->getkey(). $entry->getValue()[0]";
The program can't iterator for each. How to the solve the issue?
The actual context of the code is not clear but it has syntax errors like .(dot) preceding the variable names, not consistent variable names etc. A modified code would be :
foreach ($resource->getAttributeMap()->entrySet() as $entry){
if($entry->getkey()->equal($resource->RESOURCE_ID_KEY)){
continue;
}
echo $entry->getkey()."". $entry->getValue()[0];
}

vqcache/vq2-catalog_controller_common_header.php [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 5 years ago.
I am receiving this error message:
[17-Mar-2017 10:22:14 America/Detroit] PHP Parse error: syntax error, unexpected end of file in /home/smarthea/public_html/ocart/vqmod/vqcache/vq2-catalog_controller_common_header.php on line 50
Here is the end of my code in the vqcache PHP file:
$this->template = 'default/template/common/header.tpl'; }
{ $this->render(); }
?>
Which syntax am I missing?
See you modification-file. You just missed line number. Just look into instructions in modificator and correct it.
This error usually appear when you're using several vQmod mofificators that used same file. In you case they modify /catalog/controller/common/header.php

php parse/syntax error - help [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
php parse/syntax error help
I keep getting a "Parse error: syntax error, unexpected ':', expecting ')' in /home/jobkill/public_html/process.php on line 8" when processing inputs from a page that redirects here. I dont know what to fix.
You cant use these backquotes, use
"
instead

Categories