| |||
Views: 88,498,668 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 04-29-24 01:36 AM |
|
Guest: Register | Login |
0 users currently in Help/Suggestions/Bug Reports | 3 guests |
Main - Help/Suggestions/Bug Reports - Generic centralized prerelease bug report thread | New thread | New reply |
Kernal |
| ||
Gone Level: 88 Posts: 173/1881 EXP: 6463536 Next: 187128 Since: 02-20-07 Last post: 6149 days Last view: 6139 days |
Posted by Xkeeper Is it just me, or does that like have an extra set of parentheses? if (((......)......())) |
Spontaneous Madness |
| ||
Bloober Level: 47 Posts: 29/441 EXP: 733742 Next: 32461 Since: 02-20-07 From: In hiding.... Last post: 5352 days Last view: 5209 days |
Less of a bug rather than an inconvenience
If you press the submit post button twice, it posts the first message, then reprimands you for double posting ____________________ D: Can't think of anything original.... |
Ninetales |
| ||
Panser Level: 42 Posts: 78/338 EXP: 492388 Next: 28974 Since: 02-19-07 Last post: 5513 days Last view: 4911 days |
[22:58] < [22:58] < [22:58] < [22:58] < [22:58] < [22:58] < [22:58] < [22:58] < [22:59] < [22:59] < [22:59] < [22:59] < [22:59] < [22:59] < Posting this to remind myself to remind Xk about this. |
DarkSlaya |
| ||
Cheep-cheep Level: 32 Posts: 37/189 EXP: 205882 Next: 560 Since: 02-19-07 Last post: 6004 days Last view: 5996 days |
does it have something to do with the referer, or is it already fixed (attachements, that is), because they work fine for me (I could view the link fine) |
Xkeeper |
| ||
Level: 105 Posts: 625/2846 EXP: 12030745 Next: 231515 Since: 02-19-07 Last post: 6062 days Last view: 2800 days |
It was fixed. blackhole89 disabled it temporarily in anticipation of a #dumbass DDoS. ____________________ I dealt with it. |
Ailure |
| ||
Hats Steam Board2 group Level: 121 Posts: 372/3965 EXP: 19783228 Next: 273468 Since: 02-19-07 From: Sweden, Skåne Last post: 3304 days Last view: 2055 days |
Above post fooled me that we had filters implented. xD
And Kernal is right, unless something is missing there's a unnecessary parentheses there. xD No idea if it was fixed though. ____________________ AIM: gamefreak1337, MSN: Emil_sim@spray.se, XMPP: ailure@xmpp.kafuka.org
|
Xkeeper |
| ||
Level: 105 Posts: 627/2846 EXP: 12030745 Next: 231515 Since: 02-19-07 Last post: 6062 days Last view: 2800 days |
Okay, so we have(/had) an extra (). So what? ____________________ I dealt with it. |
Ailure |
| ||
Hats Steam Board2 group Level: 121 Posts: 373/3965 EXP: 19783228 Next: 273468 Since: 02-19-07 From: Sweden, Skåne Last post: 3304 days Last view: 2055 days |
Well, too many parentheses is usually better than too few. Sometimes they're good to increase readability, and I really hate codes where the "formula" is hard to read because the coder in question is afraid of them. :/ ____________________ AIM: gamefreak1337, MSN: Emil_sim@spray.se, XMPP: ailure@xmpp.kafuka.org
|
Kernal |
| ||
Gone Level: 88 Posts: 464/1881 EXP: 6463536 Next: 187128 Since: 02-20-07 Last post: 6149 days Last view: 6139 days |
Posted by Xkeeper Nothing, just something I noticed. I wondered if there was some thing in PHP that I didn't know about where you need extra parentheses around an if condition that's in a line with a number rhyming with "Massachusetts" or something. Peh, I'm insane. |
Stifu |
| ||
Cobrat Level: 56 Posts: 52/666 EXP: 1361576 Next: 36600 Since: 02-22-07 Last post: 688 days Last view: 310 days |
Not a bug, but I thought I'd let you know of a nice page about PHP optimizations I stumbled accross recently, that helps you make your code a bit faster...
http://www.estvideo.com/dew/index/page/phpbench It's in French, but you don't really need to understand the language, only to check each image which shows the speed differences between similar functions (green bar = fastest, yellow bar = slowest)... |
Acmlm |
| ||
Flurry Level: 37 Posts: 136/251 EXP: 315101 Next: 23152 Since: 02-19-07 From: Mirabel, Québec, Canada Last post: 6182 days Last view: 1815 days |
Flurry #&postrank& - ' is faster than " (already knew that)
- Putting variables outside of quotes (using ') is faster (good to know) - echo is faster than print for longer strings (I never knew the difference But I'm too used to print) - if/else is faster than x?x:x (but x?x:x is shorter and more useful at times) - === is faster than == - Defining array elements with [ ] instead of all at once with array() is faster Some of those could be worth using, but I don't know how much faster it'd be overall ____________________ |
Xkeeper |
| ||
Level: 105 Posts: 943/2846 EXP: 12030745 Next: 231515 Since: 02-19-07 Last post: 6062 days Last view: 2800 days |
And oftentimes I use " over ' for stylistic (' for array indexes, " for strings) purposes, since I tend to occasionally mix in "blah $x" (but use " blah ". $_GET['dat'] ." or ". $_GET['dis'] ." blah" (they are differently colored)
(x?x:x) is more useful for inline comparisons (a good example is ($x!=1?"s":""), but if/else is better for most other things.. The echo/print difference is literally so small that it only begins to show up after several thousand print/echos, and even then it's still very, very minor... I tend to switch between them semirandomly, though. ____________________ I dealt with it. |
Stifu |
| ||
Cobrat Level: 56 Posts: 53/666 EXP: 1361576 Next: 36600 Since: 02-22-07 Last post: 688 days Last view: 310 days |
Posted by Xkeeper Still good to know, to change your habits... Besides, steps 4 and 5 of the echo vs print part don't show a "small" difference, when echo is 5 times faster... And yeah, I noticed Acmlm's Board v1.x is filled with prints. I just changed them all to echo on my board, just for the hell of it (quite fast to do that with Notepad++, as it finds and replaces all matches in a blink)... But if you ever do that too, watch out not to change "print mysql_error()" to "echo mysql_error()", as that'll give you an error... |
Kernal |
| ||
Gone Level: 88 Posts: 812/1881 EXP: 6463536 Next: 187128 Since: 02-20-07 Last post: 6149 days Last view: 6139 days |
Wow, I never knew that about what's faster than what. When I started using PHP I just loved the novelty factor of embedding a variable in a string so much that I used it everywhere. I always use echo instead of print though, I guess I just like it better. In my opinion, only commands that send output to an actual printer should be named "print". Is it faster because it's one letter shorter? That made a big difference on some early interpreters, although I suspect any modern PHP server wouldn't be bogged down too much by having to read one extra letter. |
Stifu |
| ||
Cobrat Level: 56 Posts: 54/666 EXP: 1361576 Next: 36600 Since: 02-22-07 Last post: 688 days Last view: 310 days |
Posted by Kernal That crossed my mind, and that may be the case when there is very little difference between print and echo, but not in other cases. I heard print returns (or can return) a boolean while echo doesn't, which further explains why it's slower... |
Xkeeper |
| ||
Level: 105 Posts: 944/2846 EXP: 12030745 Next: 231515 Since: 02-19-07 Last post: 6062 days Last view: 2800 days |
Another thing to consider is that they're using "print()" over "echo", which is afaik going to lead to some overhead anyway.
From what I know, all "print()" was was an alias to "print", since "print" itself is a language construct. And honestly, most of that is literally in the millisecond range for 10,000 iterations; that can easily be caused to some accidental lag on the computer's part, especially for the smaller differences. ____________________ I dealt with it. |
Acmlm |
| ||
Flurry Level: 37 Posts: 139/251 EXP: 315101 Next: 23152 Since: 02-19-07 From: Mirabel, Québec, Canada Last post: 6182 days Last view: 1815 days |
Flurry #&postrank& I tested some of it on my computer, echo and print seem about the same, with and without the () But === was really faster than == (especially when comparing different types), and also variables outside of strings ...
Most of it would only add up to microseconds (unless they're looped many times), but maybe some other parts can still be optimized enough ____________________ |
Kernal |
| ||
Gone Level: 88 Posts: 815/1881 EXP: 6463536 Next: 187128 Since: 02-20-07 Last post: 6149 days Last view: 6139 days |
=== only returns true if two things are the same type, right? So (1 == '1') is true but (1 === '1') is false. So it's probably faster because it doesn't have to do any type conversion. |
UnsurpassedDarkness |
| |||
Goomba Level: 13 Posts: 2/25 EXP: 9886 Next: 381 Since: 03-14-07 From: Kentucky Last post: 6053 days Last view: 5861 days |
|
Stifu |
| ||
Cobrat Level: 56 Posts: 67/666 EXP: 1361576 Next: 36600 Since: 02-22-07 Last post: 688 days Last view: 310 days |
Are you guys thinking of a way to prevent table stretching, when people type long words with no space ?
Maybe using the wordwrap function but preventing it to occur with html and board tags, so URLs can't get cut ? There are other solutions too, although I'm not an expert... |
Main - Help/Suggestions/Bug Reports - Generic centralized prerelease bug report thread | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 82, rows: 110/111, time: 0.018 seconds. |