at 6:18 AM

php: array_key_exists or isset

I know array_key_exists is a function and isset is a keyword, later, i think array_key_exists and isset in PHP is a same or array_key_exists is shortcut for isset. But when i read  on php manual, there is no document that explains that it is the same or related, so i try to look in php source code, and i got the same answers.
In my mind, array_key_exists is like that :)
boolean array_key_exists (key, arrayName) {
    return isset(arrayName[key]);
}

Tulis Komentar dengan akun Facebook Anda.

at 4:31 PM

Default value for return

A few days ago, i try to create a code with PHP, with a function i do a return in function with some values and then i got a mystery about default value for return keyword, to get absolutelly value with this keyword i create a function to test it, like this.

<?php
function defaultValueForReturn(){
   return;
}// now i test it
var_dump (defaultValueForReturn());  ?>

And this is result:


What about with other programming language such as Python, Javascript, etc.
Check this!

Tulis Komentar dengan akun Facebook Anda.