3v4l.org

run code in 500+ PHP versions simultaneously
<?php /** * segfault test * * I encountered during app bug hunt, whereby instead of * `$w->method()` it called `$this->method()`. * * However, I discovered that infinite recursion which * usually triggers memory limit or max_recursion_depth * * For minimal testcase for segfault see: method4() */ class Y { public function method() { } } class X { public function method(): array { $ws = [new Y]; return array_map(function ($w) { return ['id' => 3, 'something' => $this->method()]; // this effectivly recurses (I was debugging a typo, this should have been `$w->method()`) }, $ws); } public function method2() { $this->method2(); } public function method3() { $a = function (){ $this->method3(); }; $a(); } // minimal testcase for segfault <---------------------- MINIMAL TESTCASE public function method4() { $a = function (){ $this->method4(); }; array_map($a,[1]); } } // original test-harnes // (new X)->method(); // Allowed memory size exhausted // (new X)->method2(); // also, Allowed memory size exhausted //(new X)->method3(); // minimal testcase for segfault (new X)->method4();

Abusive script

This script was stopped while abusing our resources

Output for git.master_jit, git.master

Process exited with code 139.
Output for rfc.property-hooks
Fatal error: Out of memory (allocated 27262976 bytes) (tried to allocate 20480 bytes) in /in/AajsP on line 47 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.57 ms | 1448 KiB | 4 Q