PHP Language

TwitterFacebook
Get flash to fully experience Pearltrees
This "tip" is for those who receive the error "Object of class X could not be converted to string" when __toString() is not possible, and it is not a choice to process or not - for example when received via debug_backtrace(). I use to have a logging function called LogEnter() and another called LogExit() that I use to call at every function when intensively debugging. http://php.net/manual/en/language.oop5.magic.php

Magic Methods

mod_fcgid and timeouts | Where The Bits Roam

http://wherethebitsroam.com/blogs/jeffw/modfcgid-and-timeouts At work we use mod_fcgid to run php (libapache2-mod-fcgid from Debian to be exact). This makes php nice and fast, but more importantly, it runs each site's php pages as that site's user.

mod_fcgid

Summary http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
http://xdebug.org/docs/remote

XDebug

Xdebug provides an interface for debugger clients that interact with running PHP scripts. This section explains how to set-up PHP and Xdebug to allow this, and introduces a few clients.
http://php.net/manual/en/language.exceptions.php

Exceptions

PHP 5 has an exception model similar to that of other programming languages.
http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/index.html

Seven habits for writing secure PHP applications

When it comes to security, remember that in addition to actual platform and operating system security issues, you need to ensure that you write your application to be secure.
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/li_phpDocumentor.html

phpDocumentor

What makes good documentation?
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net s earch for in the http://php.net/manual/en/index.php

PHP Manual

http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static , constant , and overridden properties or methods of a class. When referencing these items from outside the class definition, use the name of the class.

Scope Resolution Operator (::)

Variable scope

http://php.net/manual/en/language.variables.scope.php The scope of a variable is the context within which it is defined. For the most part all PHP variables only have a single scope.
The differance of float and double dates back to a FORTRAN standard. In FORTRAN Variables aren't as loosly written as in PHP and you had to define variable types(OH NOES!).

Types

Arrays

Why is $foo[bar] wrong? Always use quotes around a string literal array index.
You don't technically have to, but its good form.

How to Clear an Array Completely?

A string is series of characters, where a character is the same as a byte.

Strings

If you want a function to return all text in a string up to the Nth occurrence of a substring, try the below function. Works in PHP >= 5.

String Functions