Skip to content

Instantly share code, notes, and snippets.

@whiolf
whiolf / script_execution_time.php
Created March 31, 2017 12:05
[Script execution time] #php #common #time
$start = microtime(true);
//Some script
$time = microtime(true) - $start;
printf('Script execution time %.4F sec.', $time);
@whiolf
whiolf / php_unserialize.sh
Created February 2, 2016 11:19
Just a quick shell script to unserialize php. If you don't send the string as an argument, it tries OS X clipboard.
#!/usr/bin/env bash
if [[ $1 ]];
then
php -r " echo var_dump(unserialize('"$1"')); echo \"\\n\";"
else
STRING=`pbpaste`
php -r " echo var_dump(unserialize('"$STRING"')); echo \"\\n\";"
fi