Bug #73113 [Opn->Csd]: Segfault with throwing JsonSerializable
Edit report at https://bugs.php.net/bug.php?id=73113&edit=1
ID: 73113
Updated by: jpauli@php.net
Reported by: nicolas dot grekas+php at gmail dot com
Summary: Segfault with throwing JsonSerializable
-Status: Open
+Status: Closed
Type: Bug
-Package: Scripting Engine problem
+Package: JSON related
PHP Version: 7.1Git-2016-09-19 (Git)
-Assigned To:
+Assigned To: jpauli
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2016-09-19 12:09:59] nicolas dot grekas+php at gmail dot com
Description:
------------
Throwing from jsonSerialize() crashes on PHP 7.1
Test script:
---------------
<?php
class JsonSerializableObject implements \JsonSerializable
{
public function jsonSerialize()
{
throw new \Exception('This error is expected');
}
}
$obj = new JsonSerializableObject();
echo json_encode($obj);
echo "\n";
Expected result:
----------------
an exception
Actual result:
--------------
a segfault
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73113&edit=1
Thread (2 messages)