Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Wednesday, April 7, 2010

PHP's case sensitivity in function names

Hi Everyone,

Just thought I'd toss out a random tidbit. I've found a program that tried to define a function name that conflicted with a global function name, but not like you would expect.

They used camel case for the function name, when the system defined function didn't. Unfortunately function names in PHP are NOT case sensitive, as shown in the following experiment:


<?php

function test_func() {
echo 'test_func';
}

function Test_Func() {
echo 'Test_Func';
}


Running this script gives:


bill-hamiltons-imac:~ bill$ php test.php

Fatal error: Cannot redeclare test_func() (previously declared in /Users/bill/test.php:4) in /Users/bill/test.php on line 9


So there you have it. PHP function names are not case sensitive which some of you may already know but this is obviously the proof.

Thanks!

Wednesday, February 24, 2010

Funny Web Accidents

Good News Everyone,

Terrible news everyone... haha. Thought I would post something funny I have found, MAN Google can be fun. Check out site site: http://www.moveandstay.com/melbourne-shopping.php

Now answer the BONUS QUESTION: what does "phpects" mean?

Hint (spoiler alert), ever tried replacing ASP with PHP?

HAHA!