From: letmegetone at hotmail dot com Operating system: Windows XP SP3 PHP version: 4.4.8 PHP Bug Type: Ming related Bug description: SWFBitmap object can not be returned
Description: ------------ I want to put some worked codes into a function, in order to make my main script shorter. All other MING classes work well,such as SWFSprite,SWFShape, except SWFBitmap. I can get the error message from apache2: PHP Fatal error: output() [<a href='function.output'>function.output</a>]: Initial Jpeg marker not found! It seems that the SWFBitmap object can not be returned in a function. I tried test like this: CODE I + CODE III :FAILED CODE II + CODE IV :WORKS CODE I + CODE II + CODE III : WORKS Reproduce code: --------------- function get_b()//CODE I { $mfile="xx.jpg"; $fp=fopen($mfile,"r"); $string=fread($fp,filesize($mfile)); $b = new SWFBitmap($string); fclose($fp); return $b; } $mfile="xx.jpg"; $fp=fopen($mfile,"r");//CODE II $string=fread($fp,filesize($mfile)); $b = new SWFBitmap($string); fclose($fp); $s = new SWFShape(); $scale= $s->addFill(get_b()); //CODE III $scale= $s->addFill($b); //CODE IV Expected result: ---------------- Can I put the code with the SWFBitmap object into a function? -- Edit bug report at http://bugs.php.net/?id=45371&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45371&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45371&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45371&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45371&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45371&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45371&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45371&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45371&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45371&r=support Expected behavior: http://bugs.php.net/fix.php?id=45371&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45371&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45371&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45371&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45371&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45371&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45371&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45371&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45371&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45371&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45371&r=mysqlcfg