3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = 0; function funsimple() { global $i; if (($i++ % 2_000) === 0) { var_dump($i); } funsimple(); } function fun() { array_map(function ($str) { global $i; if (($i++ % 2_000) === 0) { var_dump($i); } fun(); }, ['x']); } $fx = function () use (&$fx, &$i) { array_map(function ($str) use ($fx, &$i) { if (($i++ % 2_000) === 0) { var_dump($i); } $fx(); }, ['x']); }; // funsimple(); // this produces correctly OOM error // this produces segfault fun(); // $fx(); // using anonymous function, the behaviour is the same

Abusive script

This script was stopped while abusing our resources


preferences:
25.23 ms | 405 KiB | 5 Q