Skip to content

Instantly share code, notes, and snippets.

View ahwayakchih's full-sized avatar
🏠
Working from home

Marcin Konicki ahwayakchih

🏠
Working from home
View GitHub Profile
@ahwayakchih
ahwayakchih / func-vs-var.php
Created June 24, 2011 12:54
Test PHP's function call vs direct access to public static variable
<?php
/*
* Test how function calls compare to direct variable access for simple things
* like switching some flag/option.
*
* Output should show something like:
*
* Direct access took: 0.14991188049316s
* Function call took: 0.55304503440857s
@ahwayakchih
ahwayakchih / mutex.php
Created June 23, 2011 18:03
Test new implementation of Mutex class for Symphony CMS
<?php
/*
* Just upload it to root directory of Symphony CMS installation and access it through web browser, e.g.,
* http://www.example.com/mutex.php
*
* It should output text like:
*
* Try: http://www.example.com/mutex.php?mode=block
* Blocking: Acquired