PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /am/paramount/vol/ecs/sites/whiley/wp-includes/class-wp-hook.php on line 298


  • No categories


Unlike more traditional object-oriented languages, all compound structures (e.g. lists, sets, and records) have value semantics. This means they are passed and returned by-value in their entirety (as in Pascal, or most functional languages) rather than just having their references being passed by value (as in Java, or C#).

But, what does this mean? Well, for example, lists should not be thought of as objects; rather, they should be thought of as values. The following example illustrates why:

void ::main(System.Console console):
    xs = [1,2,3]
    ys = xs
    xs[0] = 2

The above code will print [2,2,3] for xs, followed by [1,2,3] for ys. Thus, the assignment to index 0 of xs does not affect the value of ys. This differs from a language like Java, where one could affect the other.