Bug #77216 [Opn->Nab]: recursive generator crash PHP

From: Date: Wed, 28 Nov 2018 22:17:51 +0000
Subject: Bug #77216 [Opn->Nab]: recursive generator crash PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218193@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77216&edit=1 ID: 77216 Updated by: requinix@php.net Reported by: dams@php.net Summary: recursive generator crash PHP -Status: Open +Status: Not a bug Type: Bug Package: Reproducible crash Operating System: Irrelevant PHP Version: 7.3.0RC6 Block user comment: N Private report: N New Comment: That's just plain infinite recursion. Recursive generators work fine. https://3v4l.org/Hd0OE Previous Comments: ------------------------------------------------------------------------ [2018-11-28 21:58:41] dams@php.net Description: ------------ When a generator calls itself (what an idea), PHP crashes. Test script: --------------- <?php function generator($n) { foreach(generator($n) as $l) { yield $l; } } foreach(generator(10) as $l) { print $l; } // Also https://3v4l.org/8FXB3 Expected result: ---------------- No crash, please. Can I ask for recursive generators? No? Well, A warning or a nice fail will do. Actual result: -------------- Segmentation fault: 11 On OSX Process exited with code 139. On linux. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77216&edit=1

« previous php.bugs (#218193) next »