Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #7668 > unrolled thread

Simple expression parser for PHP.

Started byDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
First post2012-11-30 15:56 -0800
Last post2012-12-10 09:40 -0800
Articles 16 on this page of 36 — 10 participants

Back to article view | Back to comp.lang.php


Contents

  Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-11-30 15:56 -0800
    Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-01 18:58 +0100
      Re: Simple expression parser for PHP. Allodoxaphobia <knock_yourself_out@example.net> - 2012-12-01 18:09 +0000
      Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-01 11:06 -0800
        Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-02 12:45 +0100
          Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 09:28 -0800
            Re: Simple expression parser for PHP. Shake <QUITAESTO@QUITAESTO.NOES> - 2012-12-03 18:44 +0100
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 10:06 -0800
                Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-03 21:04 +0100
            Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-03 20:59 +0100
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 12:30 -0800
                Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-03 23:09 +0100
            Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-03 20:39 +0000
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 15:58 -0800
                Re: Simple expression parser for PHP. Jerry Stuckle <jstucklex@attglobal.net> - 2012-12-03 20:50 -0500
                  Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 18:40 -0800
                    Re: Simple expression parser for PHP. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-12-04 09:49 +0100
                      Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-04 09:34 +0000
                      Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-04 10:09 -0800
                Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-04 03:52 +0000
                  Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 22:24 -0800
                Re: Simple expression parser for PHP. Anders Wegge Keller <wegge@wegge.dk> - 2012-12-04 13:49 +0100
                  Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-04 10:20 -0800
                    Re: Simple expression parser for PHP. Anders Wegge Keller <wegge@wegge.dk> - 2012-12-04 19:52 +0100
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 17:18 -0800
                Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-04 11:55 +0100
                  Re: Simple expression parser for PHP. Tim Streater <timstreater@greenbee.net> - 2012-12-04 10:58 +0000
                  Re: Simple expression parser for PHP. Scott Johnson <noonehome@chalupasworld.com> - 2012-12-04 05:54 -0800
                    Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-04 15:29 +0100
                      Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-04 10:25 -0800
                        Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-04 23:23 +0100
                      Re: Simple expression parser for PHP. Scott Johnson <noonehome@chalupasworld.com> - 2012-12-04 23:58 -0800
                    Re: Simple expression parser for PHP. Jerry Stuckle <jstucklex@attglobal.net> - 2012-12-04 10:36 -0500
                    Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-05 09:24 +0000
                      Re: Simple expression parser for PHP. Scott Johnson <noonehome@chalupasworld.com> - 2012-12-06 16:53 -0800
    Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-10 09:40 -0800

Page 2 of 2 — ← Prev page 1 [2]


#7703

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 22:24 -0800
Message-ID<yGgvs.32$eK6.21@newsfe31.iad>
In reply to#7702
On 12/3/12 7:52 PM, The Natural Philosopher wrote:
> Stop talking buzz words and start talking English.

Here's some "English" for you:

*plonk*

[toc] | [prev] | [next] | [standalone]


#7708

FromAnders Wegge Keller <wegge@wegge.dk>
Date2012-12-04 13:49 +0100
Message-ID<87a9tu2d9i.fsf@huddi.jernurt.dk>
In reply to#7697
Daniel Pitts <newsgroup.nospam@virtualinfinity.net> writes:

> My trouble here is not that I'm trying to look smarter, but that I'm
> trying to minimize exposing proprietary information of my employer.

 You are not going to get any real help, until you present an example
of what you need to parse. Or at least something close enough to the
real thing, as to make sense.

 I understand you desire to keep proprietary information private, but
as long as you are only able to provide vague generalities, you're not
going to get anything but vague generalities for answers.

 One general answer is to look at
http://pear.php.net/package/PHP_ParserGenerator and see if that is
suitable for you, even though it's unmaintained.

-- 
/Wegge

Leder efter redundant peering af dk.*,linux.debian.*

[toc] | [prev] | [next] | [standalone]


#7713

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-04 10:20 -0800
Message-ID<T9rvs.6982$TH3.4844@newsfe12.iad>
In reply to#7708
On 12/4/12 4:49 AM, Anders Wegge Keller wrote:
> Daniel Pitts <newsgroup.nospam@virtualinfinity.net> writes:
>
>> My trouble here is not that I'm trying to look smarter, but that I'm
>> trying to minimize exposing proprietary information of my employer.
>
>   You are not going to get any real help, until you present an example
> of what you need to parse. Or at least something close enough to the
> real thing, as to make sense.
>
>   I understand you desire to keep proprietary information private, but
> as long as you are only able to provide vague generalities, you're not
> going to get anything but vague generalities for answers.
>
>   One general answer is to look at
> http://pear.php.net/package/PHP_ParserGenerator and see if that is
> suitable for you, even though it's unmaintained.
>
I actually did find that pear package.  I was hoping to avoid creating 
my own grammar.  The goal was to see if there was something we could use 
out-of-the-box.

