top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?

+1 vote
49 views
What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?
posted Feb 26, 2016 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

This error comes when you forget to use a semi colon or correct use of " that is inverted commas or any programming mistakes generally syntax related.
Example :

<?php
  $numberOne = 5
  $numberTwo = 7;        
  echo $numberTwo;
?>

This error will be at line three because of missing semi colon. In PHP parser it converts programs into series of PHP tokens. T_VARIABLE token is of type VARIABLE and when parser processes the tokens,it will throws this error if it receives a variable where none is allowed.

answer Feb 26, 2016 by Shivam Kumar Pandey
Similar Questions
0 votes

The output is in this form

Array (
     [0] => name
     [1] => email
     [2] => contact
     [3] => address 
    ) 
Array (
     [0] => sant
     [1] => sant@gmail.com
     [2] => 1684218942
     [3] => haryana ) 

But I want the output in this form

  Array[1] (
     [0] => name
     [1] => email
     [2] => contact
     [3] => address 
    ) 
Array[2] (
     [0] => sant
     [1] => sant@gmail.com
     [2] => 99999999999
     [3] => haryana
    ) 
+1 vote

I have changed my Php version from 7 to 5.
I got this error ==>

mcrypt_encrypt(): Key of size 10 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported

How to fix this?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...