phpspec screencast

After @sD_Tobi recently poked me whether I knew phpspec, … and initially I had no idea except for having heard of it … I found this excellent screencast on laracasts.com to get a first impression. It’s just 17 minutes and he’s really enthusiastic about it :-)

Planted: Mar 23, 2016 · 1 min

Happy & Lucky Numbers

The other day I paired with the guys from @solutiondrive and @niklas_heer, we had a fun evening learing about happy numbers, shared PhpStorm knowledge, tried Codeception etc. Actually we didn’t even finish the “Happy Numbers” Kata, since we only wrote the classifying routine, not the loop generating the output. On my way home I kept googling and also found out about Lucky Numbers. Lucky numbers are natural numbers, recursively filtered by a sieve that eliminates numbers based on their position (where the second number tells the elimination offsets)....

Planted: Mar 10, 2016 · 2 min

funny Math.random behaviour

Playing around with V8’s custom startup snapshots I noticed some funny behaviour regarding Math.random. It is clear that if you call Math.random() within the custom startup code the generated random numbers are baked into the snapshot and then not so random anymore. If you call Math.random() at runtime, without custom startup code, it just behaves as expected: it generates random numbers. However if you have custom startup code, calling Math.random() early on startup, it correctly generates random numbers during startup but it breaks runtime random number generation causing weird error messages like...

Planted: Mar 5, 2016 · 1 min

20x performance boost with V8Js snapshots

Recently @virgofx filed an issue on V8Js whether (startup) performance of V8Js could be increased. He wants to do server-side React rendering and noticed that V8 itself needs roughly 50ms to initialize and then further 60ms to process React & ReactServer javascript code. Way too much for server side rendering (on more or less every request). Up to V8 4.4 you simply could compile it with snapshots and V8Js made use of them....

Planted: Feb 29, 2016 · 2 min

V8Js approaching PHP7

For some weeks now I had the idea that V8Js must be running on PHP7 the day it is officially published. So when I started out porting soon after they published he first release candidate (aka 7.0.0RC1) I felt some pressure, especially after noticing that it really will be a lot of work to do. The more glad I am to announce today, that V8Js finally compiles fine and passes the whole test suite from the master branch (apart from tiny modifications that became necessary due to PHP 5....

Planted: Oct 5, 2015 · 1 min

Two more V8Js releases

Today as well as last Thursday I uploaded two more V8Js releases to PECL, both fixing issues around v8::FunctionTemplate usage that bit me at work. Those v8::FunctionTemplate objects are used to construct constructor functions (and thus object templates) in V8. The problem with them? They are not object to garbage collection. So if we export a object with a method attached to it from PHP to JS, V8Js at first exports the object (and caches the v8::FunctionTemplate used to construct it; re-using it on subsequent export of the same class)....

Planted: Sep 1, 2015 · 1 min

Poor V8Function call performance

Today I noticed, that invocations of V8Function objects have a really poor call performance. A simple example might be: $v8 = new V8Js(); $func = $v8->executeString('(function() { print("Hello\\n"); });'); for($i = 0; $i < 1000; $i ++) { $func(); } … on my laptop this takes 2.466 seconds (with latest V8Js 0.2.1); older versions like V8Js 0.1.5 even take 80 seconds. That felt strange, since V8Js performance generally is pretty good and the slightly changed version...

Planted: Aug 26, 2015 · 1 min

php.net account approved

After waiting for a really long time (half a year) I finally have an approved php.net + PECL account granted with lead-rights on V8Js :-) … therefore I finally published V8Js version 0.2.0, succeeding 0.1.5 which was published 1.5 years ago. Changes include adapt to latest v8 API (v8 versions from 3.24.6 up to latest 4.3 branch supported now) v8 debugging support apply time & memory limits to V8Function calls...

Planted: Mar 13, 2015 · 1 min

V8Js Patches merged

Today the last pull request in a series of contributions to the V8Js PHP extension has been merged. Good time to loose some words on the project and why I like it, so here we go :-) V8Js is a PHP extension that integrates Google’s V8 JavaScript engine into PHP. This is the extension allows you to execute JavaScript code securely sandboxed from PHP. Besides it allows for simple exchange of data from PHP to JavaScript and back....

Planted: Jul 17, 2013 · 3 min