3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { static $results=array(); static function insert( $number ) { //Inserts a number into the array array_push( self::$results, $number ); return new static; } static function add( $number ) { //Adds to the last inserted number self::$results[] = array_pop(self::$results) + $number; return new static; } static function results() { //Display results foreach(self::$results as $k=>$v) { echo "{$k} : {$v}<BR>\n"; } } } T::insert(4)-> add(2)-> insert(12)-> insert(2)-> add(1)-> results();
Output for git.master, git.master_jit, rfc.property-hooks
0 : 6<BR> 1 : 12<BR> 2 : 3<BR>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.69 ms | 401 KiB | 8 Q