Can I use PHP reserved names for my functions and classes?

后端 未结 6 604
时光说笑
时光说笑 2020-11-28 15:50

I\'d like to create a function called \"new\" and a class called \"case\".

Can I do that in PHP?

6条回答
  •  醉酒成梦
    2020-11-28 16:38

    By default it is not possible, they are reserved words and you can't use them.

    http://www.php.net/manual/en/reserved.keywords.php

    May be you can recompile PHP or something like this to achieve your aim, but I think (as the other people that answered you) that it is not a good idea :)

    HTH!

提交回复
热议问题