PHP & More

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

When you see a change in the major version (the number before the first point of the version id), expect a great leap. New features have been added to PHP in version 7, that make programming more convenient. I’m going to discuss some of them. Null Coalescing Suppose you’re trying to get a value from …

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

Node.js is a JavaScript server-side framework. One of the things you can do easily with it is write a HTTP server. a simple “Hello, world” server looks like: http = require (‘http’); http.createServer(function(request, response){ response.write(“Hello, world”); response.end(); }).listen(8888); Now, if you run the simple server and type ‘http://127.0.0.1:8888’ in the URL bar of your browser …

Continue reading