Jimmy’s Blog

Tag: variable function name

Learn some PHP and see variable function names (omg)

by jimmy on Nov.02, 2007, under English, PHP, Programming

Because my current team consist Java & PHP programmers I start to learn some PHP basic, point of view, and it’s programmer paradigm :)

I learn that this code is actually works :-p

<?php

$someVariable = “anyName”;
$name = “Jimmy”;

$someVariable($name);

function anyName($name) {
echo “$name, Hello World”;
}

?>

The statement “$someVariable($name); really call method anyName.

Although I fascinated by how dynamic it is (I remember encounter it at VBA), but personally I against it.
I don’t think it is a good practice, and it’ll be hard to be understand by other programmer.

Or is it because my Java programming paradigm….

2 Comments :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...