3v4l.org

run code in 300+ PHP versions simultaneously
<?php function guidv4() { $data = file_get_contents('/dev/urandom', false, null, 0, 16); $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); } echo guidv4();
Output for git.master, git.master_jit
Warning: file_get_contents(): open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s): (/tmp:/in:/etc) in /in/fVj1e on line 3 Warning: file_get_contents(/dev/urandom): Failed to open stream: Operation not permitted in /in/fVj1e on line 3 Warning: Trying to access array offset on value of type bool in /in/fVj1e on line 4 Deprecated: ord(): Passing null to parameter #1 ($character) of type string is deprecated in /in/fVj1e on line 4 Deprecated: Automatic conversion of false to array is deprecated in /in/fVj1e on line 4 Warning: Undefined array key 8 in /in/fVj1e on line 5 Deprecated: ord(): Passing null to parameter #1 ($character) of type string is deprecated in /in/fVj1e on line 5 Fatal error: Uncaught TypeError: bin2hex(): Argument #1 ($string) must be of type string, array given in /in/fVj1e:6 Stack trace: #0 /in/fVj1e(6): bin2hex(Array) #1 /in/fVj1e(9): guidv4() #2 {main} thrown in /in/fVj1e on line 6
Process exited with code 255.
Output for rfc.property-hooks
Warning: file_get_contents(): open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s): (/tmp:/in:/etc) in /in/fVj1e on line 3 Warning: file_get_contents(/dev/urandom): Failed to open stream: Operation not permitted in /in/fVj1e on line 3 Warning: Trying to access array offset on false in /in/fVj1e on line 4 Deprecated: ord(): Passing null to parameter #1 ($character) of type string is deprecated in /in/fVj1e on line 4 Deprecated: Automatic conversion of false to array is deprecated in /in/fVj1e on line 4 Warning: Undefined array key 8 in /in/fVj1e on line 5 Deprecated: ord(): Passing null to parameter #1 ($character) of type string is deprecated in /in/fVj1e on line 5 Fatal error: Uncaught TypeError: bin2hex(): Argument #1 ($string) must be of type string, array given in /in/fVj1e:6 Stack trace: #0 /in/fVj1e(6): bin2hex(Array) #1 /in/fVj1e(9): guidv4() #2 {main} thrown in /in/fVj1e on line 6
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:
49.38 ms | 402 KiB | 8 Q