Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
How PHP Executes – from Source Code to Render
Jan 03, 2017 @ 18:33:41

The SitePoint PHP blog has a new tutorial posted by author Thomas Punt that walks you through the execution of PHP - a "behind the scenes" look at how the PHP processing engine does its magic.

Inspired by a recent article on how Ruby code executes, this article covers the execution process for PHP code. [...] There’s a lot going on under the hood when we execute a piece of PHP code.

He then walks you through the four main steps the engine goes through to turn your PHP code into results: lexing, parsing, compilation and interpretation. For each stage in the process there's a brief description of what piece(s) of the language are doing the work and some examples of how to see the results in more user-land PHP code (like with the AST parser).

tagged: tutorial execute language lexing parsing compile interpret

Link: https://www.sitepoint.com/how-php-executes-from-source-code-to-render/

Sean Coates' Blog:
PHP Dashboard Widget
Jun 05, 2007 @ 15:13:00

Picking back up on his blog, Sean Coates shares a Dashboard widget he's created to do quick and dirty PHP interpreting on the fly:

I found myself using php -r on the command line to test some simple code snippets, and it occurred to me that this isn't "The Mac Way." So, following the excellent documentation at Apple, I managed to come up with something pretty useful in an afternoon.

His widget sits happily, ready to take in PHP code and output the result at the click of a button.

tagged: dashboard widget interpret macosx dashboard widget interpret macosx

Link:

Sean Coates' Blog:
PHP Dashboard Widget
Jun 05, 2007 @ 15:13:00

Picking back up on his blog, Sean Coates shares a Dashboard widget he's created to do quick and dirty PHP interpreting on the fly:

I found myself using php -r on the command line to test some simple code snippets, and it occurred to me that this isn't "The Mac Way." So, following the excellent documentation at Apple, I managed to come up with something pretty useful in an afternoon.

His widget sits happily, ready to take in PHP code and output the result at the click of a button.

tagged: dashboard widget interpret macosx dashboard widget interpret macosx

Link:

phpaddiction:
Url Routing with PHP - Part Two
Apr 06, 2007 @ 13:41:00

On the phpaddiction site today, there's part two of their tutorial looking at URL routing with PHP (started here in Part One).

With the foundation of the routing in place (from part one), they move on to bigger and better things:

  • assign responsibilities (what needs to be accomplished)
  • creating a standard command object
  • interpreting the URLs and the parameters passed in it
  • using this information to dispatch the correct commands
There's code examples through out to illustrate each point as well as one main one at the end to show how to put it all into action. Their script reads in the URL and sends the command along to the CommandDispatcher - check out this example page to see it in action.

tagged: url routing tutorial command object interpret dispatch url routing tutorial command object interpret dispatch

Link:

phpaddiction:
Url Routing with PHP - Part Two
Apr 06, 2007 @ 13:41:00

On the phpaddiction site today, there's part two of their tutorial looking at URL routing with PHP (started here in Part One).

With the foundation of the routing in place (from part one), they move on to bigger and better things:

  • assign responsibilities (what needs to be accomplished)
  • creating a standard command object
  • interpreting the URLs and the parameters passed in it
  • using this information to dispatch the correct commands
There's code examples through out to illustrate each point as well as one main one at the end to show how to put it all into action. Their script reads in the URL and sends the command along to the CommandDispatcher - check out this example page to see it in action.

tagged: url routing tutorial command object interpret dispatch url routing tutorial command object interpret dispatch

Link:

Elizabeth Smith's Blog:
String Class (Kal_String)
Feb 01, 2006 @ 12:48:47

On her blog today, Elizabeth Smith has this new post highlighting a string class that she's created to overload the basic PHP types to handle multibyte or translated strings.

So my rather cumbersome three classes to handle translation and charsets is now ONE class. When the rest of the magic __toString stuff goes into php (estimated for 5.2, which I wouldn't know if I didn't read internals religiously) it makes it even easier to use.

Kal_String is the class itself. Basically it has TWO constructors - because there are a series of static settings and two static methods that deal with things like a default charset to use for all strings and a default language to look for. The language searching is set up with a callback - so you can write your own class using gettext or including straight php files or whatever you want. You can even manually load in translation strings for individual string instances if you're so inclined.

She gives examples of how to use the class, everything from just a simple output to the use of some of the more advanced "interpretation"-based features.

tagged: string class simple output interpret multibyte overload string class simple output interpret multibyte overload

Link:

Elizabeth Smith's Blog:
String Class (Kal_String)
Feb 01, 2006 @ 12:48:47

On her blog today, Elizabeth Smith has this new post highlighting a string class that she's created to overload the basic PHP types to handle multibyte or translated strings.

So my rather cumbersome three classes to handle translation and charsets is now ONE class. When the rest of the magic __toString stuff goes into php (estimated for 5.2, which I wouldn't know if I didn't read internals religiously) it makes it even easier to use.

Kal_String is the class itself. Basically it has TWO constructors - because there are a series of static settings and two static methods that deal with things like a default charset to use for all strings and a default language to look for. The language searching is set up with a callback - so you can write your own class using gettext or including straight php files or whatever you want. You can even manually load in translation strings for individual string instances if you're so inclined.

She gives examples of how to use the class, everything from just a simple output to the use of some of the more advanced "interpretation"-based features.

tagged: string class simple output interpret multibyte overload string class simple output interpret multibyte overload

Link:


Trending Topics: