3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1,2,3,4,5,'E'); function array_pop_array($arr) { $last_element = array_pop($arr); return array($arr, $last_element); } $str = '12345E'; function string_pop(&$str){ $last_char = substr($str, -1); $str = substr($str, 0, -1); return $last_char; } function string_pop_array($str) { $last_char = string_pop($str); return array($str, $last_char); } print_r(string_pop_array($str));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 12345 [1] => E )

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:
27.53 ms | 405 KiB | 5 Q