By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Moving from -> to . for object operators?

P: n/a
Is there a way to change PHP's source and recompile so that I can use
"." instead of "->" for the object operator? Of course, I would also
change "." (the concat operator) to "&" or "+" for the concat
operator.

I think it's as simple as editing "zend_language_scanner.l" from the
source, changing "." to "&", and "->" to ".", then recompiling, but I
haven't tested this. Has anyone done that before?
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Google Mike!

On 20 Oct 2003 13:54:47 -0700, go********@hotpop.com (Google Mike)
wrote:
Is there a way to change PHP's source and recompile so that I can use
"." instead of "->" for the object operator? Of course, I would also
change "." (the concat operator) to "&" or "+" for the concat
operator.

I think it's as simple as editing "zend_language_scanner.l" from the
source, changing "." to "&", and "->" to ".", then recompiling, but I
haven't tested this. Has anyone done that before?


Have you done that with any language before? Its all 1's and 0's in
the end, but I doubt it is that easy. What about the + and the &
operator. What about the ones you replace it with?

SCNR,

Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2

P: n/a
Jochen Daum <jo*********@cans.co.nz> wrote
Have you done that with any language before? Its all 1's and 0's in
the end, but I doubt it is that easy. What about the + and the &
operator. What about the ones you replace it with?


Nah. I think my suggested gameplan is the desired course. I'll attempt it.
Jul 17 '05 #3

P: n/a
"Google Mike" <go********@hotpop.com> wrote in message
news:25**************************@posting.google.c om...
I think it's as simple as editing "zend_language_scanner.l" from the
source, changing "." to "&", and "->" to ".", then recompiling, but I
haven't tested this. Has anyone done that before?


What you suggest is equivalent of running sed (or any other search and
replace) over your source and and changing "." to "&".

While running sed would be much simpler than poking over the lex files,
neither would work properly. You would need to get up in your arms in mud of
scanner and parser to change things at least a bit meaningfully. And even
then I am not sure that the grammar you are proposing can be implemented
properly (for instance can you distinguish use of & as concat operator, and
use of & as reference operator?)

rush
--
http://www.templatetamer.com/

Jul 17 '05 #4

P: n/a
sk
Does the ability to run all the millions of lines of existing PHP code
bother you? Is this some way of forcing yourself to write all your own
libraries and programs to do everything?

While you're at it, maybe you should translate all the language keywords
into Mingrelian and build your own keyboard out of peanut shells and
bubblegum for writing Google Mike Mingrelian-Dotted-Notation PHP.

Google Mike wrote:
Is there a way to change PHP's source and recompile so that I can use
"." instead of "->" for the object operator? Of course, I would also
change "." (the concat operator) to "&" or "+" for the concat
operator.

I think it's as simple as editing "zend_language_scanner.l" from the
source, changing "." to "&", and "->" to ".", then recompiling, but I
haven't tested this. Has anyone done that before?


Jul 17 '05 #5

P: n/a
On Tue, 21 Oct 2003 15:19:29 +0000, sk wrote:

<snip!>
While you're at it, maybe you should translate all the language keywords
into Mingrelian and build your own keyboard out of peanut shells and
bubblegum for writing Google Mike Mingrelian-Dotted-Notation PHP.

<snip!>

That made me laugh out loud! Thanks.
--
Jeffrey D. Silverman | jeffrey AT jhu DOT edu
Johns Hopkins University | Baltimore, MD
Website | http://www.wse.jhu.edu/newtnotes/

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.