Bug #76534 [Opn->Csd]: PHP hangs on 'illegal string offset on string references with an error handler

From: Date: Wed, 27 Jun 2018 05:10:52 +0000
Subject: Bug #76534 [Opn->Csd]: PHP hangs on 'illegal string offset on string references with an error handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215985@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76534&edit=1 ID: 76534 Updated by: laruence@php.net Reported by: rowan dot f dot leeder at gmail dot com Summary: PHP hangs on 'illegal string offset on string references with an error handler -Status: Open +Status: Closed Type: Bug Package: *General Issues Operating System: Linux PHP Version: 7.2.7 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=d1b1866a3a035b946e50b17eeefd19add81c7eab Log: Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler) Previous Comments: ------------------------------------------------------------------------ [2018-06-27 02:08:21] rowan dot f dot leeder at gmail dot com Description: ------------ Using array assignment on a string reference usually causes a fatal 'Illegal string offset' error. PHP hang when a using an error handler that converts errors to exceptions. This only effects invalid array access on references. An illegal array access on a non reference variable causes the exception to be emitted. Test script: --------------- set_error_handler(function ($severity, $message, $file, $line) { throw new \Exception($message); }); $x = "foo"; $y = &$x["bar"]; Expected result: ---------------- PHP Fatal error: Uncaught Exception: Illegal string offset 'bar' in ... ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76534&edit=1

« previous php.bugs (#215985) next »