php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51782 goto - regression
Submitted: 2010-05-10 11:27 UTC Modified: 2010-05-10 21:48 UTC
From: julian dot picht at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.0+ OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: julian dot picht at gmail dot com
New email:
PHP Version: OS:

 

 [2010-05-10 11:27 UTC] julian dot picht at gmail dot com
Description:
------------
"goto" encourages bad coding style and breaks existing code. There needs to be a 
php.ini-option to disable this "new feature".

Test script:
---------------
<?php

/* broken as of php 5.3.2 */

class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Abstract
{

[...]
    public function goto($action, $controller = null, $module = null, array $params = array())
    {
        $this->setGoto($action, $controller, $module, $params);

        if ($this->getExit()) {
            $this->redirectAndExit();
        }
    }
[...]
}

Expected result:
----------------
should work as before 5.3.2

Actual result:
--------------
500 Internal Server Error in [...] Parse error: syntax error, unexpected T_GOTO, 
expecting T_STRING in /var/www/de.tv-stars/ZendFramework-
1.5.1/library/Zend/Controller/Action/Helper/Redirector.php on line 383 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-10 11:57 UTC] johannes@php.net
There is nothing broken as of 5.3.2, but 5.3.0, this addition was discussed longtime ago. There was enough time to raise concerns this won't be changed.
 [2010-05-10 12:00 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-05-10 12:00 UTC] johannes@php.net
.
 [2010-05-10 21:45 UTC] julian dot picht at gmail dot com
-PHP Version: 5.3.2 +PHP Version: 5.3.0+
 [2010-05-10 21:45 UTC] julian dot picht at gmail dot com
Thanks for reporting that it is broken even longer than I thought.

But I do think that "There was enough time to raise concerns this won't
be changed." seems a bit like the bad habit of ignoring reality.

5.3 is not generally adopted and we just found out that we cannot move
our servers to 5.3 until this issue is fixed.

If you don't have the time to fix it, ask for a patch. Don't just
arrogantly deny that there may be a problem.

PLEASE listen to what the actual USERS of your - otherwise really
great - software need and report.
 [2010-05-10 21:48 UTC] rasmus@php.net
So change your method name.  This will not change.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 12:01:35 2025 UTC