Skip to content

Instantly share code, notes, and snippets.

View gist:9997388
#include <stdio.h>
void hi(int a, float b) {
printf("a = %d\n", a);
printf("b = %f\n", b);
int main(void) {
void (*hello)(float,int) = (void(*)(float,int))hi;
View PHP gotcha 2013
$o1 = new stdclass($a=8);
var_dump($a); // Notice: Undefined variable: a
$o2 = new Datetime($b='now');
var_dump($b); // string "now"
dshafik / tokenize.php
Created September 27, 2013 03:29
A script to tokenize a given PHP script and display the list of tokens.
View tokenize.php
#!/usr/bin/env php
if (!isset($_SERVER['argv'][1])) {
echo "Usage: {$_SERVER['argv'][0]} <filename>" . PHP_EOL;
$tokens = token_get_all(file_get_contents($_SERVER['argv'][1]));
foreach ($tokens as $token) {
if (is_integer($token[0])) {