PHP & More

A technical blog about programming in PHP and about technology in general: programming, workarounds and troubleshooting

One thing I wish to see in languages such as PHP is to find them supporting the complex type. Complex numbers are more than vectors in 2D, and I wish to see expression containing them parsed just like the ones with real numbers. Python supports them, and you have to import ‘cmath’ to use functions …

Continue reading

How do you declare a static variable in a JavaScript function? Not with the word “static“. In JavaScript “function” is a variable type similar to “object“. The difference is that the reference to a function inside itself is not this but arguments.callee. An example of using arguments.callee is the following function that returns itself: function …

Continue reading