3v4l.org

run code in 300+ PHP versions simultaneously
<?php $torrent = 'd8:announce37:http://blender.waag.org:6969/announce13:creation datei1212070099e4:infod6:lengthi196898674e4:name30:big_buck_bunny_720p_stereo.ogg12:piece lengthi262144e6:pieces15040:DñÀsÑ45/'; $old = "/name([0-9]+):(.*?):/i"; $regex = "/lengthi([0-9]+)e[0-9]/i"; $sizes = array(); preg_replace_callback($regex, function($matches) use(&$sizes) { $sizes[] = substr($matches[2], 0, $matches[1]); }, $torrent); var_dump($sizes);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key 2 in /in/GYLHs on line 13 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/GYLHs on line 13 Warning: Undefined array key 2 in /in/GYLHs on line 13 Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/GYLHs on line 13 array(2) { [0]=> string(0) "" [1]=> string(0) "" }

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