Skip to content

Instantly share code, notes, and snippets.

@vstarck
Created June 13, 2012 21:16
Show Gist options
  • Save vstarck/2926553 to your computer and use it in GitHub Desktop.
Save vstarck/2926553 to your computer and use it in GitHub Desktop.
broken.lambdas.php
<?php
// Constants may only evaluate to scalar values
define('MY_CONSTANT', function() {});
class Foo {
// Parse error: syntax error, unexpected T_FUNCTION
const IS_GET = function() {};
// Parse error: syntax error, unexpected T_FUNCTION
private $foo = function() {};
// Parse error: syntax error, unexpected T_FUNCTION
private $fns = array(
'foo' => function() {};
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment