This is a "namespace" problem with "::". Is there an official place I
can report php bugs? I'm new to PHP (and soon to be leaving it):
class SomeClass {
function dostuff($ar) {
uasort($ar, 'SomeClass::som esort');
}
function somesort($a,$b) {<-- never gets called
echo "Yes I got called"; //<-- never happens
if ($a[order] == $b[order]) { return 0;}
if ($a[order] < $b[order]) { return -1;};
if ($a[order] > $b[order]) { return 1;};
}
}
SomeClass::dost uff($ar); //put whatever you want in the $ar array to
test
In the line "uasort($ar , 'SomeClass::som esort');",
'SomeClass::som esort' isn't recognized by PHP. I also tried just
'somesort', no go.
I was trying to use a class as a substitute for PHP's lack of
namespaces. (Which btw is the reason I'm bailing out of php.)
Because of this bug I have to put my sorting funct into the global
space, which is ridiculous.
can report php bugs? I'm new to PHP (and soon to be leaving it):
class SomeClass {
function dostuff($ar) {
uasort($ar, 'SomeClass::som esort');
}
function somesort($a,$b) {<-- never gets called
echo "Yes I got called"; //<-- never happens
if ($a[order] == $b[order]) { return 0;}
if ($a[order] < $b[order]) { return -1;};
if ($a[order] > $b[order]) { return 1;};
}
}
SomeClass::dost uff($ar); //put whatever you want in the $ar array to
test
In the line "uasort($ar , 'SomeClass::som esort');",
'SomeClass::som esort' isn't recognized by PHP. I also tried just
'somesort', no go.
I was trying to use a class as a substitute for PHP's lack of
namespaces. (Which btw is the reason I'm bailing out of php.)
Because of this bug I have to put my sorting funct into the global
space, which is ridiculous.
Comment