If I'm going to go through the trouble of creating my own grammar, I'd 
probably write it in C instead of PHP, and just plug that in.

My "vague generalities" I've given are real use-cases.  Perhaps I didn't 
explain them enough...

Given objects (or associative arrays) Foo and Bar.  I'd like to have 
some call such as:

$expression = "foo['somePropertyOfFoo'] * 3";
$context = initContext(array("foo"=>$Foo, "bar"=>$Bar); // or whatever.
$result = $expressionEvaluator->evaluate($expression, $context);

This particular snippet would result in the same value as 
$Foo['somePropertyOfFoo'] * 3.

where $expression is actually read from a configuration parameter somewhere.

I also need some sort of basic function calling support, even it that 
requires setting up the available functions before hand.

Hopefully that makes the most sense.

[toc] | [prev] | [next] | [standalone]


#7716

FromAnders Wegge Keller <wegge@wegge.dk>
Date2012-12-04 19:52 +0100
Message-ID<87624h3b0f.fsf@huddi.jernurt.dk>
In reply to#7713
Daniel Pitts <newsgroup.nospam@virtualinfinity.net> writes:

> On 12/4/12 4:49 AM, Anders Wegge Keller wrote:
> > Daniel Pitts <newsgroup.nospam@virtualinfinity.net> writes:
> >
> >> My trouble here is not that I'm trying to look smarter, but that I'm
> >> trying to minimize exposing proprietary information of my employer.
> >
> >   You are not going to get any real help, until you present an example
> > of what you need to parse. Or at least something close enough to the
> > real thing, as to make sense.
> >
> >   I understand you desire to keep proprietary information private, but
> > as long as you are only able to provide vague generalities, you're not
> > going to get anything but vague generalities for answers.
> >
> >   One general answer is to look at
> > http://pear.php.net/package/PHP_ParserGenerator and see if that is
> > suitable for you, even though it's unmaintained.
> >
> I actually did find that pear package.  I was hoping to avoid creating
> my own grammar.  The goal was to see if there was something we could
> use out-of-the-box.
> 
> If I'm going to go through the trouble of creating my own grammar, I'd
> probably write it in C instead of PHP, and just plug that in.
> 
> My "vague generalities" I've given are real use-cases.  Perhaps I
> didn't explain them enough...

 I miss at least one thing: How complex expressions do you need to
handle? If you can impose a limitation to very simple expressions, you
might be able to handle them with a set of regular expressions instead
of a tokenizer. But the complexity of that will grow exponentially, so
you'd pretty soon want to do something else.
 
> Given objects (or associative arrays) Foo and Bar.  I'd like to have
> some call such as:
> 
> $expression = "foo['somePropertyOfFoo'] * 3";
> $context = initContext(array("foo"=>$Foo, "bar"=>$Bar); // or whatever.
> $result = $expressionEvaluator->evaluate($expression, $context);
> 
> This particular snippet would result in the same value as
> $Foo['somePropertyOfFoo'] * 3.
> 
> where $expression is actually read from a configuration parameter somewhere.
> 
> I also need some sort of basic function calling support, even it that
> requires setting up the available functions before hand.
> 
> Hopefully that makes the most sense.

 Apart from the complexity of the expressions, I'd say build your own
lexer and parser. *OR* if you have your own choice of DSL, see if you
can use Lua. <http://php.net/manual/en/book.lua.php>

 By using lua, you can isolate your DSL from the rest of the
application, which I guess is one concern, since you started by asking
for a way to avoid eval(). 

-- 
/Wegge

Leder efter redundant peering af dk.*,linux.debian.*

[toc] | [prev] | [next] | [standalone]


#7698

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 17:18 -0800
Message-ID<pbcvs.863$fh5.106@newsfe26.iad>
In reply to#7694
On 12/3/12 12:39 PM, The Natural Philosopher wrote:
> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>> Daniel Pitts wrote:
>>>>>> I have a requirement that I need to take an expression and evaluate
>>>>>> it.
> I still havent a clue what you are talking about.
>
> Hint: smart people make complex things understandable by good
> description. Stupid people make simple things incomprehensible, to make
> them look smarter than they really are. Or at least that's what they
> think...
Hmm, like what you and PointedEars are doing?

I asked a simple question. Is there an expression evaluator for PHP, 
other than "eval"?

[toc] | [prev] | [next] | [standalone]


#7706

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-04 11:55 +0100
Message-ID<5832026.zCYLGgCScI@PointedEars.de>
In reply to#7698
Daniel Pitts wrote:

> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>> Daniel Pitts wrote:
>>>>>>> I have a requirement that I need to take an expression and evaluate
>>>>>>> it.
>> I still havent a clue what you are talking about.
>>
>> Hint: smart people make complex things understandable by good
>> description. Stupid people make simple things incomprehensible, to make
>> them look smarter than they really are. Or at least that's what they
>> think...
> Hmm, like what you and PointedEars are doing?

Score adjusted.

> I asked a simple question. Is there an expression evaluator for PHP,
> other than "eval"?

So, here is a simple answer: No.  Now go away, please.


PointedEars
-- 
When all you know is jQuery, every problem looks $(olvable).

[toc] | [prev] | [next] | [standalone]


#7707

FromTim Streater <timstreater@greenbee.net>
Date2012-12-04 10:58 +0000
Message-ID<timstreater-512B50.10583904122012@news.individual.net>
In reply to#7706
In article <5832026.zCYLGgCScI@PointedEars.de>,
 Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:

> Daniel Pitts wrote:
> 
> > On 12/3/12 12:39 PM, The Natural Philosopher wrote:
> >> On 03/12/12 17:28, Daniel Pitts wrote:
> >>>>>> Daniel Pitts wrote:
> >>>>>>> I have a requirement that I need to take an expression and evaluate
> >>>>>>> it.
> >> I still havent a clue what you are talking about.
> >>
> >> Hint: smart people make complex things understandable by good
> >> description. Stupid people make simple things incomprehensible, to make
> >> them look smarter than they really are. Or at least that's what they
> >> think...
> > Hmm, like what you and PointedEars are doing?
> 
> Score adjusted.
> 
> > I asked a simple question. Is there an expression evaluator for PHP,
> > other than "eval"?
> 
> So, here is a simple answer: No.  Now go away, please.

Why you asking him to do that? That's your job.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#7709

FromScott Johnson <noonehome@chalupasworld.com>
Date2012-12-04 05:54 -0800
Message-ID<k9kvas$4k3$1@dont-email.me>
In reply to#7706
On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
> Daniel Pitts wrote:
>
>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>> Daniel Pitts wrote:
>>>>>>>> I have a requirement that I need to take an expression and evaluate
>>>>>>>> it.
>>> I still havent a clue what you are talking about.
>>>
>>> Hint: smart people make complex things understandable by good
>>> description. Stupid people make simple things incomprehensible, to make
>>> them look smarter than they really are. Or at least that's what they
>>> think...
>> Hmm, like what you and PointedEars are doing?
>
> Score adjusted.
>
>> I asked a simple question. Is there an expression evaluator for PHP,
>> other than "eval"?
>
> So, here is a simple answer: No.  Now go away, please.
>
>
> PointedEars
>

WOW!  I have seen many petty things said and argued but this is the 
first.  Telling someone to go away?  It is not like you have to read or 
even try to help the person.  Just ignore that which you don't like or 
those who don't agree with you.

[toc] | [prev] | [next] | [standalone]


#7710

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-04 15:29 +0100
Message-ID<2564512.OP7lFoDqQX@PointedEars.de>
In reply to#7709
Scott Johnson wrote:

> On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>>> Daniel Pitts wrote:
>>>>>>>>> I have a requirement that I need to take an expression and
>>>>>>>>> evaluate it.
>>>> I still havent a clue what you are talking about.
>>>>
>>>> Hint: smart people make complex things understandable by good
>>>> description. Stupid people make simple things incomprehensible, to make
>>>> them look smarter than they really are. Or at least that's what they
>>>> think...
>>> Hmm, like what you and PointedEars are doing?
>>
>> Score adjusted.
>>
>>> I asked a simple question. Is there an expression evaluator for PHP,
>>> other than "eval"?
>>
>> So, here is a simple answer: No.  Now go away, please.
>> [signature]
> 
> WOW!  I have seen many petty things said and argued but this is the
> first.  Telling someone to go away?  It is not like you have to read or
> even try to help the person.  Just ignore that which you don't like or
> those who don't agree with you.

You want to learn to read the *whole* thread and to quote properly.


HTH

PointedEars
-- 
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
  -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)

[toc] | [prev] | [next] | [standalone]


#7714

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-04 10:25 -0800
Message-ID<Nervs.6983$TH3.5961@newsfe12.iad>
In reply to#7710
On 12/4/12 6:29 AM, Thomas 'PointedEars' Lahn wrote:
> Scott Johnson wrote:
>
>> On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
>>> Daniel Pitts wrote:
>>>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>>>> Daniel Pitts wrote:
>>>>>>>>>> I have a requirement that I need to take an expression and
>>>>>>>>>> evaluate it.
>>>>> I still havent a clue what you are talking about.
>>>>>
>>>>> Hint: smart people make complex things understandable by good
>>>>> description. Stupid people make simple things incomprehensible, to make
>>>>> them look smarter than they really are. Or at least that's what they
>>>>> think...
>>>> Hmm, like what you and PointedEars are doing?
>>>
>>> Score adjusted.
>>>
>>>> I asked a simple question. Is there an expression evaluator for PHP,
>>>> other than "eval"?
>>>
>>> So, here is a simple answer: No.  Now go away, please.
>>> [signature]
>>
>> WOW!  I have seen many petty things said and argued but this is the
>> first.  Telling someone to go away?  It is not like you have to read or
>> even try to help the person.  Just ignore that which you don't like or
>> those who don't agree with you.
>
> You want to learn to read the *whole* thread and to quote properly.

First, PointedEars, I want to apologize for venting my frustration with 
TNP on you.  I feel like you were genuinely *trying* to help.

The simple answer is, as you said, no.  There isn't any well known 
supported expression evaluator in PHP.  Thank you for your time.

[toc] | [prev] | [next] | [standalone]


#7717

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-04 23:23 +0100
Message-ID<2623327.8Knzsc0UeU@PointedEars.de>
In reply to#7714
Daniel Pitts wrote:

> On 12/4/12 6:29 AM, Thomas 'PointedEars' Lahn wrote:
>> Scott Johnson wrote:
>>> On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
>>>> Daniel Pitts wrote:
>>>>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>>>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>>>>> Daniel Pitts wrote:
>>>>>>>>>>> I have a requirement that I need to take an expression and
>>>>>>>>>>> evaluate it.
>>>>>> I still havent a clue what you are talking about.
>>>>>>
>>>>>> Hint: smart people make complex things understandable by good
>>>>>> description. Stupid people make simple things incomprehensible, to
>>>>>> make them look smarter than they really are. Or at least that's what
>>>>>> they think...
>>>>> Hmm, like what you and PointedEars are doing?
>>>>
>>>> Score adjusted.
>>>>
>>>>> I asked a simple question. Is there an expression evaluator for PHP,
>>>>> other than "eval"?
>>>>
>>>> So, here is a simple answer: No.  Now go away, please.
>>>> [signature]
>>>
>>> WOW!  I have seen many petty things said and argued but this is the
>>> first.  Telling someone to go away?  It is not like you have to read or
>>> even try to help the person.  Just ignore that which you don't like or
>>> those who don't agree with you.
>>
>> You want to learn to read the *whole* thread and to quote properly.
> 
> First, PointedEars, I want to apologize for venting my frustration with
> TNP on you.  I feel like you were genuinely *trying* to help.
> 
> The simple answer is, as you said, no.  There isn't any well known
> supported expression evaluator in PHP.  Thank you for your time.

ACK(nowledged).


Regards,

PointedEars
-- 
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

[toc] | [prev] | [next] | [standalone]


#7723

FromScott Johnson <noonehome@chalupasworld.com>
Date2012-12-04 23:58 -0800
Message-ID<k9mure$36k$1@dont-email.me>
In reply to#7710
On 12/4/2012 6:29 AM, Thomas 'PointedEars' Lahn wrote:
> Scott Johnson wrote:
>
>> On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
>>> Daniel Pitts wrote:
>>>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>>>> Daniel Pitts wrote:
>>>>>>>>>> I have a requirement that I need to take an expression and
>>>>>>>>>> evaluate it.
>>>>> I still havent a clue what you are talking about.
>>>>>
>>>>> Hint: smart people make complex things understandable by good
>>>>> description. Stupid people make simple things incomprehensible, to make
>>>>> them look smarter than they really are. Or at least that's what they
>>>>> think...
>>>> Hmm, like what you and PointedEars are doing?
>>>
>>> Score adjusted.
>>>
>>>> I asked a simple question. Is there an expression evaluator for PHP,
>>>> other than "eval"?
>>>
>>> So, here is a simple answer: No.  Now go away, please.
>>> [signature]
>>
>> WOW!  I have seen many petty things said and argued but this is the
>> first.  Telling someone to go away?  It is not like you have to read or
>> even try to help the person.  Just ignore that which you don't like or
>> those who don't agree with you.
>
> You want to learn to read the *whole* thread and to quote properly.
>
>
> HTH
>
> PointedEars
>

No.

[toc] | [prev] | [next] | [standalone]


#7711

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-12-04 10:36 -0500
Message-ID<k9l59p$b6g$1@dont-email.me>
In reply to#7709
On 12/4/2012 8:54 AM, Scott Johnson wrote:
> On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>
>>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>>> Daniel Pitts wrote:
>>>>>>>>> I have a requirement that I need to take an expression and
>>>>>>>>> evaluate
>>>>>>>>> it.
>>>> I still havent a clue what you are talking about.
>>>>
>>>> Hint: smart people make complex things understandable by good
>>>> description. Stupid people make simple things incomprehensible, to make
>>>> them look smarter than they really are. Or at least that's what they
>>>> think...
>>> Hmm, like what you and PointedEars are doing?
>>
>> Score adjusted.
>>
>>> I asked a simple question. Is there an expression evaluator for PHP,
>>> other than "eval"?
>>
>> So, here is a simple answer: No.  Now go away, please.
>>
>>
>> PointedEars
>>
>
> WOW!  I have seen many petty things said and argued but this is the
> first.  Telling someone to go away?  It is not like you have to read or
> even try to help the person.  Just ignore that which you don't like or
> those who don't agree with you.

What do you expect from a troll?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#7724

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-12-05 09:24 +0000
Message-ID<k9n3sr$g0u$1@news.albasani.net>
In reply to#7709
On 04/12/12 13:54, Scott Johnson wrote:
> On 12/4/2012 2:55 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>
>>> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>>>> On 03/12/12 17:28, Daniel Pitts wrote:
>>>>>>>> Daniel Pitts wrote:
>>>>>>>>> I have a requirement that I need to take an expression and
>>>>>>>>> evaluate
>>>>>>>>> it.
>>>> I still havent a clue what you are talking about.
>>>>
>>>> Hint: smart people make complex things understandable by good
>>>> description. Stupid people make simple things incomprehensible, to make
>>>> them look smarter than they really are. Or at least that's what they
>>>> think...
>>> Hmm, like what you and PointedEars are doing?
>>
>> Score adjusted.
>>
>>> I asked a simple question. Is there an expression evaluator for PHP,
>>> other than "eval"?
>>
>> So, here is a simple answer: No.  Now go away, please.
>>
>>
>> PointedEars
>>
>
> WOW!  I have seen many petty things said and argued but this is the
> first.  Telling someone to go away?  It is not like you have to read or
> even try to help the person.  Just ignore that which you don't like or
> those who don't agree with you.
No: ignore that which is essentially incomrehensible.



-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#7737

FromScott Johnson <noonehome@chalupasworld.com>
Date2012-12-06 16:53 -0800
Message-ID<k9relu$v0k$2@dont-email.me>
In reply to#7724
On 12/5/2012 1:24 AM, The Natural Philosopher wrote:

>>>
>>> So, here is a simple answer: No.  Now go away, please.
>>>
>>>
>>> PointedEars
>>>
>>
>> WOW!  I have seen many petty things said and argued but this is the
>> first.  Telling someone to go away?  It is not like you have to read or
>> even try to help the person.  Just ignore that which you don't like or
>> those who don't agree with you.
> No: ignore that which is essentially incomrehensible.
>
>
>

OK OK I concede.  I was taken by surprise by the comment and it was a 
knee jerk comment.

Scotty

[toc] | [prev] | [next] | [standalone]


#7756

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-10 09:40 -0800
Message-ID<b8pxs.19567$pV4.19144@newsfe21.iad>
In reply to#7668
On 11/30/12 3:56 PM, Daniel Pitts wrote:
> Hello,
> I have a requirement that I need to take an expression and evaluate it.
>   I'd very much like to avoid using PHP's eval(), for obvious reasons.
> I'm kind of looking for something that is similar to OGNL (a Java
> library for expressions).
>
> Speed is a plus, ease of integration is a nice-to-have. Low bug density
> and active community is also a plus.

To everyone who helped (or tried to help). I eventually went with using 
create_function()

The expressions themselves are trusted, and this gives the most 
flexibility.  The syntax of PHP isn't the best for this context, but is 
good enough.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.php


csiph-web