Skip to content

Instantly share code, notes, and snippets.

@walf443
Created December 10, 2012 03:46
Show Gist options
  • Save walf443/4248281 to your computer and use it in GitHub Desktop.
Save walf443/4248281 to your computer and use it in GitHub Desktop.
phpおそろしい子!!
<?php
function echoCount($val)
{
var_dump($val);
echo "=> ";
echo count($val);
echo "\n";
}
echoCount("a");
echoCount("1");
echoCount("0");
echoCount(1);
echoCount(0);
echoCount(true);
echoCount(false);
@walf443
Copy link
Author

walf443 commented Dec 10, 2012

string(1) "a"
=> 1
string(1) "1"
=> 1
string(1) "0"
=> 1
int(1)
=> 1
int(0)
=> 1
bool(true)
=> 1
bool(false)
=> 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment