Edit report at http://bugs.php.net/bug.php?id=51962&edit=1

 ID:               51962
 Updated by:       [email protected]
 Reported by:      jankkhvej at gmail dot com
 Summary:          PHP doesn't allow to have function named "goto"
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Ubuntu 10.04
 PHP Version:      5.3.2

 New Comment:

This should come as no surprise to you if you had read the migration
guide:



http://us.php.net/manual/en/migration53.incompatible.php


Previous Comments:
------------------------------------------------------------------------
[2010-06-01 08:55:46] 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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51962&edit=1

Reply via email to