> eval I don't know what is that code, but I was told not to trust a PHP code with eval in it.
Levi Williams
>eval()
nice try scholomo
Jordan Brown
>all the newfags in here who cant code and are too braindead to even read what OP posted
Zachary Howard
You retards, eval here isn't accepting any input, its just a clever way to implement a randomized math operator. the eval is literally assigning a variable the program created to another variable it created.
Sebastian Jackson
>a clever way to implement a randomized math operator It's not clever, just retarded
Levi Adams
> You retards I don't deny it, in the end, I can't even program in PHP, but I won't trust it.
>actually thinking using eval is bad if you're not passing in any form of user input
Jaxson Miller
It is
Camden Morris
while youre right, theres no user in put on eval so its okay,
its consideered bad practice, there's a better way to do what youre doing.
But if you insist on being a retard, be my guest
Jordan Ross
>reinventing the wheel because of peer pressure
Ethan Cox
isn't that all of Jow Forums though? >install gentoo >do it all yourself >its good that everything breaks, you're learning!
Carson Russell
but why is eval even used? why not just writing that statement without eval?
Jaxson Cruz
because it works. OP doesn't need to search for another way to do something if his first intuition is perfectly ok. he shouldn't succumb to the taboo and paranoia surrounding a simple function and fix his code when it isn't broken
Anthony Allen
>because it works i was literally asking why did he use eval('$GLOBALCOUNT='.$MATH.';'); and not just $GLOBALCOUNT= $MATH;
they do the same thing right? am i missing something here ?
Charles Rodriguez
$MATH will contain a math operator as a string. by using eval(), that operator gets evaluated as if it were actual code, instead of just assigning a string to that variable.
Brandon Bennett
oh shit thanks and sorry i didnt pay attention to $OPERATOR variable so i guess its not a big deal he used eval, it saves some complexity if he were to write it without eval
Aiden Jones
yuh, eval() is only dangerous if theres any chance of ACE, such as when passing in user input or handling GET, POST, or even directory path.