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.
Search This Blog
10/16/2011
Language Constructions
9/15/2011
Care about Entity-Relationship Model
Entity-Relationship Model is the famous model of databases and their entities, properties and relationships.
At first, it looks a simple model if we concentrate in the reality. This is true, if the properties of each entity and the relationship between entities are realy consistent with truth at any condition. It is important to take care about the names used for each entity and the point in wich they can be broken into other entities to avoid duplicate data.
Although, there are details that I have saw recently: I think there is a natural trend for modelers to link some entities to entities that represent actors (people) instead of linking where they really would need to be linked (to preserve the referential integrity).
8/13/2011
Foreach vs. For
Last year, at a PHP mailing list discussion, I was surprised with the information that the loop structure "for" was faster than "foreach". After, I receive the source of that information: The PHP Benchmark. The site's author said the "for" is faster for write operations, but is slower for reading traveled items. Taking a look at the source-code, I came to the conclusion it was wrong a little strange.
6/26/2011
Error control
Error control is a strategy used to catch situations that blocks a sucessful result of an application operation. This can be viewed in diferent levels of an application. At low level: one function could receive a unespected parameter. At high level, a tool could not accept a specific set of actions from the user.
6/25/2011
Unicode
If you work with Web programming, you might have used character encoding. At begining, computers have used ASCII, that provides basic symbols of English language and some special computer control characters. It was done using 1 byte per character, that could provide 256 characters. In practice, there were only 128 characters, because the first bit was not used.
When other countries starts to use computer, they needed to work with their own language, but ASCII did not provide all language symbols. To resolve that, it was created table maps that associates a symbol with a specific byte. One common charset was ISO-8859-1, that provides Latin symbols. Although, was created many different charsets, incompatible between them and was hard to make programs that suports many languages (many charsets).
To solve this new problem, the Unicode was created. This article shows what unicode is, what are its benefits and how to work with it.
6/14/2011
Scheduled Tasks
Information Systems often have tasks that should be done by schedule. This feature usually is needed because two reasons:
- because the task needs to be called at a specific moment;
- because the task is too long and it is impractible to take the user waiting while the task does not finish.
6/01/2011
PDO - PHP Data Objects
What is PDO?
PDO (PHP Data Objects) is a PHP module created in the Object Oriented Paradigm, and its goal is to provide a standarized way to PHP connect/comunicate to a Relational Database. It was created in PHP version 5. So, PDO is an interface that defines a set of classes and its method signatures to comunicate with a Database.
Each Database Management System (DBMS) can provide its own driver to PDO. Although PDO provide method signatures, some features can not be supported by some DBMS. So, calling this kind of method may be "useless", depending the driver was used or the DBMS model/version. For example, some engines of MySQL DBMS do not support transactions, so, the method "beginTransation" (that begin a new transation) simply take no effect at this condition.
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.
5/18/2011
Accessibility for All
Since I met the Accessibility subject (about 2005, when I went to XXV BCSC), I care about web accessibility development.
5/16/2011
Layout
Although I like and encourage the use of PHP, I do not like one of its most significant feature: the fact that the language is HTML embedded. It is the language has code delimiter and all code behind the delimiter is considered text blocks, which are sent directly to the standard output (often it is an HTML code).
5/10/2011
Data Warehouse
Data Warehouse is a computer system that keeps organization data. Since sectors names until operational data. For example, in a university system, the data warehouse provides classes informations (avaliations, students, professors), it is the operational level of any university.
5/03/2011
Metaprogramming in PHP
With PHP, you can implement a code of a software that can create another code. It is simple, because a PHP script is a text file.
Although, the language allows you to create a script that modify its own behavior at execution time. It can be useful to optimize stretch of code. This feature is based on "eval" PHP function.
4/29/2011
Zend Certified Engineer
Zend Certified Engineer (ZCE) is the consent degree to people who was approved in Zend certification exam. Zend is the company that mantains PHP language and Zend Framework.
We have less than 200 PHP Zend Certified Engineers in Brazil. Although, the degree is one valid way to comprove a certain knowledge about the language. It helps some companies to select candidates.
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/25/2011
Why did you choose PHP?
Well, I was thinking about: why do I use PHP? I met the language after I have learned a little of Perl, and as soon I saw it I loved it. In few time, I was noting that it is more fantastic then I though. It did "magic" for programmers. I select some features:
- Consistency;
- Variable variables;
- Variable functions;
- "eval" function to run dinamic code;
- Magic methods and some interfaces to overload core language actions;
- Easy casting from data types.
4/23/2011
SELF
Do you know?
Other day I discovered something basic, but that I did not find at PHP documentation. It is one use of reserved word self.
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.
How to create an ORM layer
Last post was about the concept of ORM. This post is about what we expect in an ORM layer and some tips of how to implement an ORM layer by yourself.
Object Relational Mapping (ORM)
Well, for my first post about technology, I decided to write about something high level and, suddenly, that is not so known between PHP programmers: ORM. I expect, initially, to show the concept and maybe, in future posts, inspect it with more acuracy.
One more blog about PHP
Hi, everyone.
In 2009 I started writting a blog (PHP, Web e coisas assim) where I frequently post about PHP, web and stuff like that. Expecting to reach a bigger public, I have just decided to translate each post of that blog from portuguese to english.
My name is Rubens Takiguti Ribeiro, [today] I am 26 years old and I work with PHP since 2004. In 2009 I became a Zend Certified Engineer in PHP 5, so let's talk about PHP...