3v4l.org

run code in 300+ PHP versions simultaneously
<?php // okay I was wondering something about loops // say I wanted to get all comments from a db // that's easy with a `foreach` loop // but what if I want to get a reply for each comment in that foreach loop? // well I'd have to put a foreach loop within a foreach loop, no biggy. // but what happens if you'd want an infinite checker that checks a reply // ect. e.g: foreach($comments as $comment) { // output comment // say the nest_id is the id of a comment and the nest_id // is nested as a comment's reply // this is easy foreach($comment->nest_id as $comment_nest) { } } // basically is it possible to loop through something, // then automatically loop another time if there is a reply to a comment // and if there is a reply to that reply then automatically get that? // seems rather complicated.
Output for rfc.property-hooks, git.master, git.master_jit
Warning: Undefined variable $comments in /in/c44dC on line 11 Warning: foreach() argument must be of type array|object, null given in /in/c44dC on line 11

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:
98.46 ms | 1549 KiB | 4 Q