that's probably because your PHP probably isn't 5.4 yet
that's probably because your PHP probably isn't 5.4 yet
As of php-5.3.3 IIRC it's treated as a regular method in namespaced classes, that's why.
-snip-
I was using php 5.3.8 up until 10 minutes ago and it was definitely treated as __construct rather than a regular method..
<?php namespace a; class b { public function b() { echo 'a\b::b() called!\n'; } } namespace main; $b = new \a\b;
nothing gets printed out on 5.3.6
When was array notations like this introduced in PHP?
Nevermind, 5.4.0 apparently.. Funny though, this request has been declined numerous times in the past.
Oh, I never use namespaces so obviously I've never encountered such problems.
you should still try to avoid deprecated features
Yes, I agree, right after your comment I actually change it in all of my classes. Thanks.
Unless you have error reporting off or set to a very low level you should have gotten a warning from PHP about it.
I got error reporting set to whatever maximum level is possible, it reports everything.
I want to make a site where users can create their own page. Said page could be accessed with <profile-name>.mysite.com
What host allows for me to do this with subdomains?
What's the downside to this? (as opposed to mysite.com/<profile-name>)
I know that cookies can't be passed from each subdomain.
All the webhosts Ive seen so far allowed subdomains.
1and1 is limited and they must be created manually.
With lenode I'm sure I'll have unlimited subs, I'll have to learn how to make them dynamically though.
you don't 'make them dynamically'.
you have a wildcard subdomain so that all user subdomains get routed to the same app. then you inspect $_SERVER["HTTP_HOST"] and dispatch the request accordingly
Has anyone here used CakePHP?
if you're going to do that just use Rails.
what kmart said
You see those long dashes on the sides of "it costs nothing"
How get?
![]()
How can I get my site to work with Mobile devices?
When I get on k8r from my phone it insists on zooming out so far that I can't see the text.
I want the width of my phone to dictate the width of the screen.
How does that begin to happen?
(User was permabanned for this post ("Alt of permabanned user Haley" - Gran PC))
Make a separate mobile site?
Nice to see you got rated dumb for a pretty innocuous question.
It's fairly simple in theory - don't use fixed widths, or at least strongly avoid them, use CSS Media Queries when you need to adjust the page style depending on the device (but be wary of needless repetition), and make use of the Viewport meta tag:
https://developer.mozilla.org/en/CSS/Media_queries
https://developer.mozilla.org/en/Mob...wport_meta_tag
Apple has also implemented meta tags to control how the page is displayed and how it reacts to events like zooming out.
http://mobile.tutsplus.com/tutorials...app-meta-tags/
Good resource for that. I lost the link to the Apple developer documentation for it, sorry.
Edited:
Oh damn it Stinky!
(Mine has other meta tag uses though)
it's called 'responsive web design' and is quite a hot topic at the moment, look it up
Anyone know of any PHP math libraries. I'm looking for Vector3D and Vector2D classes - and I want to check before I write them myself.
Tip for -Kesil-: Some people think it's smart to use user agents, don't.
Edited:
Just curious, what's this for?
Are browser extensions written in javascript?
or...
I notice that the Silver Bird (twitter extension) works in Mac's Google Chrome and Windows7's Google Chrome. So I doubt that it's written in C or C++.
But I also highly doubt it's written in "Chrome Code" simply because I've never heard of it.
I wish to make a browser plugin for Chrome and FireFox. Depending on exactly how it is done [[ which I'm thinking there are simply just special javascript handles that each browser has and that's the only difference ]] I might be able to do both.
Edited:
extension* (changed from "plugin")
---------AND SO I WAS GIVEN THIS-----------
http://code.google.com/chrome/extens...etstarted.html
Firefox extensions are written in Javascript. Don't know about the other ones though.
never mind.. already made one now :x
There's not a whole lot of exciting options going on in PHP when it comes to Math-centric development.
There's the very basic fNumber: http://flourishlib.com/docs/fNumber and friends.
There's the archaic PHP/Math library: http://www.phpmath.com/
And then there's all the icky miscellaneous user-released code mashes. Doing it yourself was probably the fastest and cleanest option, really.
Want to share what you came up with?
What I did isn't that great - but it works for now. I never realised you couldn't so operator overloads in PHP, that just seems crazy. They really seem militant towards the idea too.
I added static functions to replace it, so that
$a = $b - $c
becomes
$a = Vector2D::GetSub( $b, $c )
It's incomplete because I've only filled in what I needed.
<?php class Vector2D { public $x; public $y; public static function GetSub( $a, $b ) { $o = new Vector2D( $a ); $o->Sub( $b ); return $o; } public static function GetMul( $a, $b ) { $o = new Vector2D( $a ); $o->Mul( $b ); return $o; } public function __construct( $x = 0, $y = 0 ) { $this->Set( $x, $y ); } public function Set( $x, $y = 0 ) { if ( is_object( $x ) ) return $this->Set( $x->x, $x->y ); $this->x = $x; $this->y = $y; } public function Sub( $v ) { $this->x -= $v->x; $this->y -= $v->y; } public function Add( $v ) { $this->x += $v->x; $this->y += $v->y; } public function Mul( $v ) { $this->x *= $v; $this->y *= $v; } public function ToString() { return "$this->x $this->y"; } };
I didn't think that operators were considered methods in php
Some good, free icon packs?
do you even fucking google before posting
I posted some packs a couple weeks ago in this thread, there are some really nice ones there.
I'm having a bit of trouble with Apache and virtual hosting, I've got 2 domains and 1 web server (VPS). I've got both domains with an A record pointing to the IP of my VPS and I've setup the apache2.conf correctly (as far as I know). One domain works fine (adam-wilson.me) yet the other (xenforge.co.uk) only seems to work when I put www infront of it.
Here's an image to describe it easier:
Anyone have any idea what's going on?
It's been a while since I used Apache.
I assume you have the same A records for each domain (@ and www). This is what I used to do IIRC:
ServerName domain.co.uk
ServerAlias www.domain.co.uk
You might want to split the first domain into it's own document root like you did with the second domain as well.