syntax-error

Weird unexpected T_STRING error

依然范特西╮ 提交于 2019-12-05 05:29:48
I have a weird PHP error in a current Symfony2 project: unexpected T_STRING in /blahblah/Foo/BarBundle/Entity/User.php on line 1 This is a pretty standard error, usually linked to a mismatched pair of " or '. But here is the code of the file User.php <?php namespace Foo\BarBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="fos_user") * @ORM\Entity(repositoryClass="Foo\BarBundle\Entity\UserRepository") */ class User extends \FOS\UserBundle\Entity\User { // classic user entity The line <?php is line #1. There is no quotes, and the weird thing comes from the fact

Syntax error on token “;”, { expected after this token in Random string creator

旧城冷巷雨未停 提交于 2019-12-05 05:14:20
I am writing code to generate a random 3 letter strings using the letters a, b, and c. I am getting the error message "Syntax error on token ";", { expected after this token" after the line where i create the random variable (Random rand = new Random();). I do not know why I am getting this error when it looks fine to me. I am also getting the error message: Syntax error, insert "}" to complete ClassBody, after the last bracket in the program. I am almost postive all my closing brackets match up so I do not know where this error is coming from. PLEASE HELP!! import java.util.*; public class

Prompt JavaScript If Else Unexpected Token else

强颜欢笑 提交于 2019-12-05 04:20:50
I'm teaching myself JavaScript using Code Academy and I'm trying to make some simple code so that when prompt asks a question, the user reply gives a response. example. prompt says "what's your favourite colour?" user says "blue" response "that's the same colour as the sky!" But when I try to add different options, I get Syntax error: unexpected token else. I tried making it so that if I asked a question, the reply gets a response but anything else gets a response. Here's the code. prompt("what do you want?"); if ("coke"); {console.log ("no coke, pepsi.")}; else console.log ("pepsi only.")};

Ionic issue after installation

时光怂恿深爱的人放手 提交于 2019-12-05 03:35:18
I need some helps to solve problems with ionic on my mac. For every command I launch from terminal with ionic, I receive the same error as shown below. For example even if I give command ionic -v , I receive this: $ ionic -v /usr/local/lib/node_modules/ionic/dist/index.js:24 const [xcode, iosDeploy, iosSim,] = yield Promise.all([ ^ SyntaxError: Unexpected token [ at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require

PHP Syntax Checking with lint and how to do this on a String, not a File

时光怂恿深爱的人放手 提交于 2019-12-05 03:27:29
First off, I'm confused on how to run PHP in the command-line. I've been reading several articles on the web and they all say that you need a CLI (Command Line Interface). Basically, I have PHP files, and I want to call something like this: php -l somefile.php But I'm wanting to check a string , not a file! How can this be done? Can using STDIN , STDOUT , or STDERR help with this at all? If so, how? Can someone provide an example here? Also, where do I place that above code? I don't have access to a command-line (I don't think), or do I just place it within a PHP file itself that will run?

Java generics: Illegal forward reference

ε祈祈猫儿з 提交于 2019-12-05 03:26:02
Given a generic interface interface Foo<A, B> { } I want to write an implementation that requires A to be a subclass of B. So I want to do class Bar<A, B super A> implements Foo<A, B> { } // --> Syntax error or class Bar<A extends B, B> implements Foo<A, B> { } // --> illegal forward reference But the only solution that seems to work is this: class Bar<B, A extends B> implements Foo<A, B> { } which is kind of ugly, because it reverses the order of the generic parameters. Are there any solutions or workarounds to this problem? Since this isn't possible in Java, try to think of Bar<B, A extends

Unexpected T_ELSE error in PHP [closed]

本秂侑毒 提交于 2019-12-05 02:58:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am working on an example from a php book and am getting an error on line 8 with this code <?php $agent = getenv("HTTP_USER_AGENT"); if (preg_match("/MSIE/i", "$agent")); { $result = "You are using Microsoft Internet Explorer"; } else if (preg_match("/Mozilla/i", "$agent")); { $result = "You are using Mozilla

Error: SyntaxError: DOM Exception 12 on Tag Creation Using jQuery

隐身守侯 提交于 2019-12-05 01:33:55
I have the following javascript: var orderItemQuantity = $('<input/>', { type: 'hidden', name: 'order_detail[][quantity]', value: itemQuantity }); The above javascript throws the following error message: Error: SyntaxError: DOM Exception 12 This one works without error: var newListItem = $('<li/>', { html: $('#item_name_'+itemId).text() + '(' + $('#item_quantity_' + itemId).val() +')' + '<a onclick="removeItem(' + itemId + ')">Delete this</a>' + '<input type="hidden" name="order_detail[][item_id]" value="' + itemId + '"/>', id: itemId }); I checked the following question but the answer did not

Creating a list with >255 elements

有些话、适合烂在心里 提交于 2019-12-05 01:11:10
Ok, so I'm writing some python code (I don't write python much, I'm more used to java and C). Anyway, so I have collection of integer literals I need to store. (Ideally >10,000 of them, currently I've only got 1000 of them) I would have liked to be accessing the literals by file IO, or by accessing there source API, but that is disallowed. And not ontopic anyway. So I have the literals put into a list: src=list(0,1,2,2,2,0,1,2,... ,2,1,2,1,1,0,2,1) #some code that uses the src But when I try to run the file it comes up with an error because there are more than 255 arguments. So the constructor

syntax error, unexpected T_VARIABLE [closed]

谁都会走 提交于 2019-12-05 00:49:18
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center . Closed 6 years ago . I can't seem to find where my code has went wrong. Here is my full error: Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\GigaLoad.com\register.php on line 102 But I've been looking a that line for hours. I will give you the entire