PHP class method named print... not allowed?
php
Solution
This won't work because print is a language construct in php. I know it looks like a function, but it is treated the same way as (for example) `function`, `while`, `include`, and so on.
Problem
I am writing a Controller for Codeigniter with a method named "print". The name is important, because I would like to be able to access the page at "http://www.mysite.com/mycontroller/print". However, I cannot do this because there is the syntax error: ``` Parse error: syntax error, unexpected T_PRINT, expecting T_STRING ``` Is there any special syntax to make the PHP interpreter "think" that when I say: ``` class MyClass extends Controller { function print() { // print method here } } ``` ... that I am talking about a method with a T_STRING name of "print" and not the T_PRINT that it is expecting it to be?