3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://cmps.cz/i/nar/YT-1954.jpg'; function GetRemoteLastModified( $uri ) { // default $unixtime = 0; $fp = fopen( $uri, "r" ); if( !$fp ) {return;} $MetaData = stream_get_meta_data( $fp ); foreach( $MetaData['wrapper_data'] as $response ) { // case: redirection if( substr( strtolower($response), 0, 10 ) == 'location: ' ) { $newUri = substr( $response, 10 ); fclose( $fp ); return GetRemoteLastModified( $newUri ); } // case: last-modified elseif( substr( strtolower($response), 0, 15 ) == 'last-modified: ' ) { $unixtime = strtotime( substr($response, 15) ); break; } } fclose( $fp ); return $unixtime; } var_dump(GetRemoteLastModified('http://cmps.cz/i/nar/YT-1954.jpg'));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: fopen(): php_network_getaddresses: getaddrinfo for cmps.cz failed: System error in /in/qbGgE on line 10 Warning: fopen(http://cmps.cz/i/nar/YT-1954.jpg): Failed to open stream: php_network_getaddresses: getaddrinfo for cmps.cz failed: System error in /in/qbGgE on line 10 NULL

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