Bug #78031 [NEW]: __toString segmentation fault

From: Date: Sat, 18 May 2019 01:45:57 +0000
Subject: Bug #78031 [NEW]: __toString segmentation fault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220888@lists.php.net to get a copy of this message
From: gmblar+php at gmail dot com Operating system: macOS 10.14.5 PHP version: Irrelevant Package: PDO related Bug Type: Bug Bug description:__toString segmentation fault Description: ------------ PHP crashes with "Segmentation fault: 11" if you access $this->$this in __toString. maybe related to: * https://bugs.php.net/bug.php?id=53858 * https://bugs.php.net/bug.php?id=67319 https://3v4l.org/Rt2Qj/perf#output Test script: --------------- <?php class Foobar { public function __toString() { $this->$this; } } $foobar = new Foobar(); (string) $foobar; Expected result: ---------------- no segmentation fault Actual result: -------------- Segmentation fault: 11 -- Edit bug report at https://bugs.php.net/bug.php?id=78031&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78031&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78031&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78031&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78031&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78031&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78031&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78031&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78031&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78031&r=support Expected behavior: https://bugs.php.net/fix.php?id=78031&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78031&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78031&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78031&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78031&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78031&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78031&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78031&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78031&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78031&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78031&r=mysqlcfg

« previous php.bugs (#220888) next »