Search This Blog

Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts

8/22/2012

Heredoc and Nowdoc


Heredoc and Nowdoc (also known as "here document" and "now document") are two alternative representation of strings in PHP (as double quotes and single quotes are).


This post presents these two language features and how to use them.



10/16/2011

Language Constructions

PHP language, like any programming language, is composed by language constructions. Beyond the basic programming structures (conditional, loop, classes syntax, functions syntax, etc), the language has some built-in functions. They are functions compiled in the core language.

5/29/2011

Binary Data at PHP Script

There is a feature in PHP that allows to embed data (including binary data) into PHP scripts and it are not parsed by PHP interpreter. It is diferent from exit instruction, that stops script execution, but does not stop the PHP parser. The feature is provided by "__halt_compiler" instruction, that ignores all data after the point it was called.

5/20/2011

PHP Delimiter

Introduction

PHP is an HTML embedded language. This means the PHP code can be inside an HTML, but should have one way to determine whether a stretch of code is PHP or HTML. The way is the use of PHP delimiters. The PHP interpreter is applicable to the stretch of code delimited by the PHP delimiters.

Some programmers use PHP code delimiters, but they do not know about their nuances. Let's see them at this post.

4/27/2011

Callback

Introduction

Callback is a feature used to pass a function/method by parameter of an other function/method. In general, a function with generic operations receives a callback by parameter and use it to do specific operations. This way, it is possible to use the specific function in diferent places.

4/23/2011

Float Type

The float type is the data type used to represent floating point numbers. In PHP, as in other programming languages, the float type has limits, so precision might be lost. In any case, I will explain that in this article.

4/22/2011

Integer Type

Do you really know the integer type of PHP? It represents a integer number. Well, but we are not here to know what everybody already know. Let's explore something more interesting.