3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'bar', 'fdsfsf345#3gt#$%3^#$T$#tr43r43', 'test spaces', '"test spaces"', '"fdsfsf345#3gt#$%3^#$T$#tr43r43" #comment', 'test spaces" #comment', 'bar', '""', '""""', 'foo1 #comment2', '"with space value" #comment', 'with quote value\'', 'somestringstart', 'with spaces" # a comment', 'bar' ]; $result=preg_replace('~ #.*~','',$array); var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'bar', 1 => 'fdsfsf345#3gt#$%3^#$T$#tr43r43', 2 => 'test spaces', 3 => '"test spaces"', 4 => '"fdsfsf345#3gt#$%3^#$T$#tr43r43"', 5 => 'test spaces"', 6 => 'bar', 7 => '""', 8 => '""""', 9 => 'foo1', 10 => '"with space value"', 11 => 'with quote value\'', 12 => 'somestringstart', 13 => 'with spaces"', 14 => 'bar', )

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:
203.7 ms | 406 KiB | 5 Q