Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:40:02+00:00 2026-06-04T16:40:02+00:00

Exact same code passes a lint check ‘php -l’ on php 5.3.13 (server) but

  • 0

Exact same code passes a lint check ‘php -l’ on php 5.3.13 (server) but not on php 5.3.12 (local). Is this a result of my local configuration and something I could change or should I? I can rewrite the else below using a printf() for example, but just curious.

PHP Parse error: syntax error, unexpected T_EXIT, expecting T_FUNCTION

function wp_custom_redirect($url) {

    if( ! headers_sent() ) 
    {
        wp_redirect($url);
    } 
    else 
    {
    ?>

    <script>
    self.location.href = '<?php echo $url; ?>';
    </script>

    <?php
    }

    exit();
}

updated: the line with the exit(); (T_EXIT) is the line with the error.

I can rewrite the else to look like this (see below) and lint passes on my local machine. What I’m trying to determine is why it fails when it is valid php, and I suspect it’s some php.ini configuration. I’m just not sure where yet.

else
{
    printf( '<script>self.location.href = "%s";</script>', $url );
}

solved it was a previous example of this, but a <? used instead of a <?php and on my local server configuration, the short_tags were Off, no idea why the lint kept going until much later in the code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:40:03+00:00Added an answer on June 4, 2026 at 4:40 pm

    The configuration was indeed the issue, as it was a short_tags = Off setting on my local php.ini. I didn’t catch it earlier in a function much earlier than the one I posted, but the line number didn’t help and I’m not entirely sure why the lint didn’t indicate the short_tag instead of the T_EXIT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically my question is the exact same one as this: Simple client/server, TCP/IP encrypting
On one hand, this problem is tough because I have the same exact code
I have implement the exact same concept for my project- http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/ My question is,
These two querys gives me the exact same result: select * from topics where
I have a function that takes the exact same args, but sometimes I'd like
I am running the exact same code in a WP7 application and a C#
I tried copying the exact same code from the FullCalendar Homepage . So I
My partner and I have checked out the exact same code, and we are
The slideshows for http://vbwpublishing.com and http://store.virtualbookworm.com should have the exact same code, and work
We are using Emacs on Sun OS 5.9. I wrote the exact same code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.