Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. 32-bit integers have limited range. You can point to exactly 2^32 different timestamps. When you go too far into the future or the past you're fucked.
  2. He is waynewex, duh.
  3. That's because you need to choose either the "dist" or "recommended" version as your php.ini file. You can also write your own from scratch of course, but I haven't heard of anyone doing that.
  4. Why don't you just sort it using your query?
  5. No. It's just Tom who was messing with stuff.
  6. Maybe you should tell the SMF team that. They don't seem to have figured that out yet.
  7. No. If you don't define a constructor, it's the same thing as defining a constructor with no body and no parameters. In PHP, you can pass an infinite number of arguments to a function. The extra ones will just be discarded. In your case, the return value of getName() would always be NULL. Variables in PHP are always initialized to NULL until they're given a value. This includes when you use an undefined variable (which you shouldn't). Only if you have something you need to do in the constructor. It won't hurt doing it though. You just need to remember that if a child class defines a constructor, the parent class' constructor will not be called automatically. That becomes your responsibility when you define a constructor. Mostly it's a matter of style. A reason might be that if you don't define properties, they won't be inherited by children classes and you cannot control the visibility. Also, the constructor is a real method that you can actually call. This is often done in a child class by doing like parent::__construct($something);. It also makes it easier to see what is part of the constructor and what isn't when it's defined in its own method. They are not predefined variables. The foreach loops works by iterating over all the elements in an array (though foreach can be used on objects implementing the Traversable interface). For each element in the array it will bind the value of the key to $key and the value of the value to $val when you use $key => $val. You can choose whatever name you want.
  8. Lol... I took the more "direct" approach of trying to find my way around the source code :-\ Unfortunately, official resources about the inner workings of the engine are very sparse.
  9. To be pedantic, 'this' is not an instance variable per say, but rather a pseudo-variable which in essence acts as a 'reference variable (or perhaps better phrased as an alias or object identifier) placeholder' which is 'the current instance of this class'. I think the term 'instance variable' is pretty much the object's properties. Just to be really pedantic, when you're inside the scope of an object, the PHP engine will add a zval with type IS_OBJECT to EG(active_symbol_table) (a hash table containing all variables in the current scope) and give it the symbol name "this". It works like all other variables. Internally in PHP, each "object" variable contains a reference to the object instance. So if $a is an object and you do $b = $a you'll add another entry in the symbol table that holds a reference to the same object instance. $this is stored in the symbol table in the same way as all other variables are. When the manual says calls it a "pseudo-variable" it's more because it's something that's automatically created. Almost like magic It has to work that way. Otherwise, if it wasn't holding a reference to the object like all other variables do, what would happen when you pass $this as an argument to a function or method? You're even allowed to do stupid things like unset($this); (though you can't reassign $this to something else). That is my understanding of how the engine works anyway.
  10. Of course. I can also play this game, in some other parts of the world $8/hr is not much at all What's your point? That statement is entirely useless. If it's a lot of money where you live you're not going to get away with charging $35/hr just because someone in another country does. You can't just compare salaries internationally like that. In countries where they are lowly paid (relatively to you) it's generally also much cheaper living, so when you adjust for that, you are likely earning just as much as that person. Why do you think many people choose to outsource to companies like India? This is exactly the reason. The average pay in India is way lower than in the U.S.
  11. That's because Object-Oriented Programming is not about classes but... *drumroll* objects And just to make it clear, you are not doing OOP just because you've instantiated an object. If you merely use it as a wrapper/namespace for your functions, then yes, it's entirely pointless. But then again, that's not the point of OOP.
  12. Not nearly as bad as the one posted in OP: http://bugs.php.net/bug.php?id=50729&edit=1 "I posted this problem in Experts Exchange and we couldn't figure it out there either." Lol okay... [ot]I can see this topic getting out of control quickly... :\[/ot]
  13. According to Wikipedia, they are Java Servlets.
  14. Explode the string using explode and then validate it using checkdate.
  15. Yeah, and they'll probably claim that the pirates are ruining their profit in a few months.
  16. Only if you live in a country where there are laws retarded enough to let that happen. Also, there is no international patent system.
  17. Ten minutes should be ample time to fix typos and the like. Just be happy it isn't a mailing list with zero deletion or editing. Think before you hit the post button and you won't even need an edit feature.
  18. I'll have to say that I'm not too fond of the orange colors seeing as blue is a de facto standard for links on the internet. Making them orange might mislead more than help.
  19. You cannot copyright or trademark ideas though. For instance, Facebook is a trademark, it's layout is copyrighted, but its functionality is comprised of ideas. For ideas you need patents. These are expensive, and in terms of software development stupid (http://www.nosoftwarepatents.com/en/m/intro/index.html).
  20. I'm partial to #2.
  21. True. I don't know what would be a good styling though. I don't know how to make things look pretty. I only know how to make them work
  22. Well, I still don't see why that should prevent us from helping people who do want to follow the links.
  23. It only changed because the default SMF theme changed.
  24. Okay, bug reported: http://www.simplemachines.org/community/index.php?topic=359289.0
  25. I'm not sure why that would happen. In SMF's Settings.php it's set to $boardurl = 'http://www.phpfreaks.com/forums'; Anyways, for the certificate, it's not "bad" per se. It's just that your browser doesn't trust our certificate. You can mark our root certificate as trusted somewhere in your browser's settings. It's just an extra for whomever wants to use it, and that's why it isn't the default URL (at least it shouldn't be). Edit: It wouldn't happen to be a link to this post, right? I posted it using the SSL connection so maybe SMF is being stupid and is just using my URL instead of the config URL.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.