From:
Operating system:
PHP version: 5.3.3
Package: SPL related
Bug Type: Bug
Bug description:SplFileObject::fscanf Segmentation fault
Description:
------------
Segmentation fault when using additional parameters SplFileObject::fscanf
Test script:
---------------
<?php // test
error_reporting(E_ALL);
echo "TEST 1:\n";
$f = new SplFileObject(__FILE__, 'r');
$f->fscanf('<?php // %s', $result);
echo $result;
echo "TEST 2:\n";
$result = null;
$f = new SplFileObject(__FILE__, 'r');
$f->fscanf('<?php // %s', $result);
echo $result;
Expected result:
----------------
TEST 1:
test
TEST 2:
test
Actual result:
--------------
TEST 1:
<br />
<b>Notice</b>: Undefined variable: result in <b>/tmp/fail.php</b> on line
<b>7</b><br />
<br />
<b>Notice</b>: Undefined variable: result in <b>/tmp/fail.php</b> on line
<b>8</b><br />
TEST 2:
<br />
<b>Warning</b>: Parameter 3 to fscanf() expected to be a reference, value
given in <b>/tmp/fail.php</b> on line <b>15</b><br />
Segmentation fault
--
Edit bug report at http://bugs.php.net/bug.php?id=52573&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52573&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52573&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52573&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52573&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52573&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52573&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52573&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52573&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52573&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52573&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52573&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52573&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52573&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52573&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52573&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52573&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52573&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52573&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52573&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52573&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52573&r=mysqlcfg