> php6 will include static late binding
Great. Love the other new features, especially namespaces.
> - until then you have 2 choices,
> create a hack (see below) or stick redundant code into each class you
> want to be a singleton.
The hack doesn't work (See below). Guess we are left with copy-p
Hello,
As the %subj% says.. can't get it to work with PHP5. I mean, you could
do this kind of stuff with templates/generics on other languages and
then make a class singleton by just inheriting from base Singleton
class. No need to redefine GetInstance() (which usually contains the
same redundant
Jake Press wrote:
Hi Francisco,
Your not alone, a number of other users have enountered this bug.
string get_class ( object obj )
Its not a bug...
You are getting class name as a string for output purposes etc..
Doing something like "TestClass"::some_static is ofcourse illegal wih
strings.
--
PHP
Octavian Rasnita wrote:
$var = $_GET['var'] || 'value';
How about:
$var = isset($_GET['var']) ? $_GET['var'] : 'value';
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Semantics. Until any langiage compiles to pure 1s and 0s, it's all about
bytecode. Even C compiles to assembler which is really just a low level
bytecode.
Just a note:
C compiles to opcodes. opcodes are 1s and 0s directly interpreted by CPU.
Same applies to assembler. (asm->opcodes). The true i
Gerard Samuel wrote:
I dont see it in the documentation, but I've seen samples of code using
something to the effect of ->
$foo->method1()->method2()
It's called object dereferencing and its not implemented in PHP4. It is
avalaible in PHP5.
If method1() returns an instance of some object then the
And this won't pose as a security risk to me?
It will. You could emulate namespaces in php. Do something like this:
function init_namespace()
{
// all your script code goes here
}
init_namespace(); // notice the call
This way any globally registered post/get/cookie etc variables wont be
access
ApexEleven wrote:
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.
If you use *return* on global scope in include file that value will be
returned to $a.
-- test.php --
$test = "Hello";
return $test;
-
$a = include "test.php";
Gerben wrote:
how can i find out in PHP which version of GD is installed. I tried checking
for function-existence of imagecreatetruecolor and imagecopyresampled, but
these functions exist in older GD versions, but aren't implemented.
I want to know if I can use the functions imagecreatetruecolor(
Chris Boget wrote:
In PHP4, is there any way to interrupt instantiation of an
object?
class Test
{
function Test()
{
$this = NULL; // Object destroyed by php gc
}
}
$hello = new Test;
// $hello = NULL
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
10 matches
Mail list logo