Working on some code today, I found that the following would work in 5.3, but not earlier.
<?php
class Test{
public function uasort(){
$array = array( 'foo' => 'bar', 123 => 456 );
uasort( $array, 'self::uasort_callback' );
return $array;
}
static private function uasort_callback( $a, $b ){
return 1;
}
}
$Test = new Test;
var_dump( $Test->uasort() );
// version 5.3.2 - works fine
// version 5.2.13 - Fatal error: Cannot call method self::uasort_callback() or method does not exist
Just curious as to what this feature is called, and whether its considered good, bad, (or sloppy) practice, since changing it to
uasort( $array, 'Test::uasort_callback' );
works fine in 5.2 as well.