Questions tagged [parse-error]

An error of language resulting from code that does not conform to the syntax of the programming language.

Parse error - an error of language resulting from code that does not conform to the syntax of the programming language.

564 questions
206
votes
19 answers

Parse error: Syntax error, unexpected end of file in my PHP code

I got an error: Parse error: syntax error, unexpected end of file in the line With this code:

Welcome…

pratnala
  • 3,723
  • 7
  • 35
  • 58
193
votes
2 answers

In PHP, why does not show a parse error?

I was running the following PHP code: ?> There were no parse errors and the output was "?>" (example). In similar cases I do get a parse error: ?> Parse error: syntax error, unexpected '<' in ... Why…
Irfan
  • 7,029
  • 3
  • 42
  • 57
67
votes
6 answers

PHP : Custom error handler - handling parse & fatal errors

How can i handle parse & fatal errors using a custom error handler?
A.N.M. Saiful Islam
  • 2,118
  • 5
  • 28
  • 34
60
votes
9 answers

parsererror after jQuery.ajax request with jsonp content type

I am using jQuery Version 1.5.1 to do the following ajax call: $.ajax({ dataType: 'jsonp', data: { api_key : apiKey }, url: "http://de.dawanda.com/api/v1/" + resource + ".json", success: function(data) { console.log(data); }, …
Thomas
  • 10,289
  • 13
  • 39
  • 55
28
votes
2 answers

Error java.time.format.DateTimeParseException: could not be parsed, unparsed text found at index 10

I´m trying to pase the next String using LocalDateTime, but I always get de unparsed text found error: Error java.time.format.DateTimeParseException: Text '2016-08-18 14:27:15.103+02' could not be parsed, unparsed text found at index 10 Here is my…
Asier Pomposo
  • 549
  • 4
  • 9
  • 20
25
votes
2 answers

Pandas to_datetime parsing error: Unknown string format

I have a column in my pandas dataframe: Start Date 1/7/13 1/7/13 1/7/13 16/7/13 16/7/13 When I convert it into a date format, I am getting the following error: data['Start Date']= pd.to_datetime(data['Start…
pheno
  • 437
  • 1
  • 4
  • 13
25
votes
1 answer

Haskell - defining a function with guards inside a 'where'

I'm just starting out at teaching myself Haskell. This code is supposed to do prime factorisation: divides :: Integer -> Integer -> Bool divides small big = (big `mod` small == 0) lowestDivisor :: Integer -> Integer lowestDivisor n =…
Benjamin Hodgson
  • 42,952
  • 15
  • 108
  • 157
23
votes
2 answers

Haskell: Parse error in pattern

Who likes to tell me what is wrong with this code (syntactically)? -- merge two sorted lists mergeX [] b res = b ++ res mergeX a [] res = a ++ res mergeX a:as b:bs res | a > b = mergeX as b:bs a:res | otherwise = mergeX a:as bs…
user905686
  • 4,491
  • 8
  • 39
  • 60
22
votes
3 answers

jQuery.ajax() parsererror

when i try to get JSON from http://api-v3.deezer.com/1.0/search/album/?q=beethoven&index=2&nb_items=2&output=json with: (jQuery 1.6.2) $.ajax({ type: "GET", url: url, dataType: "jsonp", success: function (result) { …
Stack Stack
  • 223
  • 1
  • 2
  • 5
22
votes
1 answer

“Unexpected T_OBJECT_OPERATOR” error in PHP

I am getting the following error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in.. on line 52. Line 52 is if ($result = mysqli->query.... If I comment out the line, the same error occurs on $mysqli->query("INSERT INTO.... Why does this…
jeremycollins
  • 379
  • 3
  • 10
  • 17
20
votes
3 answers

In PHP, why does "or die()" work, but "or return" doesn't?

In PHP, you can handle errors by calling or die to exit when you encounter certain errors, like this: $handle = fopen($location, "r") or die("Couldn't get handle"); Using die() isn't a great way to handle errors. I'd rather return an error code so…
Sosumi
  • 759
  • 6
  • 20
19
votes
1 answer

Parse error: syntax error, unexpected '[' with php 5.3

My script is working really fine on my xampp. Now I tried to upload it on the server, but it spat directly a Parse error: syntax error, unexpected '[' in my face. :( The line which its mocking about is this one: $item =…
Owl
  • 689
  • 5
  • 15
  • 29
17
votes
6 answers

Parse error: syntax error, unexpected T_FUNCTION line 10?

What is wrong with my code? I ran the code on my test server and the code worked but when I upload it to my production server I get Parse error: syntax error, unexpected T_FUNCTION in…
acrs
  • 563
  • 2
  • 8
  • 16
17
votes
4 answers

Global.asax parse error after minor change and revert to previous version

The project in context is: ASP .NET Web Application .NET Framework: 4 Platform Target: x86 IDE: Visual Studio 2010 Ultimate SP1 Multiple projects in solution with ASP .NET being the startup project. It has been in production for months without…
Raheel Khan
  • 14,205
  • 13
  • 80
  • 168
15
votes
6 answers

jQuery AJAX - Unexpected token + parsererror

I wrote a script using jQuery and AJAX today, and I get some errors... The script: function changeAdmin(id) { $(document).ready(function() { $('#ta-modarea-'+id).fadeOut('fast'); $('#ta-m-loading-'+id).fadeIn('fast'); $.ajax({ …
Skylineman
  • 566
  • 3
  • 8
  • 19
1
2 3
37 38