3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* TL;DR list($key, $callback) = each($callbacks); can be replaced with $key = key($callbacks); $callback = current($callbacks); next($callbacks); */ /* Original example */ $callbacks = [ 'key1' => 'value1', 'key2' => 'value2', ]; list($key, $callback) = each($callbacks); var_dump($key, $callback); // Verify which value $callbacks point to after each() has advanced the internal array pointer var_dump(current($callbacks)); /* Replacement example */ $callbacks = [ 'key1' => 'value1', 'key2' => 'value2', ]; $key = key($callbacks); $callback = current($callbacks); next($callbacks); var_dump($key, $callback); // Verify which value $callbacks point to after next() has advanced the internal array pointer var_dump(current($callbacks));
Output for rfc.property-hooks, git.master, git.master_jit
Fatal error: Uncaught Error: Call to undefined function each() in /in/DWYMt:19 Stack trace: #0 {main} thrown in /in/DWYMt on line 19
Process exited with code 255.

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:
42.33 ms | 1547 KiB | 4 Q