php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51962 PHP doesn't allow to have function named "goto"
Submitted: 2010-06-01 08:55 UTC Modified: 2010-06-01 09:12 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jankkhvej at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Ubuntu 10.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jankkhvej at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-01 08:55 UTC] jankkhvej at gmail dot com
Description:
------------
[...]
	public function goto($page_num)
	{
		$this->page_num = $page_num;
	}
[...]

gives that:

[Tue Jun 01 09:34:01 2010] [error] [client 127.0.1.1] PHP Parse error:  syntax error, unexpected T_GOTO, expecting T_STRING in /workspace/project/web/lib/DataSourcePager.class.php on line 63


Test script:
---------------
<?php
class My_goto_test {
        public function goto($str = null) {
                echo $str;
        }
}

$tezt = new My_goto_test;
$tezt->goto('hello!');


Expected result:
----------------
hello!

Actual result:
--------------
PHP Parse error:  syntax error, unexpected T_GOTO, expecting T_STRING in /home/solik/jjj/goto_test.php on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-01 09:12 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2010-06-01 09:12 UTC] rasmus@php.net
This should come as no surprise to you if you had read the migration guide:

http://us.php.net/manual/en/migration53.incompatible.php
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Jul 28 18:00:01 2026 UTC