3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* How many times the code under test should run in each function */ define('LOOP', 10); define('MAX', 10); function f1() { for ($i = 0; $i < LOOP; ++$i) { // one liner array_map with anonymous function - 5.3+ return $array = array_map(function($d) { return 'count_' . $d; }, range(0, MAX)); } } function f2() { for ($i = 0; $i < LOOP; ++$i) { // another (convoluted) one line approach, avoiding array_map - 5.2+ return $array = explode('#', 'count_' . implode('#count_', range(0, MAX))); } } echo f1();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/c6sN9 on line 27 Array

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:
51.36 ms | 401 KiB | 8 Q