3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "@context" => "http://schema.org", "@type" => "BreadcrumbList", "itemListElement" => array([ "@type" => "ListItem", "position" => 1, "item" =>[ "@id" => "www.example.com/", "name" => "Home" ] //I need $lab[] to show here ]) ); $i = 1; foreach ($pages as $page) { $i++; $arr['itemListElement'][] = [ '@type' => 'ListItem', 'position' => $i, 'item' => [ "@id" => $page->getUri(), "name" =>$page->getLabel() ]]; } var_dump($arr,$lab); json_encode($arr);
Output for git.master_jit, git.master, rfc.property-hooks
Warning: Undefined variable $pages in /in/GZbfB on line 19 Warning: foreach() argument must be of type array|object, null given in /in/GZbfB on line 19 Warning: Undefined variable $lab in /in/GZbfB on line 30 array(3) { ["@context"]=> string(17) "http://schema.org" ["@type"]=> string(14) "BreadcrumbList" ["itemListElement"]=> array(1) { [0]=> array(3) { ["@type"]=> string(8) "ListItem" ["position"]=> int(1) ["item"]=> array(2) { ["@id"]=> string(16) "www.example.com/" ["name"]=> string(4) "Home" } } } } NULL

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:
65.04 ms | 402 KiB | 8 Q