Skip to content

Instantly share code, notes, and snippets.


Nikita Popov nikic

View GitHub Profile
View gist:04fce01e69ae5b7b44f8
require './vendor/autoload.php';
// The code samples to parse.
// => bool(false)
$code = '<?php class Foo {public $bar;}';
// => bool(true)
nikic / gist:4162505
Created Nov 28, 2012
Regex to validate (IPv4) CIDR notation (with capture)
View gist:4162505
nikic / gist:1188670
Created Sep 2, 2011 — forked from ircmaxell/gist:1188649
PHP example on variable variables - without needing them
View gist:1188670
function bar($a, $b, $c) {
foreach (compact('a', 'b', 'c') as $key => $value) {
$form[$key] = array(
'#type' => 'hidden',
'#value' => $value,
You can’t perform that action at this time.