3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 /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 /in/k5iin on line 10
Process exited with code 255.