3v4l.org

run code in 300+ PHP versions simultaneously
<?php function make_literal($s) { $chars = [0x09 => "\t","\n",".","\f","\r", 0x20 => " ","!","\"","#","\$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","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","{","|","}","~"]; return implode("", array_map(fn($c) => $chars[ord($c)], str_split($s, 1))); } function test($s) { echo "is_literal = ", (is_literal($s) ? "true" : "false"), " for: $s\n"; } $a = "test"; test($a); test(strtoupper($a)); test(make_literal(strtoupper($a))); test(make_literal(json_encode($_SERVER)));
Output for git.master, git.master_jit, rfc.property-hooks
is_literal = Fatal error: Uncaught Error: Call to undefined function is_literal() in /in/EaN9Z:8 Stack trace: #0 /in/EaN9Z(11): test('test') #1 {main} thrown in /in/EaN9Z on line 8
Process exited with code 255.

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:
61.5 ms | 401 KiB | 8 Q