News Feed
Sections




News Archive
feed this:

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

DZone.com:
Running JavaScript inside PHP code
March 01, 2012 @ 09:56:45

On DZone.com Giorgio Sironi has a new post about an interesting new PHP extension that lets you run javascript inside PHP - v8js (VERY alpha right now).

v8js is a new PHP extension able to run JavaScript code inside V8, Google's JavaScript interpreter that powers for example Chrome and NodeJS. This extension is highly alpha - and its API would probably change in the months ahead. Since documentation is lacking, I invite you to repeat the discovering process I follow in this post in case you find some differences in a new version of v8js.

He gives you the (PECL-based) commands to get the extension and it's needed dependencies installed and enabled. He uses PHP's own Reflection features to look at the extension and find its methods including: "executeString", "getPendingException" and "getExtensions". To show it in action, he implements an old standby to test new languages - the FizzBuzz example - in Javascript, executed inside the PHP. He also includes a quick example of how to load in an external Javascript file and execute the results.

0 comments voice your opinion now!
javascript extension execute v8js google interpreter


Github.com:
Lisphp - Lisp in PHP
July 07, 2010 @ 10:55:55

From the "just because you can" category today Lunant has created a port of the Lisp language via an interpreter in PHP - Lisphp.

Lisphp is a Lisp dialect written in PHP. It was created to be embedded in web services or to be distributed within web applications. For that reason, it implements sandbox environment for security issues and multiple environment instances.

You can grab the latest code from the github page for the project as well as check out some of the tutorials and details about using the interpreter features like use/from, custom functions and custom macros.

0 comments voice your opinion now!
lisp interpreter dialect github


Jack Diederich's Blog:
Comparing the Ruby/PHP/Python C Interpreters
March 17, 2010 @ 15:02:13

Recently on his blog Jack Diederich took a look at three different interpreters for Ruby, PHP and Python to see how they were implemented as compared to the language they're used in.

The other day I went poking around the Ruby and PHP interpreters (the current stable versions). I hadn't looked inside PHP since the 4.x series and Ruby I had never checked out. Like CPython the internals of both PHP and Ruby look something like their resulting language, but in C. For each interpreter I just compiled it and looked at how core types and extension types were implemented.

For PHP, he went with the PHP 5.2.13 release and talks about the compile process (a bit spammy), running the unit tests that come included and how the interpreter handles data types, core types and objects.

0 comments voice your opinion now!
compare interpreter ruby python


Johan Mares' Blog:
Running PHP CLI shell scripts
January 06, 2009 @ 08:47:57

Johan Mares has a recent post about using PHP on the command line:

I already knew how to run PHP scripts from the command line (CLI), although I never really used it. What was new to me was that there are 2 ways of doing this. The first one is by using the php command and the second, and new for me, is by adding a shebang on the first line of your script.

His first way is to run the PHP file through the interpreter directly (via a command line call to something like "php myfile.php"). The second it to actually include the path to the interpreter inside the PHP file itself and use the shell to execute the contents based on that (adding something like "#!/path/to/php" at the top). Then you just make the file executable and you can run it like any other binary file.

0 comments voice your opinion now!
cli commandline script method interpreter shebang


PHPImpact Blog:
PHP implemented in 100% Java
August 11, 2008 @ 07:58:31

In this recent post to the PHP::Impact blog, Federico talks about a slightly scary thing - a version of PHP implemented 100% in Java.

Quercus allows developers to incorporate Java code into PHP web applications and gives both Java and PHP developers a fast, safe, and powerful alternative to the standard PHP interpreter.

He mentions what it supports - things like Unicode and several of the popular extensions like APC, GD, MySQL, Oracle and PDF). There's also benefits he points out like the speed of the libraries (and safety) as well as interoperability with Java code and frameworks. Check out the official Quercus website for more information.

0 comments voice your opinion now!
java implement quercus library interpreter benefit


DevShed:
Creating a Blog Application with Interpreter Classes with PHP 5
April 16, 2007 @ 11:53:00

DevShed has posted the final part of their look at working with the Interpreter pattern and its use in a PHP5 application with the creation of a simple blogging application.

As you can see, the logic that drives the interpreter pattern is rather easy to understand and implement with functional PHP code. Therefore, in this final installment of the series, I'm going to demonstrate how to get the most out of this handy pattern by developing a highly expansible blogging application. The application will be able to insert, update and delete blog entries, using a simple MySQL database as backend.

