IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1982.49 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-11
Pages: 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Next >
[00:00]<s|c>Noel4DMB: do you have zlib etc installed?
[00:00]<njnf9dmb>yes
[00:00]<s|c>no idea then tbh
[00:00]<s|c>MarkR42: oh yes that's right, it's not by reference ugh
[00:00]<s|c>Crescendo: just avoid global variables
[00:01]<mzzcz9q>Well, "global $x" is a shorthand for $x = & $GLOBALS['x'];
[00:01]<kjganlv>does anyone know where i can find a base32_encode alithogram for php4
[00:01]<azgsaggmj>I need for a variable to be remembered beyond a class... so NEXT time the class is used, it's still the same...
[00:01]<azgsaggmj>http://pastebin.ca/63896
[00:01]<lwgx>Crescendo: A constant?
[00:01]<s|c>Crescendo: you probably want to take a look at how you defined your classes
[00:02]<azgsaggmj>Maybe, I don't know?
[00:02]<mzzcz9q>Crescendo: You should not shun globals completely, just try not to let them take over your app. Make them few and well documented, and it'll be fine.
[00:02]<mzzcz9q>I think you can also have static member variables
[00:02]<azgsaggmj>I'm somewhat of a newb to PHP.
[00:02]<azgsaggmj>Kinda learning as I go.
[00:02]<azgsaggmj>Again, that pastebin entry is what I have right now.
[00:02]<s|c>MarkR42: when would you use a global :|
[00:03]<wjlllrws>Crescendo: IRC bots aren't a good place to start... They usually require a pretty advanced language knowledge
[00:03]<mzzcz9q>I normally do use globals, but only very few
[00:03]<azgsaggmj>Particularly in the 'fight' c;ass/
[00:03]<azgsaggmj>Eh, I didn't start there.
[00:03]<vxggygvxcuv>MarkR42, ok could you point me to some documentation or anything to show me how to store the results in an array, because my attempts haven't done so well.
[00:03]<mzzcz9q>s|k: I have a global $db for my connection
[00:03]<vxggygvxcuv>MarkR42, I suck at arrays.
[00:03]<azgsaggmj>I've been debugging PHP to the best of my ability on http://gwing.net for a while now
[00:03]<azgsaggmj>And phpBB isn't exactly the most clean PHP code you can find.
[00:04]<azgsaggmj>But yeah, how would I go about causing the fight class to remember what case it is in?
[00:04]<azgsaggmj>http://pastebin.ca/63896
[00:04]<s|c>MarkR42: yeah okay that makes sense, so they are passed by reference but if you unset $x you're only unsetting that pointer to that variable
[00:04]<s|c>is that right?
[00:04]<s|c>to that whatever
[00:05]<mzzcz9q>s|k: You're only unsetting the local $x, not the global one. It's weird.
[00:05]<s|c>yeah it sounds weird
[00:05]<mzzcz9q>Because global $x is a proper statement, not a lexical construct
[00:05]<s|c>I don't know what that means
[00:05]<n2sm>mark im stuck man
[00:05]<mzzcz9q>global $x really happens at runtime, not compile-time
[00:05]<n2sm>it used to work when i ran apache1 + php 4x
[00:05]<s|c>oh
[00:05]<s|c>got it
[00:06]<n2sm>now that just doesnt work care to help me one on one?
[00:06]<mzzcz9q>In other languages, such as when you do "import" in Java or "using" in C++ or C#, this is an entirely compile-time thing.
[00:06]<ajpmpdzn>lets say a string is outputted as 10/2, how can i evaluate that show it would show as 5
[00:06]<mzrrjvr>can someone help me please i have foreach($xml['VIPDATABASE']['0']['VIPDATA']['0'] as $key => $value) i need the last ['0'] to increment for each array it finds how can i do this ?
[00:07]<rfv_q>what is the time?
[00:07]<mzzcz9q>coldfyre: Well, you could use eval(), but eval() is a very very bad thing to use, for any purpose, if you're using it, then something is probably wrong. I can't remember who said it but someone said "If eval() is the solution, you're solving the wrong problem"
[00:07]<mzrrjvr>22:06 gmt
[00:07]<rfv_q>dragova, ok
[00:08]<nv>If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf
[00:08]<mzzcz9q>that's it
[00:08]<ajpmpdzn>MarkR42: form the docs, eval isnt the right solution
[00:08]<bznrm>window balance
[00:08]<-- dvxn|syzzzyus xzs>http://www.bagdadsoftware.de")
[00:09]<azgsaggmj>How to remember the variable 'type' through multiple loops of the class 'fight' in http://pastebin.ca/63896
[00:11]<mzrrjvr>??
[00:11]<mzzcz9q>ebsd: I cannot help you to debug PHP crashing. It's probably down to either a build error, or a dodgy version of some underlying library, or something like a hardware fault. In any of these cases it's outside of PHP's scope.
[00:11]<n2sm>im just trying to toggle the debugging
[00:12]<n2sm>since the script cant be executed cli style
[00:12]<mzzcz9q>ebsd: I would recommend that you try to reproduce the crash on the latest version of PHP, with no zend extensions installed. If you succeed, there may be a valid bug to report
[00:12]<n2sm>its not giving me much insight- just says segmentation fault on child process
[00:12]<n2sm>ok - its the latest ver
[00:12]<n2sm>i'll flick off zend
[00:12]<mzzcz9q>ebsd: Make the smallest script you can which triggers the error
[00:12]<mzzcz9q>run t
[00:12]<mzzcz9q>run it from CLI,
[00:13]<mzzcz9q>and remove *all* zend extensions
[00:13]<mzzcz9q>If it still happens then it could be a legit bug in PHP- believe me, I have reported several.
[00:15]<mzzcz9q>Crescendo: Ahh, that was a question? In English, questions don't start "How to". They also tend to end in question marks. Perhaps you meant "How do I ... ?"
[00:15]<azgsaggmj>How do I remember the variable 'type' through multiple loops of the class 'fight' in http://pastebin.ca/63896 ??
[00:16]<azgsaggmj>=D
[00:17]<mzzcz9q>Why not use a member variable?
[00:18]<mzzcz9q>In any case, you've done "global $type", which makes it global
[00:18]<mzzcz9q>Oh, you've also overwritten it with global $type = 1
[00:19]<mzzcz9q>I don't understand what you're trying to do, it doesn't make a lot of sense. And as it's an IRC bot it's fairly pointless anyway.
[00:20]<s|c>IRC bots are very useful
[00:20]<azgsaggmj>Erm, that class is called once every so many milliseconds, defined by user.
[00:20]<azgsaggmj>It will need to basically... post one thing, then another... in certain orders.
[00:21]<wjlllrws>s|k: That depends on coder intellect
[00:23]<mzzcz9q>Crescendo: classes are not called, methods are called.
[00:24]<mzzcz9q>and why can't you use a normal instance member variable, if it's the same instance each time?
[00:25]<s|c>Wolfpaws: everything depends on coder intellect :)
[00:26]<s|c>if programmers organized we could rule the world at this point :/
[00:27]<wjlllrws>s|k: That'd suck.
[00:27]<azgsaggmj>No idea, MarkR42... I don't know the difference.
[00:28]<azgsaggmj>How should I implement that function, then?
[00:28]<mzzcz9q>You have done already. the function is called training() isn't it?
[00:29]<s|c>Wolfpaws: not if I'm the leader, it would be free ice cream for everyone
[00:30]<rslyrzyrr>linux2: how's it going?
[00:31]<fyguwq>espiering: its good. been busy working. lol
[00:31]<fyguwq>espiering: i need a team for my website
[00:31]<fyguwq>im never going to get it completed by myself in a reasonable time
[00:31]<rslyrzyrr>yeah?
[00:32]<rslyrzyrr>so your login is working now?
[00:32]<fyguwq>espiering: no not yet. haven't had time to work on it. i will at 6pm once my shift is over
[00:33]<rslyrzyrr>ah, i see.
[00:34]<fyguwq>espiering: you know anywhere that i could kinda get a team to help me along with the project
[00:36]<fyguwq>i essentially need help at the moment with graphics and finish building the content management system that the site will run around
[00:36]<fyguwq>i have it estimated i will get it done by myself in 2009
[00:36]<rslyrzyrr>haah







