3v4l.org

run code in 500+ PHP versions simultaneously
<?php $products = array( array( 'product_name' => 'My First Product', 'price' => 50, 'sizes' => [ 'S', 'L', 'XL' ] ), array( 'product_name' => 'My Second Product', 'price' => 45, 'sizes' => [ 'S', 'M', 'L', 'XL' ] ) ); $productNames = array(); foreach ($products as $product) { if (in_array('M', $product['sizes'])) $productNames[] = $product['product_name']; } print_r($productNames);
Output for rfc.property-hooks
Array ( [0] => My Second Product )
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.

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:
41.81 ms | 1154 KiB | 4 Q