3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ const X = 10; static function dotest(){ $arr = array(0 => 5, 1=>12, 2=>7, 3=>5, 4, 13); $valid = array_filter( $arr, function( $item ) use(self::X) { return ( $item < self::X ); }); var_dump($valid); } } test::dotest();
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected 'self' (T_STRING), expecting '&' or variable (T_VARIABLE) in k5iin on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_STRING, expecting '&' or T_VARIABLE in k5iin on line 10
Process exited with code 255.

preferences:
162.26 ms | 1386 KiB | 41 Q