3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export(preg_split('~.{3}\K~', 'abcdefghijklm', 3)); echo "\n---\n"; var_export([preg_replace('~.{3}\K~','*', 'abcdefghijklm', 3, $count1), $count1]); echo "\n---\n"; var_export([preg_filter('~.{3}\K~', '*', 'abcdefghijklm', 3, $count2), $count2]); echo "\n---\n"; var_export(preg_grep('~.{3}\K~', ['abcdef', 'ghijklm'])); echo "\n---\n"; var_export(preg_match_all('~(.{3})\K~', 'abcdefghijklm', $m1) ? $m1 : null); echo "\n---\n"; var_export(preg_match_all('~.{3}\K~', 'abcdefghijklm', $m2) ? $m2 : null); echo "\n---\n"; var_export([preg_replace_callback('~.{3}\K~', function() { return '*'; }, 'abcdefghijklm', 3, $count3), $count3]);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'abc', 1 => 'def', 2 => 'ghijklm', ) --- array ( 0 => 'abc*def*ghi*jklm', 1 => 3, ) --- array ( 0 => 'abc*def*ghi*jklm', 1 => 3, ) --- array ( 0 => 'abcdef', 1 => 'ghijklm', ) --- array ( 0 => array ( 0 => '', 1 => '', 2 => '', 3 => '', ), 1 => array ( 0 => 'abc', 1 => 'def', 2 => 'ghi', 3 => 'jkl', ), ) --- array ( 0 => array ( 0 => '', 1 => '', 2 => '', 3 => '', ), ) --- array ( 0 => 'abc*def*ghi*jklm', 1 => 3, )

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:
32.6 ms | 402 KiB | 8 Q