They start off with the creation of the MySQL class that will interface with the database backend for the application. Also included is a Result class to fetch the results from each query. On top of these, they create the Blog class to handle the requests for information and a BlogHandler class to push the submitted data back into the database.

Finally, they wrap it all together and give a real-life example of it in action, inserting new blog information and making an update of the content on one.

0 comments voice your opinion now!
designpattern interpreter tutorial blog application designpattern interpreter tutorial blog application


DevShed:
Manipulating String Literals with Interpreter Classes in PHP 5
April 10, 2007 @ 09:08:00

DevShed has the second part of their look at the Interpreter design pattern series posted today. This time, they focus on the manipulation of string literals with Interpreter objects in a simple application.

Bearing in mind that in the first article of the series I illustrated how to use an interpreter class to handle a group of fictional users, in this tutorial I'm going to go teach you how to utilize this pattern for manipulating a set of string processing classes.

They start with a method (well, class really) of handling the strings themselves - a StringSaver class - that can write the information out to a file. On top of this, they create the Interpreter class, defining the different bits of functionality that can be performed on the string (uppercase, lowercase, etc). Finally, they combine the two in a simple example that applies the different interpretations to the given string.

0 comments voice your opinion now!
tutorial string literal interpreter designpattern class php5 tutorial string literal interpreter designpattern class php5


DevShed:
Building Interpreter Classes with PHP 5
April 03, 2007 @ 10:32:00

DevShed is starting off another design pattern series with part one of their look at the interpreter pattern - commonly used along with the Composite pattern to create more modular applications.

In this series, which is comprised of three articles, I'll provide you with numerous code samples showing how to implement this useful pattern, ranging from building a simple application for managing user information to creating a decent blogger.

As mentioned, their goal is to create a simple blogging application (eventually), but for now they just need to lay the foundation. They start with an introduction to the pattern via the creation of the User and UserServer classes. Next up is the creation of the UserInterpreter class to handle the requests and pass them along to the UserSaver. Finally, they show it in use, saving inputted user information into an array.

0 comments voice your opinion now!
designpattern interpreter class php5 tutorial basics designpattern interpreter class php5 tutorial basics


Ligaya Turmelle's Blog:
PocketHPH - A PHP Engine for the Pocket PC Platform
June 18, 2006 @ 19:51:45

On her blog today, Ligaya Turmelle has a quick post about PocketHPH, a PHP processing engine for handheld devices.

On the PocketHPH homepage it notes that the software is currently offered as a demo and can:

  • use a subset of the core PHP functions
  • pass objects/arrays by reference (always)
  • perform minimal error reporting
  • require variables to be defined
  • use superglobals as of PHP4.2.0+
  • SQLite3 database support
  • an alpha feature to allow fopen/file_get_contents

If you're into the mobile platform and want to check out an interesting new development in the PHP world, give PocketHPH a look.

0 comments voice your opinion now!
pocketpc pockethph interpreter processing engine pocketpc pockethph interpreter processing engine


SitePoint PHP Blog:
J4P5 - Javascript For PHP5
January 20, 2006 @ 07:12:54

On the SitePoint PHP Blog today, there's a new post from Harry Fuecks talking about J4P5, a native PHP5 Javascript interpreter.

I kid you not. In fact this looks like a pretty serious attempt. You'll need to download and run yourself. There's grammar rules for Javascript in there and a Javascript runtime written in PHP. It passes the "it works" test'"the examples run straight out of $ unzip. Looking at what it does and the TODO list, aside from the Unicode issue strikes me J4P5 is already more than 50% of the way there.

Aside from novelty, one real world use might be an extension to SimpleTest's web testing capabilities. With a little work there's also potential to create an awesome Javascript source compressor'"the lexing patterns are all there.

He also mentions another project, metaphp, that builds a "higher level langauge" on top of PHP. The parser for it was used in the J4P5 project mentioned above...

0 comments voice your opinion now!
javascript for php5 j4p5 metaphp parser native interpreter javascript for php5 j4p5 metaphp parser native interpreter



Community Events





Don't see your event here?
Let us know!


list series interview laravel code configure community unittest refactor framework podcast threedevsandamaybe introduction testing install language experience developer opinion release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework