3v4l.org

run code in 300+ PHP versions simultaneously
<?php $finfo = new finfo(FILEINFO_MIME_TYPE); $postMimeType = $finfo->buffer(file_get_contents('http://4.bp.blogspot.com/-JOqxgp-ZWe0/U3BtyEQlEiI/AAAAAAAAOfg/Doq6Q2MwIKA/s1600/google-logo-874x288.png')); // If the URL has the file extension included, this will find it $fileExtension = pathinfo($imageUrl, PATHINFO_EXTENSION); // Otherwise, get file extension from the MIME type // This is necessary for image thumbnails to display correctly in the WordPress dashboard media section if ($fileExtension === '') { $fileExtension = basename($postMimeType); $filename = $filename . '.' . $fileExtension; } var_dump($fileExtension);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for 4.bp.blogspot.com failed: System error in /in/ljKN1 on line 4 Warning: file_get_contents(http://4.bp.blogspot.com/-JOqxgp-ZWe0/U3BtyEQlEiI/AAAAAAAAOfg/Doq6Q2MwIKA/s1600/google-logo-874x288.png): Failed to open stream: php_network_getaddresses: getaddrinfo for 4.bp.blogspot.com failed: System error in /in/ljKN1 on line 4 Warning: Undefined variable $imageUrl in /in/ljKN1 on line 7 Deprecated: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in /in/ljKN1 on line 7 Warning: Undefined variable $filename in /in/ljKN1 on line 13 string(7) "x-empty"

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