|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-11-09 12:48 UTC] info at backups dot nl
Description: ------------ I am using the code below. in php 8.0 is_resource returns false on this code. I can rewrite that code of course but i want to understand why it now suddenly does not work anymore. Is this a bug or is this caused by the changes made in php 8.0? Please advice Thank you ! Test script: --------------- $file= '/var/public/wp-content/uploads/2020/11/image_001.jpg'; $image = imagecreatefromstring( file_get_contents( $file ) ); if ( !is_resource( $image ) ) return new WP_Error( 'error_loading_image', $image, $file ); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
Instead of if ( !is_resource( $image ) ) use if ( $image === false ) for compatibility with "all" PHP versions.