3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyClass { private static $data = array( 'banana', 'cherry', 'apple' ); private static function sort_by_text( $first, $second ) { return strcasecmp( $first, $second ); } public static function sorted_data() { usort( self::$data, array( __CLASS__, 'sort_by_text' ) ); return self::$data; } } print_r( MyClass::sorted_data() ); usort( array( 'banana', 'cherry', 'apple' ), array( __CLASS__, 'sort_by_text' ) );
Output for 5.3.0 - 5.4.16
Fatal error: Only variables can be passed by reference in /in/IQo2N on line 16
Process exited with code 255.