3v4l.org

run code in 300+ PHP versions simultaneously
<?php $MsgAry1 = ["A","B","C","D","E","F","G","H","I","J", "K","L","M","N","O","P","Q","R","S","T", "U","V","W","X","Y","Z","a","b","c","d", "e","f","g","h","i","j","k","l","m","n", "o","p","q","r","s","t","u","v","w","x", "y","z","1","2","3","4","5","6","7","8", "9","0",".",",","'","?","!"," ","_","-"]; $strings = [ 'test', '1234', 'w0ws3r!', '##tag##', "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'?! _-" ]; foreach ($strings as $string) { echo "$string match: " . var_export(!preg_match('~[^\w.,\'?! -]~', $string), true) . "\n"; echo "$string ltrim: " . var_export(!strlen(ltrim($string, implode($MsgAry1))), true) . "\n"; echo "$string ranged ltrim, chars remaining: \"" . ltrim($string, 'A..Za..z0..9.,\'?! _-') . "\"\n---\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
test match: true test ltrim: true test ranged ltrim, chars remaining: "" --- 1234 match: true 1234 ltrim: true 1234 ranged ltrim, chars remaining: "" --- w0ws3r! match: true w0ws3r! ltrim: true w0ws3r! ranged ltrim, chars remaining: "" --- ##tag## match: false ##tag## ltrim: false ##tag## ranged ltrim, chars remaining: "##tag##" --- ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'?! _- match: true ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'?! _- ltrim: true ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'?! _- ranged ltrim, chars remaining: "" ---

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